Title: [231165] trunk
Revision
231165
Author
commit-qu...@webkit.org
Date
2018-04-30 12:56:28 -0700 (Mon, 30 Apr 2018)

Log Message

Serialize font-variation-settings with double-quotes per spec
https://bugs.webkit.org/show_bug.cgi?id=182542

Patch by Chris Nardi <cna...@chromium.org> on 2018-04-30
Reviewed by Myles C. Maxfield.

Source/WebCore:

According to the CSSOM spec [1], all strings should be serialized with double-quotes.
The axis name in font-variation-settings was previously serialized with single-quotes;
change this to double-quotes to match the spec and non-WebKit browsers.

[1]: https://drafts.csswg.org/cssom/#common-serializing-idioms

Updated fast/text/variations/getComputedStyle.html to test the change.

* css/CSSFontVariationValue.cpp:
(WebCore::CSSFontVariationValue::customCSSText const):

LayoutTests:

Updated test to verify double-quotes are used.

* fast/text/variations/getComputedStyle-expected.txt:
* fast/text/variations/getComputedStyle.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (231164 => 231165)


--- trunk/LayoutTests/ChangeLog	2018-04-30 19:41:57 UTC (rev 231164)
+++ trunk/LayoutTests/ChangeLog	2018-04-30 19:56:28 UTC (rev 231165)
@@ -1,3 +1,15 @@
+2018-04-30  Chris Nardi  <cna...@chromium.org>
+
+        Serialize font-variation-settings with double-quotes per spec
+        https://bugs.webkit.org/show_bug.cgi?id=182542
+
+        Reviewed by Myles C. Maxfield.
+
+        Updated test to verify double-quotes are used.
+
+        * fast/text/variations/getComputedStyle-expected.txt:
+        * fast/text/variations/getComputedStyle.html:
+
 2018-04-30  Simon Fraser  <simon.fra...@apple.com>
 
         Make color-filter affect caret-color

Modified: trunk/LayoutTests/fast/text/variations/getComputedStyle-expected.txt (231164 => 231165)


--- trunk/LayoutTests/fast/text/variations/getComputedStyle-expected.txt	2018-04-30 19:41:57 UTC (rev 231164)
+++ trunk/LayoutTests/fast/text/variations/getComputedStyle-expected.txt	2018-04-30 19:56:28 UTC (rev 231165)
@@ -1,11 +1,11 @@
-PASS window.getComputedStyle(document.getElementById('test0')).getPropertyValue('font-variation-settings') is "'hght' 400"
-PASS window.getComputedStyle(document.getElementById('test1')).getPropertyValue('font-variation-settings') is "'hght' 500"
-PASS window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings') is "'wdth' 500, 'hght' 400"
+PASS window.getComputedStyle(document.getElementById('test0')).getPropertyValue('font-variation-settings') is "\"hght\" 400"
+PASS window.getComputedStyle(document.getElementById('test1')).getPropertyValue('font-variation-settings') is "\"hght\" 500"
+PASS window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings') is "\"wdth\" 500, \"hght\" 400"
 PASS window.getComputedStyle(document.getElementById('test3')).getPropertyValue('font-variation-settings') is window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings')
 PASS window.getComputedStyle(document.getElementById('test4')).getPropertyValue('font-variation-settings') is "normal"
 PASS window.getComputedStyle(document.getElementById('test5')).getPropertyValue('font-variation-settings') is "normal"
 PASS window.getComputedStyle(document.getElementById('test6')).getPropertyValue('font-variation-settings') is "normal"
-PASS window.getComputedStyle(document.getElementById('test7')).getPropertyValue('font-variation-settings') is "'hght' 999999"
+PASS window.getComputedStyle(document.getElementById('test7')).getPropertyValue('font-variation-settings') is "\"hght\" 999999"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: trunk/LayoutTests/fast/text/variations/getComputedStyle.html (231164 => 231165)


