<!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 <hyatt@apple.com>
+
+ [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 <dabates@apple.com>
</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 "ink"
</span><span class="cx"> PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink"
</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 "ink"
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink"
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
</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 "auto"
</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 "ink"
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink"
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
</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 "ink"
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink"
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
</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 "ink"
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink"
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
</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 "ink"
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "ink"
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
</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 "objects"
</span><span class="cx"> PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects"
</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 "objects"
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects"
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
</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 "objects"
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects"
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
</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 "objects"
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects"
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
</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 "objects"
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects"
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
</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 "objects"
-PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "objects"
</del><ins>+PASS declaration.length is 0
+PASS computedStyle.getPropertyCSSValue('-webkit-text-decoration-skip').cssText is "auto"
</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 "none"
</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(".p { -webkit-text-decoration-skip: ink ink ink ink ink; }", 0);
</span><del>- testInkIsValid(stylesheet, target);
</del><ins>+ testInvalidRule(stylesheet, target);
</ins><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: garbage; }", 0);
</span><span class="cx"> testInvalidRule(stylesheet, target);
</span><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: garbage ink; }", 0);
</span><del>- testInkIsValid(stylesheet, target);
</del><ins>+ testInvalidRule(stylesheet, target);
</ins><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: ink garbage; }", 0);
</span><del>- testInkIsValid(stylesheet, target);
</del><ins>+ testInvalidRule(stylesheet, target);
</ins><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: garbage ink garbage; }", 0);
</span><del>- testInkIsValid(stylesheet, target);
</del><ins>+ testInvalidRule(stylesheet, target);
</ins><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: ink garbage ink; }", 0);
</span><del>- testInkIsValid(stylesheet, target);
</del><ins>+ testInvalidRule(stylesheet, target);
</ins><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: objects; }", 0);
</span><span class="cx"> testObjectsIsValid(stylesheet, target);
</span><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: objects objects objects objects objects; }", 0);
</span><del>- testObjectsIsValid(stylesheet, target);
</del><ins>+ testInvalidRule(stylesheet, target);
</ins><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: garbage objects; }", 0);
</span><del>- testObjectsIsValid(stylesheet, target);
</del><ins>+ testInvalidRule(stylesheet, target);
</ins><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: objects garbage; }", 0);
</span><del>- testObjectsIsValid(stylesheet, target);
</del><ins>+ testInvalidRule(stylesheet, target);
</ins><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: garbage objects garbage; }", 0);
</span><del>- testObjectsIsValid(stylesheet, target);
</del><ins>+ testInvalidRule(stylesheet, target);
</ins><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: objects garbage objects; }", 0);
</span><del>- testObjectsIsValid(stylesheet, target);
</del><ins>+ testInvalidRule(stylesheet, target);
</ins><span class="cx">
</span><span class="cx"> stylesheet.insertRule(".p { -webkit-text-decoration-skip: none; }", 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 "style"
</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 "style"
-PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "style"
-PASS cssRule.type is cssRule.STYLE_RULE
-PASS declaration.length is 1
</del><span class="cx"> PASS declaration.getPropertyValue('font-synthesis') is "weight style"
</span><span class="cx"> PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "style weight"
</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 "weight style"
</del><ins>+PASS declaration.getPropertyValue('font-synthesis') is "style weight"
</ins><span class="cx"> PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "style weight"
</span><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><del>-PASS declaration.length is 1
-PASS declaration.getPropertyValue('font-synthesis') is "weight style"
-PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "style weight"
-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 ""
</span><span class="cx"> PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is "style weight"
</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("cssRule.type", "cssRule.STYLE_RULE");
</span><span class="cx"> declaration = cssRule.style;
</span><span class="cx"> shouldBe("declaration.length", "1");
</span><del>- shouldBeEqualToString("declaration.getPropertyValue('font-synthesis')", "weight style");
</del><ins>+ shouldBeEqualToString("declaration.getPropertyValue('font-synthesis')", "style weight");
</ins><span class="cx"> computedStyle = window.getComputedStyle(target, null);
</span><span class="cx"> shouldBeEqualToString("computedStyle.getPropertyCSSValue('font-synthesis').cssText", "style weight");
</span><span class="cx"> stylesheet.deleteRule(0);
</span><span class="lines">@@ -87,9 +87,6 @@
</span><span class="cx"> stylesheet.insertRule("#p { font-synthesis: weight }", 0);
</span><span class="cx"> testWeight(stylesheet, target);
</span><span class="cx">
</span><del>- stylesheet.insertRule("#p { font-synthesis: style style }", 0);
- testStyle(stylesheet, target);
-
</del><span class="cx"> stylesheet.insertRule("#p { font-synthesis: style }", 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("#p { font-synthesis: weight style }", 0);
</span><span class="cx"> testWeightAndStyle(stylesheet, target);
</span><span class="cx">
</span><del>- stylesheet.insertRule("#p { font-synthesis: style weight weight}", 0);
- testStyleAndWeight(stylesheet, target);
-
</del><span class="cx"> stylesheet.insertRule("#p { font-synthesis: style weight }", 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 <hyatt@apple.com>
+
+ [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 <dabates@apple.com>
</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<CSSPrimitiveValue>(value))
</span><span class="cx"> return valueToDecorationSkip(downcast<CSSPrimitiveValue>(value));
</span><span class="cx">
</span><del>- TextDecorationSkip skip = RenderStyle::initialTextDecorationSkip();
</del><ins>+ TextDecorationSkip skip = TextDecorationSkipNone;
</ins><span class="cx"> for (auto& currentValue : downcast<CSSValueList>(value))
</span><span class="cx"> skip |= valueToDecorationSkip(downcast<CSSPrimitiveValue>(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->current();
</span><span class="cx"> if (value && value->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<CSSValueList> list = CSSValueList::createSpaceSeparated();
+
+ do {
</ins><span class="cx"> switch (value->id) {
</span><span class="cx"> case CSSValueWeight:
</span><del>- encounteredWeight = true;
</del><ins>+ case CSSValueStyle: {
+ auto singleValue = CSSValuePool::singleton().createIdentifierValue(value->id);
+ if (list->hasValue(singleValue.ptr()))
+ return false;
+ list->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->next();
- }
</del><ins>+ } while ((value = m_valueList->next()));
+
+ if (!list->length())
+ return false;
+
+ addProperty(CSSPropertyFontSynthesis, list.releaseNonNull(), important);
+ m_valueList->next();
+ return true;
</ins><span class="cx">
</span><del>- auto list = CSSValueList::createSpaceSeparated();
- if (encounteredWeight)
- list->append(CSSValuePool::singleton().createIdentifierValue(CSSValueWeight));
- if (encounteredStyle)
- list->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& valueList)
</span><span class="lines">@@ -10411,19 +10411,36 @@
</span><span class="cx"> // The text-decoration-skip property has syntax "none | [ objects || spaces || ink || edges || box-decoration ]".
</span><span class="cx"> // However, only 'none' and 'ink' are implemented yet, so we will parse syntax "none | ink" for now.
</span><span class="cx"> CSSParserValue* value = m_valueList->current();
</span><ins>+ if (value && value->id == CSSValueNone) {
+ addProperty(CSSPropertyWebkitTextDecorationSkip, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important);
+ m_valueList->next();
+ return true;
+ }
+
+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+
</ins><span class="cx"> do {
</span><span class="cx"> switch (value->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->id), important);
- return true;
- default:
</del><ins>+ case CSSValueObjects: {
+ auto singleValue = CSSValuePool::singleton().createIdentifierValue(value->id);
+ if (list->hasValue(singleValue.ptr()))
+ return false;
+ list->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->next()));
</span><del>- return false;
</del><ins>+
+ if (!list->length())
+ return false;
+
+ addProperty(CSSPropertyWebkitTextDecorationSkip, list.releaseNonNull(), important);
+ m_valueList->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<CSSValue> consumeFontSynthesis(CSSParserTokenRange& 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<CSSValue> weight;
- RefPtr<CSSValue> 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<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ while (true) {
+ auto ident = consumeIdent<CSSValueWeight, CSSValueStyle>(range);
+ if (!ident)
+ break;
+ if (list->hasValue(ident.get()))
</ins><span class="cx"> return nullptr;
</span><del>- } while (!range.atEnd());
</del><ins>+ list->append(ident.releaseNonNull());
+ }
</ins><span class="cx">
</span><del>- auto list = CSSValueList::createSpaceSeparated();
- if (weight)
- list->append(weight.releaseNonNull());
- if (style)
- list->append(style.releaseNonNull());
- return WTFMove(list);
</del><ins>+ if (!list->length())
+ return nullptr;
+ return list;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static RefPtr<CSSValue> consumeLetterSpacing(CSSParserTokenRange& 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<CSSValue> consumeTextDecorationSkip(CSSParserTokenRange& range)
+{
+ CSSValueID id = range.peek().id();
+ if (id == CSSValueNone)
+ return consumeIdent(range);
+
+ RefPtr<CSSValueList> list = CSSValueList::createSpaceSeparated();
+ while (true) {
+ auto ident = consumeIdent<CSSValueAuto, CSSValueInk, CSSValueObjects>(range);
+ if (!ident)
+ break;
+ if (list->hasValue(ident.get()))
+ return nullptr;
+ list->append(ident.releaseNonNull());
+ }
+
+ if (!list->length())
+ return nullptr;
+ return list;
+}
+
</ins><span class="cx"> static RefPtr<CSSValue> consumeTextEmphasisStyle(CSSParserTokenRange& 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>