<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[208733] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/208733">208733</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2016-11-15 08:57:30 -0800 (Tue, 15 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS Parser] Fix font-synthesis and text-decoration-skip parsing
https://bugs.webkit.org/show_bug.cgi?id=164736

Reviewed by Dean Jackson.

Source/WebCore:

Fix the properties to not allow duplicate values, to reject when
garbage values are included, to require that none be a singleton,
and to preserve the declaration order of the properties.

* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertTextDecorationSkip):
* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseFontSynthesis):
(WebCore::CSSParser::parseTextDecorationSkip):
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeFontSynthesis):
(WebCore::consumeTextDecorationSkip):
(WebCore::CSSPropertyParser::parseSingleValue):

LayoutTests:

* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt:
* fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html:
* fast/css3-text/font-synthesis-parse-expected.txt:
* fast/css3-text/font-synthesis-parse.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextdecorationskiptextdecorationskiproundtripexpectedtxt">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcss3textcss3textdecorationtextdecorationskiptextdecorationskiproundtriphtml">trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html</a></li>
<li><a href="#trunkLayoutTestsfastcss3textfontsynthesisparseexpectedtxt">trunk/LayoutTests/fast/css3-text/font-synthesis-parse-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcss3textfontsynthesisparsehtml">trunk/LayoutTests/fast/css3-text/font-synthesis-parse.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderConverterh">trunk/Source/WebCore/css/StyleBuilderConverter.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParsercpp">trunk/Source/WebCore/css/parser/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParsercpp">trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208732 => 208733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-15 16:40:44 UTC (rev 208732)
+++ trunk/LayoutTests/ChangeLog        2016-11-15 16:57:30 UTC (rev 208733)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-11-14  Dave Hyatt  &lt;hyatt@apple.com&gt;
+
+        [CSS Parser] Fix font-synthesis and text-decoration-skip parsing
+        https://bugs.webkit.org/show_bug.cgi?id=164736
+
+        Reviewed by Dean Jackson.
+
+        * fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt:
+        * fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html:
+        * fast/css3-text/font-synthesis-parse-expected.txt:
+        * fast/css3-text/font-synthesis-parse.html:
+
</ins><span class="cx"> 2016-11-15  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
</span></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextdecorationskiptextdecorationskiproundtripexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt (208732 => 208733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip-expected.txt        2016-11-15 16:57:30 UTC (rev 208733)
</span><span class="lines">@@ -11,52 +11,42 @@
</span><span class="cx"> PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;ink&quot;
</span><span class="cx"> PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;ink&quot;
</span><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;ink&quot;
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;ink&quot;
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;auto&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 0
</span><span class="cx"> PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;auto&quot;
</span><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;ink&quot;
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;ink&quot;
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;auto&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;ink&quot;
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;ink&quot;
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;auto&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;ink&quot;
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;ink&quot;
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;auto&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;ink&quot;
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;ink&quot;
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;auto&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 1
</span><span class="cx"> PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;objects&quot;
</span><span class="cx"> PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;objects&quot;
</span><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;objects&quot;
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;objects&quot;
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;auto&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;objects&quot;
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;objects&quot;
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;auto&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;objects&quot;
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;objects&quot;
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;auto&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;objects&quot;
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;objects&quot;
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;auto&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;objects&quot;
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;objects&quot;
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is &quot;auto&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 1
</span><span class="cx"> PASS declaration.getPropertyValue('-webkit-text-decoration-skip') is &quot;none&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcss3textcss3textdecorationtextdecorationskiptextdecorationskiproundtriphtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html (208732 => 208733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html        2016-11-15 16:40:44 UTC (rev 208732)
+++ trunk/LayoutTests/fast/css3-text/css3-text-decoration/text-decoration-skip/text-decoration-skip-roundtrip.html        2016-11-15 16:57:30 UTC (rev 208733)
</span><span class="lines">@@ -86,40 +86,40 @@
</span><span class="cx">     testInkIsValid(stylesheet, target);
</span><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: ink ink ink ink ink; }&quot;, 0);
</span><del>-    testInkIsValid(stylesheet, target);
</del><ins>+    testInvalidRule(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: garbage; }&quot;, 0);
</span><span class="cx">     testInvalidRule(stylesheet, target);
</span><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: garbage ink; }&quot;, 0);
</span><del>-    testInkIsValid(stylesheet, target);
</del><ins>+    testInvalidRule(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: ink garbage; }&quot;, 0);
</span><del>-    testInkIsValid(stylesheet, target);
</del><ins>+    testInvalidRule(stylesheet, target);
</ins><span class="cx">     
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: garbage ink garbage; }&quot;, 0);
</span><del>-    testInkIsValid(stylesheet, target);
</del><ins>+    testInvalidRule(stylesheet, target);
</ins><span class="cx">     
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: ink garbage ink; }&quot;, 0);
</span><del>-    testInkIsValid(stylesheet, target);
</del><ins>+    testInvalidRule(stylesheet, target);
</ins><span class="cx">     
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: objects; }&quot;, 0);
</span><span class="cx">     testObjectsIsValid(stylesheet, target);
</span><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: objects objects objects objects objects; }&quot;, 0);
</span><del>-    testObjectsIsValid(stylesheet, target);
</del><ins>+    testInvalidRule(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: garbage objects; }&quot;, 0);
</span><del>-    testObjectsIsValid(stylesheet, target);
</del><ins>+    testInvalidRule(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: objects garbage; }&quot;, 0);
</span><del>-    testObjectsIsValid(stylesheet, target);
</del><ins>+    testInvalidRule(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: garbage objects garbage; }&quot;, 0);
</span><del>-    testObjectsIsValid(stylesheet, target);
</del><ins>+    testInvalidRule(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: objects garbage objects; }&quot;, 0);
</span><del>-    testObjectsIsValid(stylesheet, target);
</del><ins>+    testInvalidRule(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;.p { -webkit-text-decoration-skip: none; }&quot;, 0);
</span><span class="cx">     testNoneIsValid(stylesheet, target);
</span></span></pre></div>
<a id="trunkLayoutTestsfastcss3textfontsynthesisparseexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css3-text/font-synthesis-parse-expected.txt (208732 => 208733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/font-synthesis-parse-expected.txt        2016-11-15 16:40:44 UTC (rev 208732)
+++ trunk/LayoutTests/fast/css3-text/font-synthesis-parse-expected.txt        2016-11-15 16:57:30 UTC (rev 208733)
</span><span class="lines">@@ -16,21 +16,13 @@
</span><span class="cx"> PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style&quot;
</span><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 1
</span><del>-PASS declaration.getPropertyValue('font-synthesis') is &quot;style&quot;
-PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style&quot;
-PASS cssRule.type is cssRule.STYLE_RULE
-PASS declaration.length is 1
</del><span class="cx"> PASS declaration.getPropertyValue('font-synthesis') is &quot;weight style&quot;
</span><span class="cx"> PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style weight&quot;
</span><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 1
</span><del>-PASS declaration.getPropertyValue('font-synthesis') is &quot;weight style&quot;
</del><ins>+PASS declaration.getPropertyValue('font-synthesis') is &quot;style weight&quot;
</ins><span class="cx"> PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style weight&quot;
</span><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('font-synthesis') is &quot;weight style&quot;
-PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style weight&quot;
-PASS cssRule.type is cssRule.STYLE_RULE
</del><span class="cx"> PASS declaration.length is 0
</span><span class="cx"> PASS declaration.getPropertyValue('font-synthesis') is &quot;&quot;
</span><span class="cx"> PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style weight&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcss3textfontsynthesisparsehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css3-text/font-synthesis-parse.html (208732 => 208733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/font-synthesis-parse.html        2016-11-15 16:40:44 UTC (rev 208732)
+++ trunk/LayoutTests/fast/css3-text/font-synthesis-parse.html        2016-11-15 16:57:30 UTC (rev 208733)
</span><span class="lines">@@ -67,7 +67,7 @@
</span><span class="cx">       shouldBe(&quot;cssRule.type&quot;, &quot;cssRule.STYLE_RULE&quot;);
</span><span class="cx">       declaration = cssRule.style;
</span><span class="cx">       shouldBe(&quot;declaration.length&quot;, &quot;1&quot;);
</span><del>-      shouldBeEqualToString(&quot;declaration.getPropertyValue('font-synthesis')&quot;, &quot;weight style&quot;);
</del><ins>+      shouldBeEqualToString(&quot;declaration.getPropertyValue('font-synthesis')&quot;, &quot;style weight&quot;);
</ins><span class="cx">       computedStyle = window.getComputedStyle(target, null);
</span><span class="cx">       shouldBeEqualToString(&quot;computedStyle.getPropertyCSSValue('font-synthesis').cssText&quot;, &quot;style weight&quot;);
</span><span class="cx">       stylesheet.deleteRule(0);
</span><span class="lines">@@ -87,9 +87,6 @@
</span><span class="cx">     stylesheet.insertRule(&quot;#p { font-synthesis: weight }&quot;, 0);
</span><span class="cx">     testWeight(stylesheet, target);
</span><span class="cx"> 
</span><del>-    stylesheet.insertRule(&quot;#p { font-synthesis: style style }&quot;, 0);
-    testStyle(stylesheet, target);
-
</del><span class="cx">     stylesheet.insertRule(&quot;#p { font-synthesis: style }&quot;, 0);
</span><span class="cx">     testStyle(stylesheet, target);
</span><span class="cx"> 
</span><span class="lines">@@ -96,9 +93,6 @@
</span><span class="cx">     stylesheet.insertRule(&quot;#p { font-synthesis: weight style }&quot;, 0);
</span><span class="cx">     testWeightAndStyle(stylesheet, target);
</span><span class="cx"> 
</span><del>-    stylesheet.insertRule(&quot;#p { font-synthesis: style weight weight}&quot;, 0);
-    testStyleAndWeight(stylesheet, target);
-
</del><span class="cx">     stylesheet.insertRule(&quot;#p { font-synthesis: style weight }&quot;, 0);
</span><span class="cx">     testStyleAndWeight(stylesheet, target);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208732 => 208733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-15 16:40:44 UTC (rev 208732)
+++ trunk/Source/WebCore/ChangeLog        2016-11-15 16:57:30 UTC (rev 208733)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2016-11-14  Dave Hyatt  &lt;hyatt@apple.com&gt;
+
+        [CSS Parser] Fix font-synthesis and text-decoration-skip parsing
+        https://bugs.webkit.org/show_bug.cgi?id=164736
+
+        Reviewed by Dean Jackson.
+
+        Fix the properties to not allow duplicate values, to reject when
+        garbage values are included, to require that none be a singleton,
+        and to preserve the declaration order of the properties.
+
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertTextDecorationSkip):
+        * css/parser/CSSParser.cpp:
+        (WebCore::CSSParser::parseFontSynthesis):
+        (WebCore::CSSParser::parseTextDecorationSkip):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeFontSynthesis):
+        (WebCore::consumeTextDecorationSkip):
+        (WebCore::CSSPropertyParser::parseSingleValue):
+
</ins><span class="cx"> 2016-11-15  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Disallow loads using HTTP 0.9 at the ResourceHandle/NetworkDataTask level
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (208732 => 208733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderConverter.h        2016-11-15 16:40:44 UTC (rev 208732)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h        2016-11-15 16:57:30 UTC (rev 208733)
</span><span class="lines">@@ -750,7 +750,7 @@
</span><span class="cx">     if (is&lt;CSSPrimitiveValue&gt;(value))
</span><span class="cx">         return valueToDecorationSkip(downcast&lt;CSSPrimitiveValue&gt;(value));
</span><span class="cx"> 
</span><del>-    TextDecorationSkip skip = RenderStyle::initialTextDecorationSkip();
</del><ins>+    TextDecorationSkip skip = TextDecorationSkipNone;
</ins><span class="cx">     for (auto&amp; currentValue : downcast&lt;CSSValueList&gt;(value))
</span><span class="cx">         skip |= valueToDecorationSkip(downcast&lt;CSSPrimitiveValue&gt;(currentValue.get()));
</span><span class="cx">     return skip;
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (208732 => 208733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-11-15 16:40:44 UTC (rev 208732)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-11-15 16:57:30 UTC (rev 208733)
</span><span class="lines">@@ -7083,7 +7083,6 @@
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseFontSynthesis(bool important)
</span><span class="cx"> {
</span><del>-    // none | [ weight || style ]
</del><span class="cx">     CSSParserValue* value = m_valueList-&gt;current();
</span><span class="cx">     if (value &amp;&amp; value-&gt;id == CSSValueNone) {
</span><span class="cx">         addProperty(CSSPropertyFontSynthesis, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important);
</span><span class="lines">@@ -7091,29 +7090,30 @@
</span><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool encounteredWeight = false;
-    bool encounteredStyle = false;
-    while (value) {
</del><ins>+    RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSpaceSeparated();
+
+    do {
</ins><span class="cx">         switch (value-&gt;id) {
</span><span class="cx">         case CSSValueWeight:
</span><del>-            encounteredWeight = true;
</del><ins>+        case CSSValueStyle: {
+            auto singleValue = CSSValuePool::singleton().createIdentifierValue(value-&gt;id);
+            if (list-&gt;hasValue(singleValue.ptr()))
+                return false;
+            list-&gt;append(WTFMove(singleValue));
</ins><span class="cx">             break;
</span><del>-        case CSSValueStyle:
-            encounteredStyle = true;
-            break;
</del><ins>+        }
</ins><span class="cx">         default:
</span><span class="cx">             return false;
</span><span class="cx">         }
</span><del>-        value = m_valueList-&gt;next();
-    }
</del><ins>+    } while ((value = m_valueList-&gt;next()));
+    
+    if (!list-&gt;length())
+        return false;
+    
+    addProperty(CSSPropertyFontSynthesis, list.releaseNonNull(), important);
+    m_valueList-&gt;next();
+    return true;
</ins><span class="cx"> 
</span><del>-    auto list = CSSValueList::createSpaceSeparated();
-    if (encounteredWeight)
-        list-&gt;append(CSSValuePool::singleton().createIdentifierValue(CSSValueWeight));
-    if (encounteredStyle)
-        list-&gt;append(CSSValuePool::singleton().createIdentifierValue(CSSValueStyle));
-    addProperty(CSSPropertyFontSynthesis, WTFMove(list), important);
-    return true;
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseFontFaceSrcURI(CSSValueList&amp; valueList)
</span><span class="lines">@@ -10411,19 +10411,36 @@
</span><span class="cx">     // The text-decoration-skip property has syntax &quot;none | [ objects || spaces || ink || edges || box-decoration ]&quot;.
</span><span class="cx">     // However, only 'none' and 'ink' are implemented yet, so we will parse syntax &quot;none | ink&quot; for now.
</span><span class="cx">     CSSParserValue* value = m_valueList-&gt;current();
</span><ins>+    if (value &amp;&amp; value-&gt;id == CSSValueNone) {
+        addProperty(CSSPropertyWebkitTextDecorationSkip, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important);
+        m_valueList-&gt;next();
+        return true;
+    }
+    
+    RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSpaceSeparated();
+
</ins><span class="cx">     do {
</span><span class="cx">         switch (value-&gt;id) {
</span><del>-        case CSSValueNone:
</del><span class="cx">         case CSSValueAuto:
</span><span class="cx">         case CSSValueInk:
</span><del>-        case CSSValueObjects:
-            addProperty(CSSPropertyWebkitTextDecorationSkip, CSSValuePool::singleton().createIdentifierValue(value-&gt;id), important);
-            return true;
-        default:
</del><ins>+        case CSSValueObjects: {
+            auto singleValue = CSSValuePool::singleton().createIdentifierValue(value-&gt;id);
+            if (list-&gt;hasValue(singleValue.ptr()))
+                return false;
+            list-&gt;append(WTFMove(singleValue));
</ins><span class="cx">             break;
</span><span class="cx">         }
</span><ins>+        default:
+            return false;
+        }
</ins><span class="cx">     } while ((value = m_valueList-&gt;next()));
</span><del>-    return false;
</del><ins>+    
+    if (!list-&gt;length())
+        return false;
+    
+    addProperty(CSSPropertyWebkitTextDecorationSkip, list.releaseNonNull(), important);
+    m_valueList-&gt;next();
+    return true;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseTextUnderlinePosition(bool important)
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (208732 => 208733)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2016-11-15 16:40:44 UTC (rev 208732)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2016-11-15 16:57:30 UTC (rev 208733)
</span><span class="lines">@@ -790,30 +790,23 @@
</span><span class="cx"> static RefPtr&lt;CSSValue&gt; consumeFontSynthesis(CSSParserTokenRange&amp; range)
</span><span class="cx"> {
</span><span class="cx">     // none | [ weight || style ]
</span><del>-    if (range.peek().id() == CSSValueNone)
</del><ins>+    CSSValueID id = range.peek().id();
+    if (id == CSSValueNone)
</ins><span class="cx">         return consumeIdent(range);
</span><span class="cx">     
</span><del>-    RefPtr&lt;CSSValue&gt; weight;
-    RefPtr&lt;CSSValue&gt; style;
-    
-    // FIXME: We allow weight and style to occur multiple times because the
-    // old parser did, and layout tests specifically check for it. It seems
-    // wrong though.
-    do {
-        if (range.peek().id() == CSSValueWeight)
-            weight = consumeIdent(range);
-        else if (range.peek().id() == CSSValueStyle)
-            style = consumeIdent(range);
-        else
</del><ins>+    RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSpaceSeparated();
+    while (true) {
+        auto ident = consumeIdent&lt;CSSValueWeight, CSSValueStyle&gt;(range);
+        if (!ident)
+            break;
+        if (list-&gt;hasValue(ident.get()))
</ins><span class="cx">             return nullptr;
</span><del>-    } while (!range.atEnd());
</del><ins>+        list-&gt;append(ident.releaseNonNull());
+    }
</ins><span class="cx">     
</span><del>-    auto list = CSSValueList::createSpaceSeparated();
-    if (weight)
-        list-&gt;append(weight.releaseNonNull());
-    if (style)
-        list-&gt;append(style.releaseNonNull());
-    return WTFMove(list);
</del><ins>+    if (!list-&gt;length())
+        return nullptr;
+    return list;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static RefPtr&lt;CSSValue&gt; consumeLetterSpacing(CSSParserTokenRange&amp; range, CSSParserMode cssParserMode)
</span><span class="lines">@@ -1418,6 +1411,27 @@
</span><span class="cx">     return list;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static RefPtr&lt;CSSValue&gt; consumeTextDecorationSkip(CSSParserTokenRange&amp; range)
+{
+    CSSValueID id = range.peek().id();
+    if (id == CSSValueNone)
+        return consumeIdent(range);
+
+    RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSpaceSeparated();
+    while (true) {
+        auto ident = consumeIdent&lt;CSSValueAuto, CSSValueInk, CSSValueObjects&gt;(range);
+        if (!ident)
+            break;
+        if (list-&gt;hasValue(ident.get()))
+            return nullptr;
+        list-&gt;append(ident.releaseNonNull());
+    }
+
+    if (!list-&gt;length())
+        return nullptr;
+    return list;
+}
+
</ins><span class="cx"> static RefPtr&lt;CSSValue&gt; consumeTextEmphasisStyle(CSSParserTokenRange&amp; range)
</span><span class="cx"> {
</span><span class="cx">     CSSValueID id = range.peek().id();
</span><span class="lines">@@ -3509,6 +3523,8 @@
</span><span class="cx">         return consumePositiveInteger(m_range);
</span><span class="cx">     case CSSPropertyWebkitTextDecorationColor:
</span><span class="cx">         return consumeColor(m_range, m_context.mode);
</span><ins>+    case CSSPropertyWebkitTextDecorationSkip:
+        return consumeTextDecorationSkip(m_range);
</ins><span class="cx">     case CSSPropertyWebkitTextStrokeWidth:
</span><span class="cx">         return consumeTextStrokeWidth(m_range, m_context.mode);
</span><span class="cx">     case CSSPropertyWebkitTextFillColor:
</span></span></pre>
</div>
</div>

</body>
</html>