Title: [218582] releases/WebKitGTK/webkit-2.16
Revision
218582
Author
carlo...@webkit.org
Date
2017-06-20 03:29:53 -0700 (Tue, 20 Jun 2017)

Log Message

Merge r218446 - REGRESSION(r209495): materiauxlaverdure.com fails to load
https://bugs.webkit.org/show_bug.cgi?id=173301
<rdar://problem/32624850>

Reviewed by Antti Koivisto.

LayoutTests/imported/w3c:

Rebaselined the tests that are now passing.

* web-platform-tests/cssom/CSSNamespaceRule-expected.txt:
* web-platform-tests/cssom/serialize-values-expected.txt:

Source/WebCore:

The bug was caused by WebKit wrapping CSS string values with single quotation marks instead of
double quotation marks as spec'ed in https://drafts.csswg.org/cssom/#serialize-a-string and
implemented in Firefox and Chrome.

The website eval's the computed value of the `content` CSS property with the value `'{name: "flat"}'`
after stripping single quotation marks from both ends. Prior to r209495, WebKit serialized this CSS value
in single quotations without escaping double quotations. After r209495, double quotations are escaped
with backslashes as `'{name: \"flat\"}'`. As a result, `eval` is invoked with `{name: \"flat\"}`
after stripping single quotations from both ends, which resulted in an exception.

Chrome and Firefox don't encounter this exception despite of the fact they escape double quotations
as well because serialize with double quotations as `"{name: \"flat\"}"`. Because there is no code
to strip double quotations, eval is invoked with the same string, resulting in the entire value as
being parsed as string, instead of an object with a single key "name" with the value of "flat" as
was the case in WebKit prior to r209495. While this behavior was most certainly not the intent of
the website author, Chrome and Firefox don't encounter an exception and the website continues to work.

This patch aligns WebKit's behavior to that of the CSS OM specification, Firefox, and Chrome by
serializing CSS string values using double quotation marks instead of single quotation marks.

Note: inline change log comments are added below for every call site of serializeString for clarity.

Test: fast/css/getPropertyValue-serialization-with-double-quotes.html

* css/CSSBasicShapes.cpp:
(WebCore::buildPathString): Use double quotation marks in path(~) of shapes.
* css/CSSMarkup.cpp:
(WebCore::serializeString):
(WebCore::serializeURL): Use double quotation marks to serialize URLs.
(WebCore::serializeAsStringOrCustomIdent): Use double quotation marks to serialize strings. We still avoid
using wrapping the value with double quotations when the value can be an identifier. See r209495.
(WebCore::serializeFontFamily): Ditto for font-family names such as "San Francisco".
* css/CSSMarkup.h:
* css/CSSNamespaceRule.cpp:
(WebCore::CSSNamespaceRule::cssText): Use double quotation marks to serialize namespace URIs.
* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use double quotation marks to serialize
the separators; e.g. counter(sectionNumber, ".") to produce "1.".
* css/CSSSelector.cpp:
(WebCore::CSSSelector::selectorText): Use double quotation marks to serialize attribute values.
* css/parser/CSSParserToken.cpp:
(WebCore::CSSParserToken::serialize): Use double quotation marks to serialize strings in @support.
* editing/EditingStyle.cpp:
(WebCore::StyleChange::extractTextStyles): Updated to strip double quotation marks in font family names to
maintain the compatibility with old versions of Microsoft Outlook.
* html/HTMLElement.cpp:
(WebCore::HTMLElement::mapLanguageAttributeToLocale): Use double quotations marks to serialize the value
of the lang content attribute. It doesn't matter which one is used here because it's only a temporary value
only fed into the CSS parser to set the equivalent CSS value from the content attribute.

LayoutTests:

Rebaselined the existing tests and added a new regression test for serializing CSS properties and values.

