Fix the parsing of colors in attributed string tests, and make it possible to dump...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2018 15:55:33 +0000 (15:55 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 18 Jul 2018 15:55:33 +0000 (15:55 +0000)
commitb94872e2c7ce51d18d51fd2d085edb987e06c3cb
tree5368c195cbe5c41b5931a59b1bc10c869be1cd9c
parentc3fca58a05147fa12920494fa3008c0adc2ed942
Fix the parsing of colors in attributed string tests, and make it possible to dump the typing attributes
https://bugs.webkit.org/show_bug.cgi?id=187747

Reviewed by Ryosuke Niwa.

Tools:

Add textInputController.attributedStringForTyping(), which returns a one-character
attributed string whose attributes are the typing attributes, making it possible to
test -[WebView typingAttributes].

Sadly WebCore's convertObjcValueToValue() doesn't know how to convert NSDictionary,
so we can't return -typingAttributes directly.

* DumpRenderTree/mac/TextInputControllerMac.m:
(+[TextInputController isSelectorExcludedFromWebScript:]):
(-[TextInputController attributedStringForTyping]):

LayoutTests:

Fix the parsing of color properties in dump-attributed-string.js, and treat NSStrokeColor as
a color. Rebase all the affected tests. Give macOS Sierra its own expectations with the legacy NSCustomColorSpace.

Add attributed-string-for-typing.html which tests typingAttributes.

* editing/mac/attributed-string/anchor-element-expected.txt:
* editing/mac/attributed-string/attributed-string-for-typing-expected.txt: Added.
* editing/mac/attributed-string/attributed-string-for-typing.html: Added.
* editing/mac/attributed-string/basic-expected.txt:
* editing/mac/attributed-string/comment-cdata-section-expected.txt:
* editing/mac/attributed-string/font-size-expected.txt:
* editing/mac/attributed-string/font-style-variant-effect-expected.txt:
* editing/mac/attributed-string/font-weight-expected.txt:
* editing/mac/attributed-string/letter-spacing-expected.txt:
* editing/mac/attributed-string/resources/dump-attributed-string.js:
(dumpAttributedString):
(formatNonParagraphAttributeValue):
(parseNSColorDescription):
(window.onload):
(serializeAttributedString.log): Deleted.
(serializeAttributedString.): Deleted.
(serializeAttributedString): Deleted.
* editing/mac/attributed-string/text-decorations-expected.txt:
* editing/mac/attributed-string/vertical-align-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/anchor-element-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/attributed-string-for-typing-expected.txt: Added.
* platform/mac-sierra/editing/mac/attributed-string/basic-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/comment-cdata-section-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/font-size-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/font-style-variant-effect-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/font-weight-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/letter-spacing-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/text-decorations-expected.txt:
* platform/mac-sierra/editing/mac/attributed-string/vertical-align-expected.txt:
* platform/mac/editing/mac/attributed-string/anchor-element-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/basic-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/comment-cdata-section-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/font-size-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/font-style-variant-effect-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/font-weight-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/letter-spacing-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/text-decorations-expected.txt: Removed.
* platform/mac/editing/mac/attributed-string/vertical-align-expected.txt: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@233913 268f45cc-cd09-0410-ab3c-d52691b4dbfc
34 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/mac/attributed-string/anchor-element-expected.txt
LayoutTests/editing/mac/attributed-string/attributed-string-for-typing-expected.txt [new file with mode: 0644]
LayoutTests/editing/mac/attributed-string/attributed-string-for-typing.html [new file with mode: 0644]
LayoutTests/editing/mac/attributed-string/basic-expected.txt
LayoutTests/editing/mac/attributed-string/comment-cdata-section-expected.txt
LayoutTests/editing/mac/attributed-string/font-size-expected.txt
LayoutTests/editing/mac/attributed-string/font-style-variant-effect-expected.txt
LayoutTests/editing/mac/attributed-string/font-weight-expected.txt
LayoutTests/editing/mac/attributed-string/letter-spacing-expected.txt
LayoutTests/editing/mac/attributed-string/resources/dump-attributed-string.js
LayoutTests/editing/mac/attributed-string/text-decorations-expected.txt
LayoutTests/editing/mac/attributed-string/vertical-align-expected.txt
LayoutTests/platform/mac-sierra/editing/mac/attributed-string/anchor-element-expected.txt
LayoutTests/platform/mac-sierra/editing/mac/attributed-string/attributed-string-for-typing-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-sierra/editing/mac/attributed-string/basic-expected.txt
LayoutTests/platform/mac-sierra/editing/mac/attributed-string/comment-cdata-section-expected.txt
LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-size-expected.txt
LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-style-variant-effect-expected.txt
LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-weight-expected.txt
LayoutTests/platform/mac-sierra/editing/mac/attributed-string/letter-spacing-expected.txt
LayoutTests/platform/mac-sierra/editing/mac/attributed-string/text-decorations-expected.txt
LayoutTests/platform/mac-sierra/editing/mac/attributed-string/vertical-align-expected.txt
LayoutTests/platform/mac/editing/mac/attributed-string/anchor-element-expected.txt [deleted file]
LayoutTests/platform/mac/editing/mac/attributed-string/basic-expected.txt [deleted file]
LayoutTests/platform/mac/editing/mac/attributed-string/comment-cdata-section-expected.txt [deleted file]
LayoutTests/platform/mac/editing/mac/attributed-string/font-size-expected.txt [deleted file]
LayoutTests/platform/mac/editing/mac/attributed-string/font-style-variant-effect-expected.txt [deleted file]
LayoutTests/platform/mac/editing/mac/attributed-string/font-weight-expected.txt [deleted file]
LayoutTests/platform/mac/editing/mac/attributed-string/letter-spacing-expected.txt [deleted file]
LayoutTests/platform/mac/editing/mac/attributed-string/text-decorations-expected.txt [deleted file]
LayoutTests/platform/mac/editing/mac/attributed-string/vertical-align-expected.txt [deleted file]
Tools/ChangeLog
Tools/DumpRenderTree/mac/TextInputControllerMac.m