Title: [233913] trunk
Revision
233913
Author
[email protected]
Date
2018-07-18 08:55:33 -0700 (Wed, 18 Jul 2018)

Log Message

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.

Modified Paths

Added Paths

Removed Paths

  • trunk/LayoutTests/platform/mac/editing/mac/attributed-string/

Diff

Modified: trunk/LayoutTests/ChangeLog (233912 => 233913)


--- trunk/LayoutTests/ChangeLog	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/ChangeLog	2018-07-18 15:55:33 UTC (rev 233913)
@@ -1,3 +1,54 @@
+2018-07-18  Simon Fraser  <[email protected]>
+
+        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.
+        
+        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.
+
 2018-07-17  Antoine Quint  <[email protected]>
 
         Ensure timingFunctionForKeyframeAtIndex() can be used from setAnimatedPropertiesInStyle().

Modified: trunk/LayoutTests/editing/mac/attributed-string/anchor-element-expected.txt (233912 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/anchor-element-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/editing/mac/attributed-string/anchor-element-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -24,16 +24,16 @@
     TighteningForTruncation: YES
     HeaderLevel: 0
 [webkit.org]
-    NSColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSColor: #0000ee (sRGB)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
     NSLink: https://webkit.org/
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0.933333 1
+    NSStrokeColor: #0000ee (sRGB)
     NSStrokeWidth: 0
     NSUnderline: true
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 

Added: trunk/LayoutTests/editing/mac/attributed-string/attributed-string-for-typing-expected.txt (0 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/attributed-string-for-typing-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/editing/mac/attributed-string/attributed-string-for-typing-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -0,0 +1,9 @@
+Some text here
+Input:
+<div id="editor" style="color: rgba(23, 45, 56, 0.4);" contenteditable="">Some text here</div>
+
+Output:
+[ ]
+    NSColor: rgba(23, 45, 56, 0.4) (sRGB)
+    NSFont: Times-Roman 16.00 pt.
+

Added: trunk/LayoutTests/editing/mac/attributed-string/attributed-string-for-typing.html (0 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/attributed-string-for-typing.html	                        (rev 0)
+++ trunk/LayoutTests/editing/mac/attributed-string/attributed-string-for-typing.html	2018-07-18 15:55:33 UTC (rev 233913)
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+<script>
+    shouldAutoDump = false;
+</script>
+</head>
+<body>
+
+<div id="editor" style="color: rgba(23, 45, 56, 0.4);" contenteditable>Some text here</div>
+
+<script type="text/_javascript_">
+    
+document.getElementById("editor").focus();
+getSelection().setPosition(editor, 0);
+
+if (window.testRunner) {
+    var attribString = textInputController.attributedStringForTyping()
+    var serialized = serializeAttributedString(attribString);
+ 
+    var pre = document.createElement('pre');
+    pre.textContent = 'Input:\n' + editor.outerHTML.trim() + '\n\nOutput:\n' + serialized;
+
+    document.body.appendChild(pre);
+}
+
+</script>
+
+</body>
+</html>

Modified: trunk/LayoutTests/editing/mac/attributed-string/basic-expected.txt (233912 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/basic-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/editing/mac/attributed-string/basic-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -27,74 +27,74 @@
 [hello ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [world]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
-    NSColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #0000ff (sRGB)
+    NSColor: #ffffff (sRGB)
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 1 1 1 1
+    NSStrokeColor: #ffffff (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [WebKit]
-    NSColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSColor: #0000ee (sRGB)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
     NSLink: https://webkit.org/
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0.933333 1
+    NSStrokeColor: #0000ee (sRGB)
     NSStrokeWidth: 0
     NSUnderline: true
 [.\n]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [this is a ]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (sRGB)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [t]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (sRGB)
     NSFont: Times-Italic 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
     NSUnderline: true
 [est]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (sRGB)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
     NSUnderline: true
 [ of ]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (sRGB)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [attributed]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (sRGB)
     NSFont: Times-Italic 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ string.]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (sRGB)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/editing/mac/attributed-string/comment-cdata-section-expected.txt (233912 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/comment-cdata-section-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/editing/mac/attributed-string/comment-cdata-section-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -26,6 +26,6 @@
 [hello world. ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/editing/mac/attributed-string/font-size-expected.txt (233912 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/font-size-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/editing/mac/attributed-string/font-size-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -35,91 +35,91 @@
 [small element]
     NSFont: Times-Roman 13.33 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [xx-small]
     NSFont: Times-Roman 9.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [x-small]
     NSFont: Times-Roman 10.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [small]
     NSFont: Times-Roman 13.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ normal ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [large]
     NSFont: Times-Roman 18.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [x-large]
     NSFont: Times-Roman 24.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [xx-large]
     NSFont: Times-Roman 32.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [5pt]
     NSFont: Times-Roman 6.67 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [15pt]
     NSFont: Times-Roman 20.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/editing/mac/attributed-string/font-style-variant-effect-expected.txt (233912 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/font-style-variant-effect-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/editing/mac/attributed-string/font-style-variant-effect-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -30,31 +30,31 @@
 [italic]
     NSFont: Times-Italic 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [oblique]
     NSFont: Times-Italic 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [small-caps]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ outline emboss ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/editing/mac/attributed-string/font-weight-expected.txt (233912 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/font-weight-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/editing/mac/attributed-string/font-weight-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -35,51 +35,51 @@
 [bold]
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ font weight 100 font weight 200 font weight 300 font weight 400 font weight 500 ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [font weight 600]
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [font weight 700]
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [font weight 800]
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [font weight 900]
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/editing/mac/attributed-string/letter-spacing-expected.txt (233912 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/letter-spacing-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/editing/mac/attributed-string/letter-spacing-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -26,6 +26,6 @@
 [3pt ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/editing/mac/attributed-string/resources/dump-attributed-string.js (233912 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/resources/dump-attributed-string.js	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/editing/mac/attributed-string/resources/dump-attributed-string.js	2018-07-18 15:55:33 UTC (rev 233913)
@@ -1,10 +1,11 @@
+var shouldAutoDump = true;
+
 (function () {
     if (window.testRunner)
         testRunner.dumpAsText();
 
-    var called = false;
     function dumpAttributedString(container) {
-        called = true;
+        shouldAutoDump = false;
 
         var body = document.body;
         if (!container)
@@ -20,7 +21,7 @@
         body.appendChild(pre);
     }
 
-    function serializeAttributedString(attributedString) {
+    window.serializeAttributedString = function (attributedString) {
         var string = attributedString.string();
         var output = '';
         function log(text) {
@@ -67,6 +68,7 @@
         case 'NSFont':
             return value.match(/(.+?)\s+P \[\]/)[1];
         case 'NSColor':
+        case 'NSStrokeColor':
         case 'NSBackgroundColor':
             var parsed = parseNSColorDescription(value);
             return serializeColor(parsed.rgb, parsed.alpha) + ' (' + parsed.colorSpace + ')';
@@ -86,7 +88,7 @@
     }
 
     function parseNSColorDescription(value) {
-        var match = value.match(/\s*(\w+)\s*([0-9\.]+)\s*([0-9\.]+)\s*([0-9\.]+)\s*([0-9\.]+)/);
+        var match = value.match(/^\s*(\w+).+\s([0-9\.]+)\s+([0-9\.]+)\s+([0-9\.]+)\s+([0-9\.]+)\s*$/);
         return {
             colorSpace: match[1],
             rgb: match.slice(2, 5).map(function (string) { return Math.round(string * 255); }),
@@ -126,7 +128,7 @@
     }
 
     window._onload_ = function () {
-        (!called)
+        if (shouldAutoDump)
             dumpAttributedString();
     }
 })();

Modified: trunk/LayoutTests/editing/mac/attributed-string/text-decorations-expected.txt (233912 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/text-decorations-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/editing/mac/attributed-string/text-decorations-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -28,23 +28,23 @@
 [underline]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
     NSUnderline: true
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [strike]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
     NSStrikethrough: true
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [ underline and strike ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/editing/mac/attributed-string/vertical-align-expected.txt (233912 => 233913)


--- trunk/LayoutTests/editing/mac/attributed-string/vertical-align-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/editing/mac/attributed-string/vertical-align-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -30,45 +30,45 @@
 [sup element]
     NSFont: Times-Roman 13.33 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
     NSSuperScript: 1
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [sub element]
     NSFont: Times-Roman 13.33 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
     NSSuperScript: -1
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [vertical align super]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
     NSSuperScript: 1
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 [vertical align sub]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
     NSSuperScript: -1
 [ vertical align 50% ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (sRGB)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/anchor-element-expected.txt (233912 => 233913)


--- trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/anchor-element-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/anchor-element-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -24,16 +24,16 @@
     TighteningForTruncation: YES
     HeaderLevel: 0
 [webkit.org]
-    NSColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSColor: #0000ee (NSCustomColorSpace)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
     NSLink: https://webkit.org/
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0.933333 1
+    NSStrokeColor: #0000ee (NSCustomColorSpace)
     NSStrokeWidth: 0
     NSUnderline: true
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 

Added: trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/attributed-string-for-typing-expected.txt (0 => 233913)


--- trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/attributed-string-for-typing-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/attributed-string-for-typing-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -0,0 +1,9 @@
+Some text here
+Input:
+<div id="editor" style="color: rgba(23, 45, 56, 0.4);" contenteditable="">Some text here</div>
+
+Output:
+[ ]
+    NSColor: rgba(23, 45, 56, 0.4) (NSCustomColorSpace)
+    NSFont: Times-Roman 16.00 pt.
+

Modified: trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/basic-expected.txt (233912 => 233913)


--- trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/basic-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/basic-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -27,74 +27,74 @@
 [hello ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [world]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
-    NSColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #0000ff (NSCustomColorSpace)
+    NSColor: #ffffff (NSCustomColorSpace)
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 1 1 1 1
+    NSStrokeColor: #ffffff (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [WebKit]
-    NSColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSColor: #0000ee (NSCustomColorSpace)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
     NSLink: https://webkit.org/
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0.933333 1
+    NSStrokeColor: #0000ee (NSCustomColorSpace)
     NSStrokeWidth: 0
     NSUnderline: true
 [.\n]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [this is a ]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (NSCustomColorSpace)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [t]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (NSCustomColorSpace)
     NSFont: Times-Italic 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
     NSUnderline: true
 [est]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (NSCustomColorSpace)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
     NSUnderline: true
 [ of ]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (NSCustomColorSpace)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [attributed]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (NSCustomColorSpace)
     NSFont: Times-Italic 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ string.]
-    NSBackgroundColor: rgba(255, 2295, 1530, 6) (IEC6)
+    NSBackgroundColor: #ffff00 (NSCustomColorSpace)
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/comment-cdata-section-expected.txt (233912 => 233913)


--- trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/comment-cdata-section-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/comment-cdata-section-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -26,6 +26,6 @@
 [hello world. ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-size-expected.txt (233912 => 233913)


--- trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-size-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-size-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -35,91 +35,91 @@
 [small element]
     NSFont: Times-Roman 13.33 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [xx-small]
     NSFont: Times-Roman 9.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [x-small]
     NSFont: Times-Roman 10.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [small]
     NSFont: Times-Roman 13.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ normal ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [large]
     NSFont: Times-Roman 18.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [x-large]
     NSFont: Times-Roman 24.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [xx-large]
     NSFont: Times-Roman 32.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [5pt]
     NSFont: Times-Roman 6.67 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [15pt]
     NSFont: Times-Roman 20.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-style-variant-effect-expected.txt (233912 => 233913)


--- trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-style-variant-effect-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-style-variant-effect-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -30,31 +30,31 @@
 [italic]
     NSFont: Times-Italic 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [oblique]
     NSFont: Times-Italic 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [small-caps]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ outline emboss ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-weight-expected.txt (233912 => 233913)


--- trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-weight-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/font-weight-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -35,51 +35,51 @@
 [bold]
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ font weight 100 font weight 200 font weight 300 font weight 400 font weight 500 ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [font weight 600]
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [font weight 700]
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [font weight 800]
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [font weight 900]
     NSFont: Times-Bold 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/letter-spacing-expected.txt (233912 => 233913)


--- trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/letter-spacing-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/letter-spacing-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -26,6 +26,6 @@
 [3pt ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/text-decorations-expected.txt (233912 => 233913)


--- trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/text-decorations-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/text-decorations-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -28,23 +28,23 @@
 [underline]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
     NSUnderline: true
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [strike]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
     NSStrikethrough: true
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [ underline and strike ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 

Modified: trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/vertical-align-expected.txt (233912 => 233913)


--- trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/vertical-align-expected.txt	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/LayoutTests/platform/mac-sierra/editing/mac/attributed-string/vertical-align-expected.txt	2018-07-18 15:55:33 UTC (rev 233913)
@@ -30,45 +30,45 @@
 [sup element]
     NSFont: Times-Roman 13.33 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
     NSSuperScript: 1
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [sub element]
     NSFont: Times-Roman 13.33 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
     NSSuperScript: -1
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [vertical align super]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
     NSSuperScript: 1
 [ ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 [vertical align sub]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
     NSSuperScript: -1
 [ vertical align 50% ]
     NSFont: Times-Roman 16.00 pt.
     NSKern: 0pt
-    NSStrokeColor: NSCustomColorSpace sRGB IEC61966-2.1 colorspace 0 0 0 1
+    NSStrokeColor: #000000 (NSCustomColorSpace)
     NSStrokeWidth: 0
 

Modified: trunk/Tools/ChangeLog (233912 => 233913)


--- trunk/Tools/ChangeLog	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/Tools/ChangeLog	2018-07-18 15:55:33 UTC (rev 233913)
@@ -1,3 +1,21 @@
+2018-07-18  Simon Fraser  <[email protected]>
+
+        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.
+        
+        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]):
+
 2018-07-18  Carlos Garcia Campos  <[email protected]>
 
         [GLIB] Add jsc_context_check_syntax() to GLib API

Modified: trunk/Tools/DumpRenderTree/mac/TextInputControllerMac.m (233912 => 233913)


--- trunk/Tools/DumpRenderTree/mac/TextInputControllerMac.m	2018-07-18 14:43:50 UTC (rev 233912)
+++ trunk/Tools/DumpRenderTree/mac/TextInputControllerMac.m	2018-07-18 15:55:33 UTC (rev 233913)
@@ -50,6 +50,7 @@
 #import <WebKit/WebScriptObject.h>
 #import <WebKit/WebTypesInternal.h>
 #import <WebKit/WebView.h>
+#import <WebKit/WebViewPrivate.h>
 #import <wtf/mac/AppKitCompatibilityDeclarations.h>
 
 @interface TextInputController (DumpRenderTreeInputMethodHandler)
@@ -235,6 +236,7 @@
         || aSelector == @selector(firstRectForCharactersFrom:length:)
         || aSelector == @selector(characterIndexForPointX:Y:)
         || aSelector == @selector(validAttributesForMarkedText)
+        || aSelector == @selector(attributedStringForTyping)
         || aSelector == @selector(attributedStringWithString:)
         || aSelector == @selector(setInputMethodHandler:)
         || aSelector == @selector(dictatedStringWithPrimaryString:alternative:alternativeOffset:alternativeLength:)
@@ -454,6 +456,12 @@
     return nil;
 }
 
+- (NSMutableAttributedString *)attributedStringForTyping
+{
+    // The string has to be non-empty.
+    return [[[NSMutableAttributedString alloc] initWithString:@" " attributes:[webView typingAttributes]] autorelease];
+}
+
 - (NSMutableAttributedString *)attributedStringWithString:(NSString *)aString
 {
     return [[[NSMutableAttributedString alloc] initWithString:aString] autorelease];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to