* accessibility/mac/alt-for-css-content-expected.txt:
* accessibility/mac/webkit-alt-for-css-content-expected.txt:
* editing/pasteboard/cjk-line-height-expected.txt:
* fast/css/alt-inherit-initial-expected.txt:
* fast/css/alt-inherit-initial.html:
* fast/css/content-language-comma-separated-list-expected.txt:
* fast/css/content-language-empty-expected.txt:
* fast/css/content-language-only-whitespace-expected.txt:
* fast/css/content-language-with-whitespace-expected.txt:
* fast/css/counters/counter-cssText-expected.txt:
* fast/css/counters/counter-cssText.html:
* fast/css/font-family-trailing-bracket-gunk-expected.txt:
* fast/css/font-family-trailing-bracket-gunk.html:
* fast/css/getComputedStyle/computed-style-font-family-expected.txt:
* fast/css/getComputedStyle/computed-style-properties-expected.txt:
* fast/css/getComputedStyle/computed-style-properties.html:
* fast/css/getComputedStyle/font-family-fallback-reset-expected.txt:
* fast/css/getComputedStyle/font-family-fallback-reset.html:
* fast/css/lang-mapped-to-webkit-locale-expected.txt:
* fast/css/lang-mapped-to-webkit-locale.xhtml:
* fast/css/serialization-with-double-quotes-expected.txt: Added.
* fast/css/serialization-with-double-quotes.html: Added.
* fast/css/uri-token-parsing-expected.txt:
* fast/css/uri-token-parsing.html:
* fast/inspector-support/cssURLQuotes-expected.txt:
* fast/inspector-support/style-expected.txt:
* fast/text/font-stretch-parse-expected.txt:
* fast/text/font-stretch-parse.html:
* fast/text/font-style-parse-expected.txt:
* fast/text/font-style-parse.html:
* fast/text/font-weight-parse-expected.txt:
* fast/text/font-weight-parse.html:
* media/controls/track-menu.html:
* platform/mac-elcapitan/fast/css/getComputedStyle/computed-style-font-family-expected.txt:
* platform/mac-elcapitan/fast/text/font-stretch-parse-expected.txt:
* platform/mac-elcapitan/fast/text/font-style-parse-expected.txt:
* platform/mac-elcapitan/fast/text/font-weight-parse-expected.txt:

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/ChangeLog	2017-06-20 10:29:53 UTC (rev 218582)
@@ -1,3 +1,51 @@
+2017-06-17  Ryosuke Niwa  <rn...@webkit.org>
+
+        REGRESSION(r209495): materiauxlaverdure.com fails to load
+        https://bugs.webkit.org/show_bug.cgi?id=173301
+        <rdar://problem/32624850>
+
+        Reviewed by Antti Koivisto.
+
+        Rebaselined the existing tests and added a new regression test for serializing CSS properties and values.
+
+        * accessibility/mac/alt-for-css-content-expected.txt:
+        * accessibility/mac/webkit-alt-for-css-content-expected.txt:
+        * editing/pasteboard/cjk-line-height-expected.txt:
+        * fast/css/alt-inherit-initial-expected.txt:
+        * fast/css/alt-inherit-initial.html:
+        * fast/css/content-language-comma-separated-list-expected.txt:
+        * fast/css/content-language-empty-expected.txt:
+        * fast/css/content-language-only-whitespace-expected.txt:
+        * fast/css/content-language-with-whitespace-expected.txt:
+        * fast/css/counters/counter-cssText-expected.txt:
+        * fast/css/counters/counter-cssText.html:
+        * fast/css/font-family-trailing-bracket-gunk-expected.txt:
+        * fast/css/font-family-trailing-bracket-gunk.html:
+        * fast/css/getComputedStyle/computed-style-font-family-expected.txt:
+        * fast/css/getComputedStyle/computed-style-properties-expected.txt:
+        * fast/css/getComputedStyle/computed-style-properties.html:
+        * fast/css/getComputedStyle/font-family-fallback-reset-expected.txt:
+        * fast/css/getComputedStyle/font-family-fallback-reset.html:
+        * fast/css/lang-mapped-to-webkit-locale-expected.txt:
+        * fast/css/lang-mapped-to-webkit-locale.xhtml:
+        * fast/css/serialization-with-double-quotes-expected.txt: Added.
+        * fast/css/serialization-with-double-quotes.html: Added.
+        * fast/css/uri-token-parsing-expected.txt:
+        * fast/css/uri-token-parsing.html:
+        * fast/inspector-support/cssURLQuotes-expected.txt:
+        * fast/inspector-support/style-expected.txt:
+        * fast/text/font-stretch-parse-expected.txt:
+        * fast/text/font-stretch-parse.html:
+        * fast/text/font-style-parse-expected.txt:
+        * fast/text/font-style-parse.html:
+        * fast/text/font-weight-parse-expected.txt:
+        * fast/text/font-weight-parse.html:
+        * media/controls/track-menu.html:
+        * platform/mac-elcapitan/fast/css/getComputedStyle/computed-style-font-family-expected.txt:
+        * platform/mac-elcapitan/fast/text/font-stretch-parse-expected.txt:
+        * platform/mac-elcapitan/fast/text/font-style-parse-expected.txt:
+        * platform/mac-elcapitan/fast/text/font-weight-parse-expected.txt:
+
 2017-06-09  Brady Eidson  <beid...@apple.com>
 
         Crash when IndexedDB's getAll is used inside a Web Worker.

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/accessibility/mac/alt-for-css-content-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/accessibility/mac/alt-for-css-content-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/accessibility/mac/alt-for-css-content-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -39,7 +39,7 @@
 AXTitle: 
 AXValue: ALTERNATIVE CONTENT TEST6
 
-alt accessed through _javascript_: 'ALTERNATIVE CONTENT TEST2'
+alt accessed through _javascript_: "ALTERNATIVE CONTENT TEST2"
 Test7 - alt does not apply to DOM nodes.
 AXRole: AXImage
 AXDescription: This is the right text

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/accessibility/mac/webkit-alt-for-css-content-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/accessibility/mac/webkit-alt-for-css-content-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/accessibility/mac/webkit-alt-for-css-content-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -39,7 +39,7 @@
 AXTitle: 
 AXValue: ALTERNATIVE CONTENT TEST6
 
-WebKitAlt accessed through _javascript_: 'ALTERNATIVE CONTENT TEST2'
+WebKitAlt accessed through _javascript_: "ALTERNATIVE CONTENT TEST2"
 Test7 - webkit-alt does not apply to DOM nodes.
 AXRole: AXImage
 AXDescription: This is the right text

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/editing/pasteboard/cjk-line-height-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/editing/pasteboard/cjk-line-height-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/editing/pasteboard/cjk-line-height-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -1,6 +1,6 @@
 This tests copying and pasting text with a font that influences the used line-height value.
 To manually test, copy and paste the selected content below. WebKit should not generate line-height property in the pasted content.
 | <span>
-|   style="font-family: 'Hiragino Kaku Gothic ProN';"
+|   style="font-family: "Hiragino Kaku Gothic ProN";"
 |   "hello<#selection-caret>"
 | <br>

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/alt-inherit-initial-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/alt-inherit-initial-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/alt-inherit-initial-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -11,7 +11,7 @@
 PASS window.getComputedStyle(testDiv).getPropertyValue('alt') is "TestAlt"
 testDiv.style['alt'] = 'initial'
 PASS testDiv.style['alt'] is "initial"