--- trunk/LayoutTests/fast/text/variations/getComputedStyle.html	2018-04-30 19:41:57 UTC (rev 231164)
+++ trunk/LayoutTests/fast/text/variations/getComputedStyle.html	2018-04-30 19:56:28 UTC (rev 231165)
@@ -20,14 +20,14 @@
 <div id="test6" style="font-family: 'Boxis'; font-variation-settings: 'abc한국어e' 500;">a</div>
 <div id="test7" style="font-family: 'Boxis'; font-variation-settings: 'hght' 999999;">a</div>
 <script>
-shouldBeEqualToString("window.getComputedStyle(document.getElementById('test0')).getPropertyValue('font-variation-settings')", "'hght' 400");
-shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).getPropertyValue('font-variation-settings')", "'hght' 500");
-shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings')", "'wdth' 500, 'hght' 400");
+shouldBeEqualToString("window.getComputedStyle(document.getElementById('test0')).getPropertyValue('font-variation-settings')", "\"hght\" 400");
+shouldBeEqualToString("window.getComputedStyle(document.getElementById('test1')).getPropertyValue('font-variation-settings')", "\"hght\" 500");
+shouldBeEqualToString("window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings')", "\"wdth\" 500, \"hght\" 400");
 shouldBe("window.getComputedStyle(document.getElementById('test3')).getPropertyValue('font-variation-settings')", "window.getComputedStyle(document.getElementById('test2')).getPropertyValue('font-variation-settings')");
 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test4')).getPropertyValue('font-variation-settings')", "normal");
 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test5')).getPropertyValue('font-variation-settings')", "normal");
 shouldBeEqualToString("window.getComputedStyle(document.getElementById('test6')).getPropertyValue('font-variation-settings')", "normal");
-shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).getPropertyValue('font-variation-settings')", "'hght' 999999");
+shouldBeEqualToString("window.getComputedStyle(document.getElementById('test7')).getPropertyValue('font-variation-settings')", "\"hght\" 999999");
 </script>
 <script src=""
 </body>

Modified: trunk/Source/WebCore/ChangeLog (231164 => 231165)


--- trunk/Source/WebCore/ChangeLog	2018-04-30 19:41:57 UTC (rev 231164)
+++ trunk/Source/WebCore/ChangeLog	2018-04-30 19:56:28 UTC (rev 231165)
@@ -1,3 +1,21 @@
+2018-04-30  Chris Nardi  <cna...@chromium.org>
+
+        Serialize font-variation-settings with double-quotes per spec
+        https://bugs.webkit.org/show_bug.cgi?id=182542
+
+        Reviewed by Myles C. Maxfield.
+
+        According to the CSSOM spec [1], all strings should be serialized with double-quotes.
+        The axis name in font-variation-settings was previously serialized with single-quotes;
+        change this to double-quotes to match the spec and non-WebKit browsers.
+
+        [1]: https://drafts.csswg.org/cssom/#common-serializing-idioms
+
+        Updated fast/text/variations/getComputedStyle.html to test the change.
+
+        * css/CSSFontVariationValue.cpp:
+        (WebCore::CSSFontVariationValue::customCSSText const):
+
 2018-04-30  Chris Dumez  <cdu...@apple.com>
 
         Fix bad use of RunLoop::main().dispatch() in MessagePort::dispatchMessages()

Modified: trunk/Source/WebCore/css/CSSFontVariationValue.cpp (231164 => 231165)


--- trunk/Source/WebCore/css/CSSFontVariationValue.cpp	2018-04-30 19:41:57 UTC (rev 231164)
+++ trunk/Source/WebCore/css/CSSFontVariationValue.cpp	2018-04-30 19:56:28 UTC (rev 231165)
@@ -43,10 +43,10 @@
 String CSSFontVariationValue::customCSSText() const
 {
     StringBuilder builder;
-    builder.append('\'');
+    builder.append('"');
     for (char c : m_tag)
         builder.append(c);
-    builder.appendLiteral("' ");
+    builder.appendLiteral("\" ");
     builder.appendNumber(m_value);
     return builder.toString();
 }
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to