<!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>[209265] trunk/Source/WebCore</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/209265">209265</a></dd>
<dt>Author</dt> <dd>hyatt@apple.com</dd>
<dt>Date</dt> <dd>2016-12-02 14:07:08 -0800 (Fri, 02 Dec 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS Parser] Need to set edit flags properly when user-modify/select are used.
https://bugs.webkit.org/show_bug.cgi?id=165334

Reviewed by Dean Jackson.

The old parser calls parserSetUsesStyleBasedEditability on
StyleSheetContents* from inside isValidKeywordPropertyAndValue. This
is pretty lame, but we have to do the same in order to pass editing
layout tests.

All of the functions below have been patched with the sole purpose of
propagating StyleSheetContents* through to isValidKeywordPropertyAndValue
in the new parser.

* css/parser/CSSParser.cpp:
(WebCore::CSSParser::parseValueWithVariableReferences):
* css/parser/CSSParser.h:
* css/parser/CSSParserFastPaths.cpp:
(WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
(WebCore::parseKeywordValue):
(WebCore::CSSParserFastPaths::maybeParseValue):
* css/parser/CSSParserFastPaths.h:
* css/parser/CSSParserImpl.cpp:
(WebCore::CSSParserImpl::consumeDeclarationValue):
* css/parser/CSSPropertyParser.cpp:
(WebCore::CSSPropertyParser::CSSPropertyParser):
(WebCore::CSSPropertyParser::parseValue):
(WebCore::CSSPropertyParser::parseSingleValue):
(WebCore::CSSPropertyParser::parseFontFaceDescriptor):
(WebCore::CSSPropertyParser::consumeFont):
(WebCore::CSSPropertyParser::parseShorthand):
* css/parser/CSSPropertyParser.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParsercpp">trunk/Source/WebCore/css/parser/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserh">trunk/Source/WebCore/css/parser/CSSParser.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserFastPathscpp">trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserFastPathsh">trunk/Source/WebCore/css/parser/CSSParserFastPaths.h</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSParserImplcpp">trunk/Source/WebCore/css/parser/CSSParserImpl.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParsercpp">trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParserh">trunk/Source/WebCore/css/parser/CSSPropertyParser.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (209264 => 209265)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-12-02 22:00:57 UTC (rev 209264)
+++ trunk/Source/WebCore/ChangeLog        2016-12-02 22:07:08 UTC (rev 209265)
</span><span class="lines">@@ -1,3 +1,38 @@
</span><ins>+2016-12-02  Dave Hyatt  &lt;hyatt@apple.com&gt;
+
+        [CSS Parser] Need to set edit flags properly when user-modify/select are used.
+        https://bugs.webkit.org/show_bug.cgi?id=165334
+
+        Reviewed by Dean Jackson.
+
+        The old parser calls parserSetUsesStyleBasedEditability on
+        StyleSheetContents* from inside isValidKeywordPropertyAndValue. This
+        is pretty lame, but we have to do the same in order to pass editing
+        layout tests.
+
+        All of the functions below have been patched with the sole purpose of
+        propagating StyleSheetContents* through to isValidKeywordPropertyAndValue
+        in the new parser.
+
+        * css/parser/CSSParser.cpp:
+        (WebCore::CSSParser::parseValueWithVariableReferences):
+        * css/parser/CSSParser.h:
+        * css/parser/CSSParserFastPaths.cpp:
+        (WebCore::CSSParserFastPaths::isValidKeywordPropertyAndValue):
+        (WebCore::parseKeywordValue):
+        (WebCore::CSSParserFastPaths::maybeParseValue):
+        * css/parser/CSSParserFastPaths.h:
+        * css/parser/CSSParserImpl.cpp:
+        (WebCore::CSSParserImpl::consumeDeclarationValue):
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::CSSPropertyParser::CSSPropertyParser):
+        (WebCore::CSSPropertyParser::parseValue):
+        (WebCore::CSSPropertyParser::parseSingleValue):
+        (WebCore::CSSPropertyParser::parseFontFaceDescriptor):
+        (WebCore::CSSPropertyParser::consumeFont):
+        (WebCore::CSSPropertyParser::parseShorthand):
+        * css/parser/CSSPropertyParser.h:
+
</ins><span class="cx"> 2016-12-02  Beth Dakin  &lt;bdakin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r208802): TouchBar pause button doesn't work
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParser.cpp (209264 => 209265)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-12-02 22:00:57 UTC (rev 209264)
+++ trunk/Source/WebCore/css/parser/CSSParser.cpp        2016-12-02 22:07:08 UTC (rev 209265)
</span><span class="lines">@@ -1820,6 +1820,7 @@
</span><span class="cx"> 
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSParser::parseValueWithVariableReferences(CSSPropertyID propID, const CSSValue&amp; value, const CustomPropertyValueMap&amp; customProperties, TextDirection direction, WritingMode writingMode)
</span><span class="cx"> {
</span><ins>+    // FIXME-NEWPARSER: Remove this block when old parser goes away.
</ins><span class="cx">     if (value.isVariableDependentValue()) {
</span><span class="cx">         const CSSVariableDependentValue&amp; dependentValue = downcast&lt;CSSVariableDependentValue&gt;(value);
</span><span class="cx">         m_valueList.reset(new CSSParserValueList());
</span><span class="lines">@@ -1857,7 +1858,7 @@
</span><span class="cx">             return nullptr;
</span><span class="cx">         
</span><span class="cx">         ParsedPropertyVector parsedProperties;
</span><del>-        if (!CSSPropertyParser::parseValue(shorthandID, false, resolvedTokens, m_context, parsedProperties, StyleRule::Style))
</del><ins>+        if (!CSSPropertyParser::parseValue(shorthandID, false, resolvedTokens, m_context, nullptr, parsedProperties, StyleRule::Style))
</ins><span class="cx">             return nullptr;
</span><span class="cx">         
</span><span class="cx">         for (auto&amp; property : parsedProperties) {
</span><span class="lines">@@ -1877,7 +1878,7 @@
</span><span class="cx">         if (!variableData-&gt;resolveTokenRange(customProperties, variableData-&gt;tokens(), resolvedTokens))
</span><span class="cx">             return nullptr;
</span><span class="cx">         
</span><del>-        return CSSPropertyParser::parseSingleValue(propID, resolvedTokens, m_context);
</del><ins>+        return CSSPropertyParser::parseSingleValue(propID, resolvedTokens, m_context, nullptr);
</ins><span class="cx">     }
</span><span class="cx">     
</span><span class="cx">     return nullptr;
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParser.h (209264 => 209265)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParser.h        2016-12-02 22:00:57 UTC (rev 209264)
+++ trunk/Source/WebCore/css/parser/CSSParser.h        2016-12-02 22:07:08 UTC (rev 209265)
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx">     static void parseDeclarationForInspector(const CSSParserContext&amp;, const String&amp;, CSSParserObserver&amp;);
</span><span class="cx"> 
</span><span class="cx">     static ParseResult parseValue(MutableStyleProperties&amp;, CSSPropertyID, const String&amp;, bool important, const CSSParserContext&amp;, StyleSheetContents*);
</span><del>-    static ParseResult parseCustomPropertyValue(MutableStyleProperties&amp;, const AtomicString&amp; propertyName, const String&amp;, bool important, const CSSParserContext&amp;, StyleSheetContents* contextStyleSheet);
</del><ins>+    static ParseResult parseCustomPropertyValue(MutableStyleProperties&amp;, const AtomicString&amp; propertyName, const String&amp;, bool important, const CSSParserContext&amp;, StyleSheetContents*);
</ins><span class="cx"> 
</span><span class="cx">     static Color parseColor(const String&amp;, bool strict = false);
</span><span class="cx">     static bool isValidSystemColorValue(CSSValueID);
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserFastPathscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp (209264 => 209265)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp        2016-12-02 22:00:57 UTC (rev 209264)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp        2016-12-02 22:07:08 UTC (rev 209265)
</span><span class="lines">@@ -42,6 +42,7 @@
</span><span class="cx"> #include &quot;RuntimeEnabledFeatures.h&quot;
</span><span class="cx"> #include &quot;StyleColor.h&quot;
</span><span class="cx"> #include &quot;StylePropertyShorthand.h&quot;
</span><ins>+#include &quot;StyleSheetContents.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -496,7 +497,7 @@
</span><span class="cx">     return CSSValuePool::singleton().createColorValue(color);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID, CSSParserMode parserMode)
</del><ins>+bool CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyID propertyId, CSSValueID valueID, CSSParserMode parserMode, StyleSheetContents* styleSheetContents)
</ins><span class="cx"> {
</span><span class="cx">     if (valueID == CSSValueInvalid || !isValueAllowedInMode(valueID, parserMode))
</span><span class="cx">         return false;
</span><span class="lines">@@ -747,9 +748,21 @@
</span><span class="cx">     case CSSPropertyWebkitUserDrag: // auto | none | element
</span><span class="cx">         return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueElement;
</span><span class="cx">     case CSSPropertyWebkitUserModify: // read-only | read-write
</span><del>-        return valueID == CSSValueReadOnly || valueID == CSSValueReadWrite || valueID == CSSValueReadWritePlaintextOnly;
</del><ins>+        if (valueID == CSSValueReadOnly || valueID == CSSValueReadWrite || valueID == CSSValueReadWritePlaintextOnly) {
+            if (styleSheetContents)
+                styleSheetContents-&gt;parserSetUsesStyleBasedEditability();
+            return true;
+        }
+        return false;
</ins><span class="cx">     case CSSPropertyWebkitUserSelect: // auto | none | text | all
</span><del>-        return valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText || valueID == CSSValueAll;
</del><ins>+        if (valueID == CSSValueAuto || valueID == CSSValueNone || valueID == CSSValueText)
+            return true;
+        if (valueID == CSSValueAll) {
+            if (styleSheetContents)
+                styleSheetContents-&gt;parserSetUsesStyleBasedEditability();
+            return true;
+        }
+        return false;
</ins><span class="cx">     case CSSPropertyWritingMode:
</span><span class="cx">         // Note that horizontal-bt is not supported by the unprefixed version of
</span><span class="cx">         // the property, only by the -webkit- version.
</span><span class="lines">@@ -1013,7 +1026,7 @@
</span><span class="cx">     || equalLettersIgnoringASCIICase(string, &quot;revert&quot;);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RefPtr&lt;CSSValue&gt; parseKeywordValue(CSSPropertyID propertyId, const String&amp; string, CSSParserMode parserMode)
</del><ins>+static RefPtr&lt;CSSValue&gt; parseKeywordValue(CSSPropertyID propertyId, const String&amp; string, CSSParserMode parserMode, StyleSheetContents* styleSheetContents)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(!string.isEmpty());
</span><span class="cx"> 
</span><span class="lines">@@ -1045,7 +1058,7 @@
</span><span class="cx">     if (valueID == CSSValueRevert)
</span><span class="cx">         return CSSValuePool::singleton().createRevertValue();
</span><span class="cx">     
</span><del>-    if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyId, valueID, parserMode))
</del><ins>+    if (CSSParserFastPaths::isValidKeywordPropertyAndValue(propertyId, valueID, parserMode, styleSheetContents))
</ins><span class="cx">         return CSSPrimitiveValue::createIdentifier(valueID);
</span><span class="cx">     return nullptr;
</span><span class="cx"> }
</span><span class="lines">@@ -1256,7 +1269,7 @@
</span><span class="cx">     return parseSimpleTransformList(string.characters16(), string.length());
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSValue&gt; CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String&amp; string, CSSParserMode parserMode)
</del><ins>+RefPtr&lt;CSSValue&gt; CSSParserFastPaths::maybeParseValue(CSSPropertyID propertyID, const String&amp; string, CSSParserMode parserMode, StyleSheetContents* styleSheetContents)
</ins><span class="cx"> {
</span><span class="cx">     RefPtr&lt;CSSValue&gt; result = parseSimpleLengthValue(propertyID, string, parserMode);
</span><span class="cx">     if (result)
</span><span class="lines">@@ -1263,7 +1276,7 @@
</span><span class="cx">         return result;
</span><span class="cx">     if (isColorPropertyID(propertyID))
</span><span class="cx">         return parseColor(string, parserMode);
</span><del>-    result = parseKeywordValue(propertyID, string, parserMode);
</del><ins>+    result = parseKeywordValue(propertyID, string, parserMode, styleSheetContents);
</ins><span class="cx">     if (result)
</span><span class="cx">         return result;
</span><span class="cx">     result = parseSimpleTransform(propertyID, string);
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserFastPathsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.h (209264 => 209265)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.h        2016-12-02 22:00:57 UTC (rev 209264)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.h        2016-12-02 22:07:08 UTC (rev 209265)
</span><span class="lines">@@ -37,16 +37,17 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class CSSValue;
</span><ins>+class StyleSheetContents;
</ins><span class="cx"> 
</span><span class="cx"> class CSSParserFastPaths {
</span><span class="cx"> public:
</span><span class="cx">     // Parses simple values like '10px' or 'green', but makes no guarantees
</span><span class="cx">     // about handling any property completely.
</span><del>-    static RefPtr&lt;CSSValue&gt; maybeParseValue(CSSPropertyID, const String&amp;, CSSParserMode);
</del><ins>+    static RefPtr&lt;CSSValue&gt; maybeParseValue(CSSPropertyID, const String&amp;, CSSParserMode, StyleSheetContents*);
</ins><span class="cx"> 
</span><span class="cx">     // Properties handled here shouldn't be explicitly handled in CSSPropertyParser
</span><span class="cx">     static bool isKeywordPropertyID(CSSPropertyID);
</span><del>-    static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID, CSSParserMode);
</del><ins>+    static bool isValidKeywordPropertyAndValue(CSSPropertyID, CSSValueID, CSSParserMode, StyleSheetContents*);
</ins><span class="cx"> 
</span><span class="cx">     static RefPtr&lt;CSSValue&gt; parseColor(const String&amp;, CSSParserMode);
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSParserImplcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.cpp (209264 => 209265)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSParserImpl.cpp        2016-12-02 22:00:57 UTC (rev 209264)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.cpp        2016-12-02 22:07:08 UTC (rev 209265)
</span><span class="lines">@@ -799,7 +799,7 @@
</span><span class="cx"> 
</span><span class="cx"> void CSSParserImpl::consumeDeclarationValue(CSSParserTokenRange range, CSSPropertyID propertyID, bool important, StyleRule::Type ruleType)
</span><span class="cx"> {
</span><del>-    CSSPropertyParser::parseValue(propertyID, important, range, m_context, m_parsedProperties, ruleType);
</del><ins>+    CSSPropertyParser::parseValue(propertyID, important, range, m_context, m_styleSheet.get(), m_parsedProperties, ruleType);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> std::unique_ptr&lt;Vector&lt;double&gt;&gt; CSSParserImpl::consumeKeyframeKeyList(CSSParserTokenRange range)
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (209264 => 209265)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2016-12-02 22:00:57 UTC (rev 209264)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2016-12-02 22:07:08 UTC (rev 209265)
</span><span class="lines">@@ -208,10 +208,10 @@
</span><span class="cx">     
</span><span class="cx"> using namespace CSSPropertyParserHelpers;
</span><span class="cx"> 
</span><del>-CSSPropertyParser::CSSPropertyParser(const CSSParserTokenRange&amp; range,
-    const CSSParserContext&amp; context, Vector&lt;CSSProperty, 256&gt;* parsedProperties)
</del><ins>+CSSPropertyParser::CSSPropertyParser(const CSSParserTokenRange&amp; range, const CSSParserContext&amp; context, StyleSheetContents* styleSheetContents, Vector&lt;CSSProperty, 256&gt;* parsedProperties)
</ins><span class="cx">     : m_range(range)
</span><span class="cx">     , m_context(context)
</span><ins>+    , m_styleSheetContents(styleSheetContents)
</ins><span class="cx">     , m_parsedProperties(parsedProperties)
</span><span class="cx"> {
</span><span class="cx">     m_range.consumeWhitespace();
</span><span class="lines">@@ -242,13 +242,11 @@
</span><span class="cx">         addProperty(longhands[i], property, value.copyRef(), important);
</span><span class="cx"> }
</span><span class="cx">     
</span><del>-bool CSSPropertyParser::parseValue(CSSPropertyID propertyID, bool important,
-    const CSSParserTokenRange&amp; range, const CSSParserContext&amp; context,
-    ParsedPropertyVector&amp; parsedProperties, StyleRule::Type ruleType)
</del><ins>+bool CSSPropertyParser::parseValue(CSSPropertyID propertyID, bool important, const CSSParserTokenRange&amp; range, const CSSParserContext&amp; context, StyleSheetContents* styleSheetContents, ParsedPropertyVector&amp; parsedProperties, StyleRule::Type ruleType)
</ins><span class="cx"> {
</span><span class="cx">     int parsedPropertiesSize = parsedProperties.size();
</span><span class="cx"> 
</span><del>-    CSSPropertyParser parser(range, context, &amp;parsedProperties);
</del><ins>+    CSSPropertyParser parser(range, context, styleSheetContents, &amp;parsedProperties);
</ins><span class="cx">     bool parseSuccess;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_DEVICE_ADAPTATION)
</span><span class="lines">@@ -267,9 +265,9 @@
</span><span class="cx">     return parseSuccess;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSValue&gt; CSSPropertyParser::parseSingleValue(CSSPropertyID property, const CSSParserTokenRange&amp; range, const CSSParserContext&amp; context)
</del><ins>+RefPtr&lt;CSSValue&gt; CSSPropertyParser::parseSingleValue(CSSPropertyID property, const CSSParserTokenRange&amp; range, const CSSParserContext&amp; context, StyleSheetContents* styleSheetContents)
</ins><span class="cx"> {
</span><del>-    CSSPropertyParser parser(range, context, nullptr);
</del><ins>+    CSSPropertyParser parser(range, context, styleSheetContents, nullptr);
</ins><span class="cx">     RefPtr&lt;CSSValue&gt; value = parser.parseSingleValue(property);
</span><span class="cx">     if (!value || !parser.m_range.atEnd())
</span><span class="cx">         return nullptr;
</span><span class="lines">@@ -3597,7 +3595,7 @@
</span><span class="cx"> RefPtr&lt;CSSValue&gt; CSSPropertyParser::parseSingleValue(CSSPropertyID property, CSSPropertyID currentShorthand)
</span><span class="cx"> {
</span><span class="cx">     if (CSSParserFastPaths::isKeywordPropertyID(property)) {
</span><del>-        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context.mode))
</del><ins>+        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(property, m_range.peek().id(), m_context.mode, m_styleSheetContents))
</ins><span class="cx">             return nullptr;
</span><span class="cx">         return consumeIdent(m_range);
</span><span class="cx">     }
</span><span class="lines">@@ -4135,7 +4133,7 @@
</span><span class="cx">     case CSSPropertyFontStretch:
</span><span class="cx">     case CSSPropertyFontStyle: {
</span><span class="cx">         CSSValueID id = m_range.consumeIncludingWhitespace().id();
</span><del>-        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id, m_context.mode))
</del><ins>+        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(propId, id, m_context.mode, m_styleSheetContents))
</ins><span class="cx">             return false;
</span><span class="cx">         parsedValue = CSSValuePool::singleton().createIdentifierValue(id);
</span><span class="cx">         break;
</span><span class="lines">@@ -4219,7 +4217,7 @@
</span><span class="cx">     // FIXME-NEWPARSER: Implement. RefPtr&lt;CSSPrimitiveValue&gt; fontStretch;
</span><span class="cx">     while (!m_range.atEnd()) {
</span><span class="cx">         CSSValueID id = m_range.peek().id();
</span><del>-        if (!fontStyle &amp;&amp; CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStyle, id, m_context.mode)) {
</del><ins>+        if (!fontStyle &amp;&amp; CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStyle, id, m_context.mode, m_styleSheetContents)) {
</ins><span class="cx">             fontStyle = consumeIdent(m_range);
</span><span class="cx">             continue;
</span><span class="cx">         }
</span><span class="lines">@@ -4236,7 +4234,7 @@
</span><span class="cx">                 continue;
</span><span class="cx">         }
</span><span class="cx">         /* FIXME-NEWPARSER: Implement
</span><del>-         if (!fontStretch &amp;&amp; CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStretch, id, m_context.mode))
</del><ins>+         if (!fontStretch &amp;&amp; CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyFontStretch, id, m_context.mode, m_styleSheetContents))
</ins><span class="cx">             fontStretch = consumeIdent(m_range);
</span><span class="cx">         else*/
</span><span class="cx">         break;
</span><span class="lines">@@ -5226,7 +5224,7 @@
</span><span class="cx">     switch (property) {
</span><span class="cx">     case CSSPropertyWebkitMarginCollapse: {
</span><span class="cx">         CSSValueID id = m_range.consumeIncludingWhitespace().id();
</span><del>-        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id, m_context.mode))
</del><ins>+        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginBeforeCollapse, id, m_context.mode, m_styleSheetContents))
</ins><span class="cx">             return false;
</span><span class="cx">         addProperty(CSSPropertyWebkitMarginBeforeCollapse, CSSPropertyWebkitMarginCollapse, CSSValuePool::singleton().createIdentifierValue(id), important);
</span><span class="cx">         if (m_range.atEnd()) {
</span><span class="lines">@@ -5234,7 +5232,7 @@
</span><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="cx">         id = m_range.consumeIncludingWhitespace().id();
</span><del>-        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginAfterCollapse, id, m_context.mode))
</del><ins>+        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyWebkitMarginAfterCollapse, id, m_context.mode, m_styleSheetContents))
</ins><span class="cx">             return false;
</span><span class="cx">         addProperty(CSSPropertyWebkitMarginAfterCollapse, CSSPropertyWebkitMarginCollapse, CSSValuePool::singleton().createIdentifierValue(id), important);
</span><span class="cx">         return true;
</span><span class="lines">@@ -5241,7 +5239,7 @@
</span><span class="cx">     }
</span><span class="cx">     case CSSPropertyOverflow: {
</span><span class="cx">         CSSValueID id = m_range.consumeIncludingWhitespace().id();
</span><del>-        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyOverflowY, id, m_context.mode))
</del><ins>+        if (!CSSParserFastPaths::isValidKeywordPropertyAndValue(CSSPropertyOverflowY, id, m_context.mode, m_styleSheetContents))
</ins><span class="cx">             return false;
</span><span class="cx">         if (!m_range.atEnd())
</span><span class="cx">             return false;
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.h (209264 => 209265)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.h        2016-12-02 22:00:57 UTC (rev 209264)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.h        2016-12-02 22:07:08 UTC (rev 209265)
</span><span class="lines">@@ -31,7 +31,8 @@
</span><span class="cx"> class CSSProperty;
</span><span class="cx"> class CSSValue;
</span><span class="cx"> class StylePropertyShorthand;
</span><del>-
</del><ins>+class StyleSheetContents;
+    
</ins><span class="cx"> // Inputs: PropertyID, isImportant bool, CSSParserTokenRange.
</span><span class="cx"> // Outputs: Vector of CSSProperties
</span><span class="cx"> 
</span><span class="lines">@@ -39,15 +40,14 @@
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(CSSPropertyParser);
</span><span class="cx"> public:
</span><span class="cx">     static bool parseValue(CSSPropertyID, bool important,
</span><del>-        const CSSParserTokenRange&amp;, const CSSParserContext&amp;,
</del><ins>+        const CSSParserTokenRange&amp;, const CSSParserContext&amp;, StyleSheetContents*,
</ins><span class="cx">         Vector&lt;CSSProperty, 256&gt;&amp;, StyleRule::Type);
</span><span class="cx"> 
</span><span class="cx">     // Parses a non-shorthand CSS property
</span><del>-    static RefPtr&lt;CSSValue&gt; parseSingleValue(CSSPropertyID, const CSSParserTokenRange&amp;, const CSSParserContext&amp;);
</del><ins>+    static RefPtr&lt;CSSValue&gt; parseSingleValue(CSSPropertyID, const CSSParserTokenRange&amp;, const CSSParserContext&amp;, StyleSheetContents*);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><del>-    CSSPropertyParser(const CSSParserTokenRange&amp;, const CSSParserContext&amp;,
-        Vector&lt;CSSProperty, 256&gt;*);
</del><ins>+    CSSPropertyParser(const CSSParserTokenRange&amp;, const CSSParserContext&amp;, StyleSheetContents*, Vector&lt;CSSProperty, 256&gt;*);
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: Rename once the CSSParserValue-based parseValue is removed
</span><span class="cx">     bool parseValueStart(CSSPropertyID, bool important);
</span><span class="lines">@@ -100,6 +100,8 @@
</span><span class="cx">     // Inputs:
</span><span class="cx">     CSSParserTokenRange m_range;
</span><span class="cx">     const CSSParserContext&amp; m_context;
</span><ins>+    StyleSheetContents* m_styleSheetContents;
+
</ins><span class="cx">     // Outputs:
</span><span class="cx">     Vector&lt;CSSProperty, 256&gt;* m_parsedProperties;
</span><span class="cx"> };
</span></span></pre>
</div>
</div>

</body>
</html>