-PASS window.getComputedStyle(testDiv).getPropertyValue('alt') is "''"
+PASS window.getComputedStyle(testDiv).getPropertyValue('alt') is "\"\""
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/alt-inherit-initial.html (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/alt-inherit-initial.html	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/alt-inherit-initial.html	2017-06-20 10:29:53 UTC (rev 218582)
@@ -30,7 +30,7 @@
 // Initial.
 evalAndLog("testDiv.style['alt'] = 'initial'");
 shouldBeEqualToString("testDiv.style['alt']", "initial");
-shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('alt')", "''");
+shouldBeEqualToString("window.getComputedStyle(testDiv).getPropertyValue('alt')", `""`);
 
 </script>
 <script src=""

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-comma-separated-list-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-comma-separated-list-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-comma-separated-list-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -1,6 +1,6 @@
 Test for bug 76701: map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that a comma-separated list of languages is ignored. This expectation may change, see bug. The HTML5 spec says that content-language should not have multiple languages, and decrees that a content-language containing a comma be ignored; this position has been upheld following significant debate. Firefox accepts a comma-separated list and a CSS :lang selector for any language in the list is matched. It's unclear what IE does.
 
-FAIL languageOfNode('x') should be auto. Was 'ja, zh_CN'.
+FAIL languageOfNode('x') should be auto. Was "ja, zh_CN".
 PASS languageOfNode('y') is "ar"
 PASS successfullyParsed is true
 

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-empty-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-empty-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-empty-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -1,6 +1,6 @@
 Test for bug 76701: map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that a content-language of empty string is ignored. This expectation may change, see bug. HTML5 decrees that the meta element be ignored in case of the empty string. It's unclear what other browsers do.
 
-FAIL languageOfNode('x') should be auto. Was ''.
+FAIL languageOfNode('x') should be auto. Was "".
 PASS languageOfNode('y') is "ar"
 PASS successfullyParsed is true
 

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-only-whitespace-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-only-whitespace-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-only-whitespace-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -1,6 +1,6 @@
 Test for bug 76701: map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that a content-language with whitespace-only content is ignored. This expectation may change, see bug. HTML5 decrees that the meta element be ignored in case of whitespace only content. It's unclear what other browsers do.
 
-FAIL languageOfNode('x') should be auto. Was '  \9 \a  '.
+FAIL languageOfNode('x') should be auto. Was "  \9 \a  ".
 PASS languageOfNode('y') is "ar"
 PASS successfullyParsed is true
 

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-with-whitespace-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-with-whitespace-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/content-language-with-whitespace-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -1,6 +1,6 @@
 Test for bug 76701: map HTTP-EQUIV content-language to -webkit-locale. This particular test tests that the the pragma-set default language is set to the first sequence of non-whitespace characters of the content-language content. This expectation may change, see bug. This expectation is as per the HTML 5 spec. It appears that Firefox does not exactly do this, but trims the leading and trailing whitespace. It's unclear what IE does.
 
-FAIL languageOfNode('x') should be ja_JP. Was '  \a \9 \9 ja-JP   \9  zh_CN \9 \a \a \9 \9 '.
+FAIL languageOfNode('x') should be ja_JP. Was "  \a \9 \9 ja-JP   \9  zh_CN \9 \a \a \9 \9 ".
 PASS languageOfNode('y') is "ar"
 PASS successfullyParsed is true
 

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/counters/counter-cssText-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/counters/counter-cssText-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/counters/counter-cssText-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -4,9 +4,9 @@
 
 
 PASS rules[2].style.cssText is "content: counter(section, decimal);"
-PASS rules[3].style.cssText is "content: counters(section, ':', decimal);"
+PASS rules[3].style.cssText is "content: counters(section, \":\", decimal);"
 PASS rules[4].style.cssText is "content: counter(section, lower-roman);"
-PASS rules[5].style.cssText is "content: counters(section, ',', upper-roman);"
+PASS rules[5].style.cssText is "content: counters(section, \",\", upper-roman);"
 PASS rules[6].style.cssText is "content: counter(section, none);"
 PASS successfullyParsed is true
 

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/counters/counter-cssText.html (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/counters/counter-cssText.html	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/counters/counter-cssText.html	2017-06-20 10:29:53 UTC (rev 218582)
@@ -29,11 +29,11 @@
 <script>
 description("Test the cssText output of counter-valued CSSPrimitiveValues");
 var rules = document.styleSheets[0].cssRules;
-shouldBeEqualToString("rules[2].style.cssText", "content: counter(section, decimal);");
-shouldBeEqualToString("rules[3].style.cssText", "content: counters(section, ':', decimal);");
-shouldBeEqualToString("rules[4].style.cssText", "content: counter(section, lower-roman);");
-shouldBeEqualToString("rules[5].style.cssText", "content: counters(section, ',', upper-roman);");
-shouldBeEqualToString("rules[6].style.cssText", "content: counter(section, none);");
+shouldBeEqualToString("rules[2].style.cssText", `content: counter(section, decimal);`);
+shouldBeEqualToString("rules[3].style.cssText", `content: counters(section, ":", decimal);`);
+shouldBeEqualToString("rules[4].style.cssText", `content: counter(section, lower-roman);`);
+shouldBeEqualToString("rules[5].style.cssText", `content: counters(section, ",", upper-roman);`);
+shouldBeEqualToString("rules[6].style.cssText", `content: counter(section, none);`);
 </script>
 <script src=""
 </body>

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/font-family-trailing-bracket-gunk-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/font-family-trailing-bracket-gunk-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/font-family-trailing-bracket-gunk-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -3,8 +3,8 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS spanElement.innerHTML is 'foo'
-PASS computedStyle.getPropertyValue('font-family') is "'Arial [ding dong]', 'Helvetica [Xft]', Courier"
+PASS spanElement.innerHTML is "foo"
+PASS computedStyle.getPropertyValue('font-family') is "\"Arial [ding dong]\", \"Helvetica [Xft]\", Courier"
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/font-family-trailing-bracket-gunk.html (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/font-family-trailing-bracket-gunk.html	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/font-family-trailing-bracket-gunk.html	2017-06-20 10:29:53 UTC (rev 218582)
@@ -13,8 +13,8 @@
 var spanElement = document.getElementById('testspan');
 
 var computedStyle = window.getComputedStyle(spanElement);
-shouldBe("spanElement.innerHTML", "'foo'");
-shouldBe("computedStyle.getPropertyValue('font-family')", "\"'Arial [ding dong]', 'Helvetica [Xft]', Courier\"");
+shouldBeEqualToString("spanElement.innerHTML", "foo");
+shouldBeEqualToString("computedStyle.getPropertyValue('font-family')", `"Arial [ding dong]", "Helvetica [Xft]", Courier`);
 
 document.body.removeChild(spanElement);
 

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-font-family-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-font-family-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-font-family-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -1,6 +1,6 @@
 Font attributes. The font-family should list three families:
 
-font-family: monospace, 'Lucida Grande', sans-serif;
+font-family: monospace, "Lucida Grande", sans-serif;
 font-size: 16px;
 font-style: normal;
 font-synthesis: style weight small-caps;

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-properties-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-properties-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-properties-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -10,14 +10,14 @@
 Heading B
 
 PASS computedStyleFor('outline', null, 'outline-offset') is '5px'
-PASS computedStyleFor('content', 'before', 'content') is 'text'
-PASS computedStyleFor('content', 'after', 'content') is "'test ' url(data:image/gif;base64,R0lGODlhAQABAJAAAP8AAAAAACwAAAAAAQABAAACAgQBADs=)"
-PASS computedStyleFor('counter', null, 'counter-reset') is 'section 0'
+PASS computedStyleFor('content', 'before', 'content') is "text"
+PASS computedStyleFor('content', 'after', 'content') is "\"test \" url(data:image/gif;base64,R0lGODlhAQABAJAAAP8AAAAAACwAAAAAAQABAAACAgQBADs=)"
+PASS computedStyleFor('counter', null, 'counter-reset') is "section 0"
 PASS str.indexOf('subsection 0') != -1 is true
 PASS str.indexOf('anothercounter 5') != -1 is true
-PASS computedStyleFor('counter1', 'before', 'counter-increment') is 'section 1'
-PASS computedStyleFor('subcounter2', 'before', 'counter-increment') is 'subsection 1'
-PASS computedStyleFor('subcounter2', 'before', 'content') is "counter(section) '.' counter(subsection) '. '"
+PASS computedStyleFor('counter1', 'before', 'counter-increment') is "section 1"
+PASS computedStyleFor('subcounter2', 'before', 'counter-increment') is "subsection 1"
+PASS computedStyleFor('subcounter2', 'before', 'content') is "counter(section) \".\" counter(subsection) \". \""
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-properties.html (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-properties.html	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/computed-style-properties.html	2017-06-20 10:29:53 UTC (rev 218582)
@@ -65,15 +65,15 @@
 
 shouldBe("computedStyleFor('outline', null, 'outline-offset')", "'5px'");
 
-shouldBe("computedStyleFor('content', 'before', 'content')", "'text'");
-shouldBe("computedStyleFor('content', 'after', 'content')", '"\'test \' url(data:image/gif;base64,R0lGODlhAQABAJAAAP8AAAAAACwAAAAAAQABAAACAgQBADs=)"');
-shouldBe("computedStyleFor('counter', null, 'counter-reset')", "'section 0'");
+shouldBeEqualToString("computedStyleFor('content', 'before', 'content')", "text");
+shouldBeEqualToString("computedStyleFor('content', 'after', 'content')", `"test " url(data:image/gif;base64,R0lGODlhAQABAJAAAP8AAAAAACwAAAAAAQABAAACAgQBADs=)`);
+shouldBeEqualToString("computedStyleFor('counter', null, 'counter-reset')", "section 0");
 var str = computedStyleFor('subcounter', null, 'counter-reset');
 shouldBe("str.indexOf('subsection 0') != -1", "true");
 shouldBe("str.indexOf('anothercounter 5') != -1", "true");
-shouldBe("computedStyleFor('counter1', 'before', 'counter-increment')", "'section 1'");
-shouldBe("computedStyleFor('subcounter2', 'before', 'counter-increment')", "'subsection 1'");
-shouldBe("computedStyleFor('subcounter2', 'before', 'content')", '"counter(section) \'.\' counter(subsection) \'. \'"');
+shouldBeEqualToString("computedStyleFor('counter1', 'before', 'counter-increment')", "section 1");
+shouldBeEqualToString("computedStyleFor('subcounter2', 'before', 'counter-increment')", "subsection 1");
+shouldBeEqualToString("computedStyleFor('subcounter2', 'before', 'content')", `counter(section) "." counter(subsection) ". "`);
 </script>
 <script src=""
 </html>

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/font-family-fallback-reset-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/font-family-fallback-reset-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/font-family-fallback-reset-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -3,7 +3,7 @@
 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
 
 
-PASS window.getComputedStyle(outerDiv, null).fontFamily is "'courier new', cursive"
+PASS window.getComputedStyle(outerDiv, null).fontFamily is "\"courier new\", cursive"
 PASS window.getComputedStyle(timesDiv, null).fontFamily is "foo"
 PASS window.getComputedStyle(cursiveDiv, null).fontFamily is "cursive"
 PASS successfullyParsed is true

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/script-tests/font-family-fallback-reset.js (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/script-tests/font-family-fallback-reset.js	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/getComputedStyle/script-tests/font-family-fallback-reset.js	2017-06-20 10:29:53 UTC (rev 218582)
@@ -10,7 +10,7 @@
 '<div id="cursiveDiv" style="font-family: cursive;">should be cursive</div>' +
 '</div>';
 
-shouldBeEqualToString("window.getComputedStyle(outerDiv, null).fontFamily", "'courier new', cursive");
+shouldBeEqualToString("window.getComputedStyle(outerDiv, null).fontFamily", `"courier new", cursive`);
 shouldBeEqualToString("window.getComputedStyle(timesDiv, null).fontFamily", "foo");
 shouldBeEqualToString("window.getComputedStyle(cursiveDiv, null).fontFamily", "cursive");
 

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/lang-mapped-to-webkit-locale-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/lang-mapped-to-webkit-locale-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/lang-mapped-to-webkit-locale-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -19,10 +19,10 @@
 PASS languageOfNode('q3') is "auto"
 PASS languageOfNode('q4') is "ar"
 PASS languageOfNode('q5') is "auto"
-PASS languageOfNode('q6') is "'  '"
+PASS languageOfNode('q6') is "\"  \""
 PASS languageOfNode('q7') is "auto"
 PASS languageOfNode('q8') is "xyzzy"
-PASS languageOfNode('q9') is "'][;][['"
+PASS languageOfNode('q9') is "\"][;][[\""
 PASS successfullyParsed is true
 
 TEST COMPLETE

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/lang-mapped-to-webkit-locale.xhtml (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/lang-mapped-to-webkit-locale.xhtml	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/lang-mapped-to-webkit-locale.xhtml	2017-06-20 10:29:53 UTC (rev 218582)
@@ -46,10 +46,10 @@
 shouldBeEqualToString("languageOfNode('q3')", "auto");
 shouldBeEqualToString("languageOfNode('q4')", "ar");
 shouldBeEqualToString("languageOfNode('q5')", "auto");
-shouldBeEqualToString("languageOfNode('q6')", "'  '");
+shouldBeEqualToString("languageOfNode('q6')", `"  "`);
 shouldBeEqualToString("languageOfNode('q7')", "auto");
 shouldBeEqualToString("languageOfNode('q8')", "xyzzy");
-shouldBeEqualToString("languageOfNode('q9')", "'][;][['");
+shouldBeEqualToString("languageOfNode('q9')", `"][;][["`);
 
 var successfullyParsed = true;
 </script>

Added: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/serialization-with-double-quotes-expected.txt (0 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/serialization-with-double-quotes-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/serialization-with-double-quotes-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -0,0 +1,23 @@
+Tests serializing various strings with quotation marks.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS namespaceRule.cssText is "@namespace html url(\"http://www.w3.org/1999/xhtml\");"
+PASS supportsRule.conditionText is "(font-weight: \"San Francisco\")"
+PASS ruleWithJSONContent.style.content is "\"{foo: \\\"bar\\\"}\""
+PASS value = getComputedStyle(div).getPropertyValue("content"); value is "\"{foo: \\\"bar\\\"}\""
+PASS parsed = eval(value.replace(/^'/, "").replace(/'$/, "")); is "{foo: \"bar\"}"
+PASS ruleWithAttributeSelector.selectorText is "span[class=\"foo bar\"]"
+PASS getComputedStyle(document.querySelector("span[class='foo bar']")).getPropertyValue("color") is "rgb(0, 128, 0)"
+PASS counterRule.style.content is "counters(section, \".\", decimal)"
+PASS fontFamilyRule.style.fontFamily is "\"Two Infinite Loop\", \"Cupertino CA\""
+PASS getComputedStyle(document.querySelector("article")).getPropertyValue("font-family") is "\"Two Infinite Loop\", \"Cupertino CA\""
+PASS backgroundImageRule.style.backgroundImage is "url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100px' height='100px'><rect width='100px' height='100px' fill='lightgreen' stroke='green' stroke-width='1px'/></svg>\")"
+PASS getComputedStyle(document.querySelector("section")).backgroundImage is "url(\"data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100px' height='100px'><rect width='100px' height='100px' fill='lightgreen' stroke='green' stroke-width='1px'/></svg>\")"
+PASS shapeRule.style["-webkit-clip-path"] is "path(\"M 100 40 l 20 0 l 0 60\")"
+PASS getComputedStyle(document.querySelector(".shape"))["-webkit-clip-path"] is "path(\"M 100 40 l 20 0 l 0 60\")"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/serialization-with-double-quotes.html (0 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/serialization-with-double-quotes.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/serialization-with-double-quotes.html	2017-06-20 10:29:53 UTC (rev 218582)
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@namespace html url(http://www.w3.org/1999/xhtml);
+@supports (font-weight: 'San Francisco') { }
+div { content: '{foo: "bar"}'; }
+span[class="foo bar"] { color: green; }
+.counter { content: counters(section, "."); }
+article { font-family: 'Two Infinite Loop', 'Cupertino CA';}
+section { background-image: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='100px' height='100px'><rect width='100px' height='100px' fill='lightgreen' stroke='green' stroke-width='1px'/></svg>"); }
+.shape { -webkit-clip-path: path('M100,40l20,0 0,60'); }
+</style>
+</head>
+<body>
+<div></div><span class="foo bar"></span><article></article><section></section><div class="shape"></div>
+<script src=""
+<script>
+
+description('Tests serializing various strings with quotation marks.');
+
+var styleSheet = document.querySelector('style').sheet;
+
+var namespaceRule = styleSheet.rules[0];
+shouldBeEqualToString('namespaceRule.cssText', '@namespace html url("http://www.w3.org/1999/xhtml");');
+
+var supportsRule = styleSheet.rules[1];
+shouldBeEqualToString('supportsRule.conditionText', '(font-weight: "San Francisco")');
+
+var ruleWithJSONContent = styleSheet.rules[2];
+shouldBeEqualToString('ruleWithJSONContent.style.content', '"{foo: \\"bar\\"}"');
+
+var div = document.querySelector('div');
+shouldBeEqualToString('value = getComputedStyle(div).getPropertyValue("content"); value', '"{foo: \\"bar\\"}"');
+shouldBeEqualToString(`parsed = eval(value.replace(/^\'/, "").replace(/\'$/, ""));`, '{foo: "bar"}');
+
+var ruleWithAttributeSelector = styleSheet.rules[3];
+shouldBeEqualToString('ruleWithAttributeSelector.selectorText', 'span[class=\"foo bar\"]');
+shouldBeEqualToString(`getComputedStyle(document.querySelector("span[class='foo bar']")).getPropertyValue("color")`, 'rgb(0, 128, 0)');
+
+var counterRule = styleSheet.rules[4];
+shouldBeEqualToString('counterRule.style.content', 'counters(section, ".", decimal)');
+
+var fontFamilyRule = styleSheet.rules[5];
+shouldBeEqualToString('fontFamilyRule.style.fontFamily', '"Two Infinite Loop", "Cupertino CA"');
+shouldBeEqualToString('getComputedStyle(document.querySelector("article")).getPropertyValue("font-family")',
+    '"Two Infinite Loop", "Cupertino CA"');
+
+var backgroundImageRule = styleSheet.rules[6];
+var url = "" xmlns='http://www.w3.org/2000/svg' width='100px' height='100px'><rect width='100px' height='100px' fill='lightgreen' stroke='green' stroke-width='1px'/></svg>")`;
+shouldBeEqualToString('backgroundImageRule.style.backgroundImage', url);
+shouldBeEqualToString('getComputedStyle(document.querySelector("section")).backgroundImage', url);
+
+var shapeRule = styleSheet.rules[7];
+var path = `path("M 100 40 l 20 0 l 0 60")`;
+shouldBeEqualToString('shapeRule.style["-webkit-clip-path"]', path);
+shouldBeEqualToString('getComputedStyle(document.querySelector(".shape"))["-webkit-clip-path"]', path);
+
+</script>
+</body>
+</html>

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/uri-token-parsing-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/uri-token-parsing-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/uri-token-parsing-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -12,18 +12,18 @@
 #g { content: url(d); }
 #h { content: url(e); }
 #i { content: url(f); }
-#j { content: url('url(g)'); }
+#j { content: url("url(g)"); }
 #l { content: url(c); }
 #m { content: url(d); }
 #n { content: url(e); }
 #o { content: url(f); }
-#p { content: url('url(g)'); }
-#q { cursor: url('url(q)'), default; }
-#r { list-style-image: url('url(r)'); }
-#s { background-image: url('url(s)'); }
-#t { -webkit-mask-image: url('url(t)'); }
-#u { -webkit-border-image: url('url(u)') 1 2 3 4 fill stretch round; }
-#v { -webkit-mask-box-image: url('url(v)') 1 2 3 4 fill stretch round; }
+#p { content: url("url(g)"); }
+#q { cursor: url("url(q)"), default; }
+#r { list-style-image: url("url(r)"); }
+#s { background-image: url("url(s)"); }
+#t { -webkit-mask-image: url("url(t)"); }
+#u { -webkit-border-image: url("url(u)") 1 2 3 4 fill stretch round; }
+#v { -webkit-mask-box-image: url("url(v)") 1 2 3 4 fill stretch round; }
 #w { content: url(ww); }
 #x { content: url(x%20xx); }
 #y { content: url(y%20yy); }
@@ -37,18 +37,18 @@
 #g { content: url(d); }
 #h { content: url(e); }
 #i { content: url(f); }
-#j { content: url('url(g)'); }
+#j { content: url("url(g)"); }
 #l { content: url(c); }
 #m { content: url(d); }
 #n { content: url(e); }
 #o { content: url(f); }
-#p { content: url('url(g)'); }
-#q { cursor: url('url(q)'), default; }
-#r { list-style-image: url('url(r)'); }
-#s { background-image: url('url(s)'); }
-#t { -webkit-mask-image: url('url(t)'); }
-#u { -webkit-border-image: url('url(u)') 1 2 3 4 fill stretch round; }
-#v { -webkit-mask-box-image: url('url(v)') 1 2 3 4 fill stretch round; }
+#p { content: url("url(g)"); }
+#q { cursor: url("url(q)"), default; }
+#r { list-style-image: url("url(r)"); }
+#s { background-image: url("url(s)"); }
+#t { -webkit-mask-image: url("url(t)"); }
+#u { -webkit-border-image: url("url(u)") 1 2 3 4 fill stretch round; }
+#v { -webkit-mask-box-image: url("url(v)") 1 2 3 4 fill stretch round; }
 #w { content: url(ww); }
 #x { content: url(x%20xx); }
 #y { content: url(y%20yy); }

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/uri-token-parsing.html (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/uri-token-parsing.html	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/css/uri-token-parsing.html	2017-06-20 10:29:53 UTC (rev 218582)
@@ -86,18 +86,18 @@
 #g { content: url(d); }
 #h { content: url(e); }
 #i { content: url(f); }
-#j { content: url('url(g)'); }
+#j { content: url("url(g)"); }
 #l { content: url(c); }
 #m { content: url(d); }
 #n { content: url(e); }
 #o { content: url(f); }
-#p { content: url('url(g)'); }
-#q { cursor: url('url(q)'), default; }
-#r { list-style-image: url('url(r)'); }
-#s { background-image: url('url(s)'); }
-#t { -webkit-mask-image: url('url(t)'); }
-#u { -webkit-border-image: url('url(u)') 1 2 3 4 fill stretch round; }
-#v { -webkit-mask-box-image: url('url(v)') 1 2 3 4 fill stretch round; }
+#p { content: url("url(g)"); }
+#q { cursor: url("url(q)"), default; }
+#r { list-style-image: url("url(r)"); }
+#s { background-image: url("url(s)"); }
+#t { -webkit-mask-image: url("url(t)"); }
+#u { -webkit-border-image: url("url(u)") 1 2 3 4 fill stretch round; }
+#v { -webkit-mask-box-image: url("url(v)") 1 2 3 4 fill stretch round; }
 #w { content: url(ww); }
 #x { content: url(x%20xx); }
 #y { content: url(y%20yy); }

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/inspector-support/cssURLQuotes-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/inspector-support/cssURLQuotes-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/inspector-support/cssURLQuotes-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -1,4 +1,4 @@
 ALERT: url(file:///unquoted) (URL should not be quoted)
 ALERT: url(file:///noQuotesNeeded) (URL should not be quoted)
-ALERT: url('file:///should(Quote)') (URL should be quoted)
+ALERT: url("file:///should(Quote)") (URL should be quoted)
 

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/fast/inspector-support/style-expected.txt (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/fast/inspector-support/style-expected.txt	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/fast/inspector-support/style-expected.txt	2017-06-20 10:29:53 UTC (rev 218582)
@@ -20,5 +20,5 @@
 font-weight: normal (original property was font and property was implicitly set.)
 font-size: 24px (original property was font)
 line-height: normal (original property was font and property was implicitly set.)
-font-family: 'Lucida Grande' (original property was font)
+font-family: "Lucida Grande" (original property was font)
 

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/imported/w3c/ChangeLog (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/imported/w3c/ChangeLog	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/imported/w3c/ChangeLog	2017-06-20 10:29:53 UTC (rev 218582)
@@ -1,3 +1,16 @@
+2017-06-17  Ryosuke Niwa  <rn...@webkit.org>
+
+        REGRESSION(r209495): materiauxlaverdure.com fails to load
+        https://bugs.webkit.org/show_bug.cgi?id=173301
+        <rdar://problem/32624850>
+
+        Reviewed by Antti Koivisto.
+
+        Rebaselined the tests that are now passing.
+
+        * web-platform-tests/cssom/CSSNamespaceRule-expected.txt:
+        * web-platform-tests/cssom/serialize-values-expected.txt:
+
 2017-05-18  Daniel Bates  <daba...@apple.com>
 
         Improve error message for Access-Control-Allow-Origin violation due to misconfigured server

Modified: releases/WebKitGTK/webkit-2.16/LayoutTests/media/controls/track-menu.html (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/LayoutTests/media/controls/track-menu.html	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/LayoutTests/media/controls/track-menu.html	2017-06-20 10:29:53 UTC (rev 218582)
@@ -77,7 +77,7 @@
 
                 tester.test("First menu item checkmark image is visible")
                     .value(getComputedStyle(checkImage).content)
-                    .contains("url('data:image/svg+xml,<svg xmlns=");
+                    .contains('url("data:image/svg+xml,<svg xmlns=');
 
                 var menuItem = menuList.children[1];
                 tester.test("Second menu item is not selected")

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog	2017-06-20 10:29:53 UTC (rev 218582)
@@ -1,3 +1,61 @@
+2017-06-17  Ryosuke Niwa  <rn...@webkit.org>
+
+        REGRESSION(r209495): materiauxlaverdure.com fails to load
+        https://bugs.webkit.org/show_bug.cgi?id=173301
+        <rdar://problem/32624850>
+
+        Reviewed by Antti Koivisto.
+
+        The bug was caused by WebKit wrapping CSS string values with single quotation marks instead of
+        double quotation marks as spec'ed in https://drafts.csswg.org/cssom/#serialize-a-string and
+        implemented in Firefox and Chrome.
+
+        The website eval's the computed value of the `content` CSS property with the value `'{name: "flat"}'`
+        after stripping single quotation marks from both ends. Prior to r209495, WebKit serialized this CSS value
+        in single quotations without escaping double quotations. After r209495, double quotations are escaped
+        with backslashes as `'{name: \"flat\"}'`. As a result, `eval` is invoked with `{name: \"flat\"}`
+        after stripping single quotations from both ends, which resulted in an exception.
+
+        Chrome and Firefox don't encounter this exception despite of the fact they escape double quotations
+        as well because serialize with double quotations as `"{name: \"flat\"}"`. Because there is no code
+        to strip double quotations, eval is invoked with the same string, resulting in the entire value as
+        being parsed as string, instead of an object with a single key "name" with the value of "flat" as
+        was the case in WebKit prior to r209495. While this behavior was most certainly not the intent of
+        the website author, Chrome and Firefox don't encounter an exception and the website continues to work.
+
+        This patch aligns WebKit's behavior to that of the CSS OM specification, Firefox, and Chrome by
+        serializing CSS string values using double quotation marks instead of single quotation marks.
+
+        Note: inline change log comments are added below for every call site of serializeString for clarity.
+
+        Test: fast/css/getPropertyValue-serialization-with-double-quotes.html
+
+        * css/CSSBasicShapes.cpp:
+        (WebCore::buildPathString): Use double quotation marks in path(~) of shapes.
+        * css/CSSMarkup.cpp:
+        (WebCore::serializeString):
+        (WebCore::serializeURL): Use double quotation marks to serialize URLs.
+        (WebCore::serializeAsStringOrCustomIdent): Use double quotation marks to serialize strings. We still avoid
+        using wrapping the value with double quotations when the value can be an identifier. See r209495.
+        (WebCore::serializeFontFamily): Ditto for font-family names such as "San Francisco".
+        * css/CSSMarkup.h:
+        * css/CSSNamespaceRule.cpp:
+        (WebCore::CSSNamespaceRule::cssText): Use double quotation marks to serialize namespace URIs.
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText): Use double quotation marks to serialize
+        the separators; e.g. counter(sectionNumber, ".") to produce "1.".
+        * css/CSSSelector.cpp:
+        (WebCore::CSSSelector::selectorText): Use double quotation marks to serialize attribute values.
+        * css/parser/CSSParserToken.cpp:
+        (WebCore::CSSParserToken::serialize): Use double quotation marks to serialize strings in @support.
+        * editing/EditingStyle.cpp:
+        (WebCore::StyleChange::extractTextStyles): Updated to strip double quotation marks in font family names to
+        maintain the compatibility with old versions of Microsoft Outlook.
+        * html/HTMLElement.cpp:
+        (WebCore::HTMLElement::mapLanguageAttributeToLocale): Use double quotations marks to serialize the value
+        of the lang content attribute. It doesn't matter which one is used here because it's only a temporary value
+        only fed into the CSS parser to set the equivalent CSS value from the content attribute.
+
 2017-06-14  Miguel Gomez  <mago...@igalia.com>
 
         REGRESSION(r216901): ImageDecoders: rendering of large images is broken since r216901

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSMarkup.cpp (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSMarkup.cpp	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSMarkup.cpp	2017-06-20 10:29:53 UTC (rev 218582)
@@ -158,13 +158,13 @@
     return isCSSTokenizerURL(string.characters16(), length);
 }
 
-void serializeString(const String& string, StringBuilder& appendTo, bool useDoubleQuotes)
+void serializeString(const String& string, StringBuilder& appendTo)
 {
     // FIXME: From the CSS OM draft:
     // To serialize a string means to create a string represented by '"' (U+0022).
     // We need to switch to using " instead of ', but this involves patching a large
     // number of tests and changing editing code to not get confused by double quotes.
-    appendTo.append(useDoubleQuotes ? '\"' : '\'');
+    appendTo.append('"');
 
     unsigned index = 0;
     while (index < string.length()) {
@@ -179,13 +179,13 @@
             appendTo.append(c);
     }
 
-    appendTo.append(useDoubleQuotes ? '\"' : '\'');
+    appendTo.append('"');
 }
 
-String serializeString(const String& string, bool useDoubleQuotes)
+String serializeString(const String& string)
 {
     StringBuilder builder;
-    serializeString(string, builder, useDoubleQuotes);
+    serializeString(string, builder);
     return builder.toString();
 }
 

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSMarkup.h (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSMarkup.h	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSMarkup.h	2017-06-20 10:29:53 UTC (rev 218582)
@@ -30,8 +30,8 @@
 
 // Common serializing methods. See: http://dev.w3.org/csswg/cssom/#common-serializing-idioms
 void serializeIdentifier(const String& identifier, StringBuilder& appendTo, bool skipStartChecks = false);
-void serializeString(const String&, StringBuilder& appendTo, bool useDoubleQuotes = false);
-String serializeString(const String&, bool useDoubleQuotes = false);
+void serializeString(const String&, StringBuilder& appendTo);
+String serializeString(const String&);
 String serializeURL(const String&);
 String serializeFontFamily(const String&);
 

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSSelector.cpp (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSSelector.cpp	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/css/CSSSelector.cpp	2017-06-20 10:29:53 UTC (rev 218582)
@@ -697,7 +697,7 @@
                     break;
             }
             if (cs->match() != CSSSelector::Set) {
-                serializeString(cs->serializingValue(), str, true);
+                serializeString(cs->serializingValue(), str);
                 if (cs->attributeValueMatchingIsCaseInsensitive())
                     str.appendLiteral(" i]");
                 else

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/editing/EditingStyle.cpp (218581 => 218582)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/editing/EditingStyle.cpp	2017-06-20 10:27:41 UTC (rev 218581)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/editing/EditingStyle.cpp	2017-06-20 10:29:53 UTC (rev 218582)
@@ -1704,8 +1704,8 @@
     }
 
     m_applyFontFace = style.getPropertyValue(CSSPropertyFontFamily);
-    // Remove single quotes for Outlook 2007 compatibility. See https://bugs.webkit.org/show_bug.cgi?id=79448
-    m_applyFontFace.replaceWithLiteral('\'', "");
+    // Remove quotes for Outlook 2007 compatibility. See https://bugs.webkit.org/show_bug.cgi?id=79448
+    m_applyFontFace.replaceWithLiteral('\"', "");
     style.removeProperty(CSSPropertyFontFamily);
 
     if (RefPtr<CSSValue> fontSize = style.getPropertyCSSValue(CSSPropertyFontSize)) {
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to