<!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>[208700] 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/208700">208700</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2016-11-14 11:57:03 -0800 (Mon, 14 Nov 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Handle filter() image type in new CSS Parser
https://bugs.webkit.org/show_bug.cgi?id=164673
&lt;rdar://problems/29231376&gt;

Reviewed by Darin Adler.

Source/WebCore:

Add support for the &lt;image&gt; type filter() to the
new CSS Parser. This involved moving some functions
from CSSPropertyParser into CSSPropertyParserHelpers.

Covered by fast/filter-image tests.

* css/CSSValueKeywords.in:
* css/parser/CSSPropertyParser.cpp:
(WebCore::consumeShadow):
(WebCore::parseSingleShadow): Deleted.
(WebCore::consumeFilterFunction): Deleted.
(WebCore::consumeFilter): Deleted.
* css/parser/CSSPropertyParserHelpers.cpp:
(WebCore::CSSPropertyParserHelpers::consumeFilterImage):
(WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
(WebCore::CSSPropertyParserHelpers::isGeneratedImage):
(WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
(WebCore::CSSPropertyParserHelpers::consumeFilter):
(WebCore::CSSPropertyParserHelpers::consumeSingleShadow):
* css/parser/CSSPropertyParserHelpers.h:

LayoutTests:

Remove the test that allows a string value for the
image source rather than a url().

* fast/filter-image/filter-image-animation-expected.txt:
* fast/filter-image/filter-image-animation.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastfilterimagefilterimageanimationexpectedtxt">trunk/LayoutTests/fast/filter-image/filter-image-animation-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastfilterimagefilterimageanimationhtml">trunk/LayoutTests/fast/filter-image/filter-image-animation.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueKeywordsin">trunk/Source/WebCore/css/CSSValueKeywords.in</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParsercpp">trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParserHelperscpp">trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp</a></li>
<li><a href="#trunkSourceWebCorecssparserCSSPropertyParserHelpersh">trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (208699 => 208700)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-11-14 19:42:41 UTC (rev 208699)
+++ trunk/LayoutTests/ChangeLog        2016-11-14 19:57:03 UTC (rev 208700)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2016-11-14  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Handle filter() image type in new CSS Parser
+        https://bugs.webkit.org/show_bug.cgi?id=164673
+        &lt;rdar://problems/29231376&gt;
+
+        Reviewed by Darin Adler.
+
+        Remove the test that allows a string value for the
+        image source rather than a url().
+
+        * fast/filter-image/filter-image-animation-expected.txt:
+        * fast/filter-image/filter-image-animation.html:
+
</ins><span class="cx"> 2016-11-14  Joanmarie Diggs  &lt;jdiggs@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: In ARIA 1.1, the implicit value for aria-level on headings is 2
</span></span></pre></div>
<a id="trunkLayoutTestsfastfilterimagefilterimageanimationexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/filter-image/filter-image-animation-expected.txt (208699 => 208700)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/filter-image/filter-image-animation-expected.txt        2016-11-14 19:42:41 UTC (rev 208699)
+++ trunk/LayoutTests/fast/filter-image/filter-image-animation-expected.txt        2016-11-14 19:57:03 UTC (rev 208700)
</span><span class="lines">@@ -1,10 +1,9 @@
</span><del>-            
</del><ins>+           
</ins><span class="cx"> PASS - &quot;backgroundImage&quot; property for &quot;brightness&quot; element at 1s saw something close to: filter(url(image.svg), brightness(0.5))
</span><span class="cx"> PASS - &quot;backgroundImage&quot; property for &quot;blur&quot; element at 1s saw something close to: filter(url(image.svg), blur(5px))
</span><span class="cx"> PASS - &quot;backgroundImage&quot; property for &quot;grayscale&quot; element at 1s saw something close to: filter(url(image.svg), grayscale(0.5))
</span><span class="cx"> PASS - &quot;backgroundImage&quot; property for &quot;sepia&quot; element at 1s saw something close to: filter(url(image.svg), sepia(0.5))
</span><span class="cx"> PASS - &quot;backgroundImage&quot; property for &quot;no&quot; element at 1s saw something close to: filter(url(blue.svg), sepia(0))
</span><del>-PASS - &quot;backgroundImage&quot; property for &quot;string&quot; element at 1s saw something close to: filter(url(image.svg), sepia(0.5))
</del><span class="cx"> PASS - &quot;backgroundImage&quot; property for &quot;multiple1&quot; element at 1s saw something close to: filter(url(image.svg), sepia(0.5) blur(1.5px) hue-rotate(22.5deg))
</span><span class="cx"> PASS - &quot;backgroundImage&quot; property for &quot;multiple2&quot; element at 1s saw something close to: filter(url(image.svg), contrast(0.5) blur(1.5px) hue-rotate(22.5deg))
</span><span class="cx"> PASS - &quot;backgroundImage&quot; property for &quot;urlfilter&quot; element at 1s saw something close to: filter(url(image.svg), sepia(0.25))
</span></span></pre></div>
<a id="trunkLayoutTestsfastfilterimagefilterimageanimationhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/filter-image/filter-image-animation.html (208699 => 208700)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/filter-image/filter-image-animation.html        2016-11-14 19:42:41 UTC (rev 208699)
+++ trunk/LayoutTests/fast/filter-image/filter-image-animation.html        2016-11-14 19:57:03 UTC (rev 208700)
</span><span class="lines">@@ -31,10 +31,6 @@
</span><span class="cx">       -webkit-animation: no-anim 2s linear;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    #string {
-      -webkit-animation: string-anim 2s linear;
-    }
-
</del><span class="cx">     #multiple1 {
</span><span class="cx">       -webkit-animation: multiple-anim1 2s linear;
</span><span class="cx">     }
</span><span class="lines">@@ -88,11 +84,6 @@
</span><span class="cx">         to   { background-image: filter(url(resources/blue.svg), sepia(0)); }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    @-webkit-keyframes string-anim {
-        from { background-image: filter('resources/image.svg', sepia(1)); }
-        to   { background-image: filter(url(resources/image.svg), sepia(0)); }
-    }
-
</del><span class="cx">     @-webkit-keyframes multiple-anim1 {
</span><span class="cx">         from { background-image: filter(url(resources/image.svg), sepia(0.25) blur(3px) hue-rotate(45deg)); }
</span><span class="cx">         to   { background-image: filter(url(resources/image.svg), sepia(0.75)); }
</span><span class="lines">@@ -137,7 +128,6 @@
</span><span class="cx">       [&quot;grayscale-anim&quot;,  1, &quot;grayscale&quot;, &quot;backgroundImage&quot;, &quot;filter(url(image.svg), grayscale(0.5))&quot;, 0.05],
</span><span class="cx">       [&quot;sepia-anim&quot;,  1, &quot;sepia&quot;, &quot;backgroundImage&quot;, &quot;filter(url(image.svg), sepia(0.5))&quot;, 0.05],
</span><span class="cx">       [&quot;no-anim&quot;,  1, &quot;no&quot;, &quot;backgroundImage&quot;, &quot;filter(url(blue.svg), sepia(0))&quot;, 0],
</span><del>-      [&quot;string-anim&quot;,  1, &quot;string&quot;, &quot;backgroundImage&quot;, &quot;filter(url(image.svg), sepia(0.5))&quot;, 0],
</del><span class="cx">       [&quot;multiple-anim1&quot;,  1, &quot;multiple1&quot;, &quot;backgroundImage&quot;, &quot;filter(url(image.svg), sepia(0.5) blur(1.5px) hue-rotate(22.5deg))&quot;, 0.05],
</span><span class="cx">       [&quot;multiple-anim2&quot;,  1, &quot;multiple2&quot;, &quot;backgroundImage&quot;, &quot;filter(url(image.svg), contrast(0.5) blur(1.5px) hue-rotate(22.5deg))&quot;, 0.05],
</span><span class="cx">       [&quot;url-to-filter-anim&quot;,  1, &quot;urlfilter&quot;, &quot;backgroundImage&quot;, &quot; filter(url(image.svg), sepia(0.25))&quot;, 0.05],
</span><span class="lines">@@ -158,7 +148,6 @@
</span><span class="cx"> &lt;div class=&quot;box&quot; id=&quot;grayscale&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div class=&quot;box&quot; id=&quot;sepia&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div class=&quot;box&quot; id=&quot;no&quot;&gt;&lt;/div&gt;
</span><del>-&lt;div class=&quot;box&quot; id=&quot;string&quot;&gt;&lt;/div&gt;
</del><span class="cx"> &lt;div class=&quot;box&quot; id=&quot;multiple1&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div class=&quot;box&quot; id=&quot;multiple2&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;div class=&quot;box&quot; id=&quot;urlfilter&quot;&gt;&lt;/div&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (208699 => 208700)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-11-14 19:42:41 UTC (rev 208699)
+++ trunk/Source/WebCore/ChangeLog        2016-11-14 19:57:03 UTC (rev 208700)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-11-14  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Handle filter() image type in new CSS Parser
+        https://bugs.webkit.org/show_bug.cgi?id=164673
+        &lt;rdar://problems/29231376&gt;
+
+        Reviewed by Darin Adler.
+
+        Add support for the &lt;image&gt; type filter() to the
+        new CSS Parser. This involved moving some functions
+        from CSSPropertyParser into CSSPropertyParserHelpers.
+
+        Covered by fast/filter-image tests.
+
+        * css/CSSValueKeywords.in:
+        * css/parser/CSSPropertyParser.cpp:
+        (WebCore::consumeShadow):
+        (WebCore::parseSingleShadow): Deleted.
+        (WebCore::consumeFilterFunction): Deleted.
+        (WebCore::consumeFilter): Deleted.
+        * css/parser/CSSPropertyParserHelpers.cpp:
+        (WebCore::CSSPropertyParserHelpers::consumeFilterImage):
+        (WebCore::CSSPropertyParserHelpers::consumeGeneratedImage):
+        (WebCore::CSSPropertyParserHelpers::isGeneratedImage):
+        (WebCore::CSSPropertyParserHelpers::consumeFilterFunction):
+        (WebCore::CSSPropertyParserHelpers::consumeFilter):
+        (WebCore::CSSPropertyParserHelpers::consumeSingleShadow):
+        * css/parser/CSSPropertyParserHelpers.h:
+
</ins><span class="cx"> 2016-11-14  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [CSS Parser] Support percentages in word-spacing
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (208699 => 208700)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueKeywords.in        2016-11-14 19:42:41 UTC (rev 208699)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in        2016-11-14 19:57:03 UTC (rev 208700)
</span><span class="lines">@@ -1165,6 +1165,8 @@
</span><span class="cx"> -webkit-repeating-radial-gradient
</span><span class="cx"> -webkit-image-set
</span><span class="cx"> -webkit-named-image
</span><ins>+filter
+-webkit-filter
</ins><span class="cx"> 
</span><span class="cx"> // deprecated gradients
</span><span class="cx"> from
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp (208699 => 208700)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2016-11-14 19:42:41 UTC (rev 208699)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParser.cpp        2016-11-14 19:57:03 UTC (rev 208700)
</span><span class="lines">@@ -1353,52 +1353,6 @@
</span><span class="cx">     return consumeInteger(range);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RefPtr&lt;CSSShadowValue&gt; parseSingleShadow(CSSParserTokenRange&amp; range, CSSParserMode cssParserMode, bool allowInset, bool allowSpread)
-{
-    RefPtr&lt;CSSPrimitiveValue&gt; style;
-    RefPtr&lt;CSSPrimitiveValue&gt; color;
-
-    if (range.atEnd())
-        return nullptr;
-    if (range.peek().id() == CSSValueInset) {
-        if (!allowInset)
-            return nullptr;
-        style = consumeIdent(range);
-    }
-    color = consumeColor(range, cssParserMode);
-
-    RefPtr&lt;CSSPrimitiveValue&gt; horizontalOffset = consumeLength(range, cssParserMode, ValueRangeAll);
-    if (!horizontalOffset)
-        return nullptr;
-
-    RefPtr&lt;CSSPrimitiveValue&gt; verticalOffset = consumeLength(range, cssParserMode, ValueRangeAll);
-    if (!verticalOffset)
-        return nullptr;
-
-    RefPtr&lt;CSSPrimitiveValue&gt; blurRadius = consumeLength(range, cssParserMode, ValueRangeAll);
-    RefPtr&lt;CSSPrimitiveValue&gt; spreadDistance;
-    if (blurRadius) {
-        // Blur radius must be non-negative.
-        if (blurRadius-&gt;doubleValue() &lt; 0)
-            return nullptr;
-        if (allowSpread)
-            spreadDistance = consumeLength(range, cssParserMode, ValueRangeAll);
-    }
-
-    if (!range.atEnd()) {
-        if (!color)
-            color = consumeColor(range, cssParserMode);
-        if (range.peek().id() == CSSValueInset) {
-            if (!allowInset || style)
-                return nullptr;
-            style = consumeIdent(range);
-        }
-    }
-    
-    // We pass RefPtrs, since they can actually be null.
-    return CSSShadowValue::create(WTFMove(horizontalOffset), WTFMove(verticalOffset), WTFMove(blurRadius), WTFMove(spreadDistance), WTFMove(style), WTFMove(color));
-}
-
</del><span class="cx"> static RefPtr&lt;CSSValue&gt; consumeShadow(CSSParserTokenRange&amp; range, CSSParserMode cssParserMode, bool isBoxShadowProperty)
</span><span class="cx"> {
</span><span class="cx">     if (range.peek().id() == CSSValueNone)
</span><span class="lines">@@ -1406,7 +1360,7 @@
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSValueList&gt; shadowValueList = CSSValueList::createCommaSeparated();
</span><span class="cx">     do {
</span><del>-        if (RefPtr&lt;CSSShadowValue&gt; shadowValue = parseSingleShadow(range, cssParserMode, isBoxShadowProperty, isBoxShadowProperty))
</del><ins>+        if (RefPtr&lt;CSSShadowValue&gt; shadowValue = consumeSingleShadow(range, cssParserMode, isBoxShadowProperty, isBoxShadowProperty))
</ins><span class="cx">             shadowValueList-&gt;append(*shadowValue);
</span><span class="cx">         else
</span><span class="cx">             return nullptr;
</span><span class="lines">@@ -1414,67 +1368,6 @@
</span><span class="cx">     return shadowValueList;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static RefPtr&lt;CSSFunctionValue&gt; consumeFilterFunction(CSSParserTokenRange&amp; range, const CSSParserContext&amp; context)
-{
-    CSSValueID filterType = range.peek().functionId();
-    if (filterType &lt; CSSValueInvert || filterType &gt; CSSValueDropShadow)
-        return nullptr;
-    CSSParserTokenRange args = consumeFunction(range);
-    RefPtr&lt;CSSFunctionValue&gt; filterValue = CSSFunctionValue::create(filterType);
-    RefPtr&lt;CSSValue&gt; parsedValue;
-
-    if (filterType == CSSValueDropShadow)
-        parsedValue = parseSingleShadow(args, context.mode, false, false);
-    else {
-        if (args.atEnd())
-            return filterValue;
-        if (filterType == CSSValueBrightness) {
-            // FIXME (crbug.com/397061): Support calc expressions like calc(10% + 0.5)
-            parsedValue = consumePercent(args, ValueRangeAll);
-            if (!parsedValue)
-                parsedValue = consumeNumber(args, ValueRangeAll);
-        } else if (filterType == CSSValueHueRotate)
-            parsedValue = consumeAngle(args, context.mode, UnitlessQuirk::Forbid);
-        else if (filterType == CSSValueBlur) {
-            parsedValue = consumeLength(args, HTMLStandardMode, ValueRangeNonNegative);
-        } else {
-            // FIXME (crbug.com/397061): Support calc expressions like calc(10% + 0.5)
-            parsedValue = consumePercent(args, ValueRangeNonNegative);
-            if (!parsedValue)
-                parsedValue = consumeNumber(args, ValueRangeNonNegative);
-            if (parsedValue &amp;&amp; filterType != CSSValueSaturate &amp;&amp; filterType != CSSValueContrast) {
-                bool isPercentage = downcast&lt;CSSPrimitiveValue&gt;(*parsedValue).isPercentage();
-                double maxAllowed = isPercentage ? 100.0 : 1.0;
-                if (downcast&lt;CSSPrimitiveValue&gt;(*parsedValue).doubleValue() &gt; maxAllowed) {
-                    parsedValue = CSSPrimitiveValue::create(maxAllowed, isPercentage ? CSSPrimitiveValue::UnitTypes::CSS_PERCENTAGE : CSSPrimitiveValue::UnitTypes::CSS_NUMBER);
-                }
-            }
-        }
-    }
-    if (!parsedValue || !args.atEnd())
-        return nullptr;
-    filterValue-&gt;append(*parsedValue);
-    return filterValue;
-}
-
-static RefPtr&lt;CSSValue&gt; consumeFilter(CSSParserTokenRange&amp; range, const CSSParserContext&amp; context)
-{
-    if (range.peek().id() == CSSValueNone)
-        return consumeIdent(range);
-
-    RefPtr&lt;CSSValueList&gt; list = CSSValueList::createSpaceSeparated();
-    do {
-        RefPtr&lt;CSSValue&gt; filterValue = consumeUrl(range);
-        if (!filterValue) {
-            filterValue = consumeFilterFunction(range, context);
-            if (!filterValue)
-                return nullptr;
-        }
-        list-&gt;append(filterValue.releaseNonNull());
-    } while (!range.atEnd());
-    return list;
-}
-
</del><span class="cx"> static RefPtr&lt;CSSValue&gt; consumeTextDecorationLine(CSSParserTokenRange&amp; range)
</span><span class="cx"> {
</span><span class="cx">     CSSValueID id = range.peek().id();
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParserHelperscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp (208699 => 208700)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp        2016-11-14 19:42:41 UTC (rev 208699)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.cpp        2016-11-14 19:57:03 UTC (rev 208700)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> #include &quot;CSSCalculationValue.h&quot;
</span><span class="cx"> #include &quot;CSSCanvasValue.h&quot;
</span><span class="cx"> #include &quot;CSSCrossfadeValue.h&quot;
</span><ins>+#include &quot;CSSFilterImageValue.h&quot;
</ins><span class="cx"> #include &quot;CSSGradientValue.h&quot;
</span><span class="cx"> #include &quot;CSSImageSetValue.h&quot;
</span><span class="cx"> #include &quot;CSSImageValue.h&quot;
</span><span class="lines">@@ -1086,7 +1087,24 @@
</span><span class="cx">         return nullptr;
</span><span class="cx">     return CSSNamedImageValue::create(imageName);
</span><span class="cx"> }
</span><del>-    
</del><ins>+
+static RefPtr&lt;CSSValue&gt; consumeFilterImage(CSSParserTokenRange&amp; args, const CSSParserContext&amp; context)
+{
+    auto imageValue = consumeImageOrNone(args, context);
+    if (!imageValue || !consumeCommaIncludingWhitespace(args))
+        return nullptr;
+
+    auto filterValue = consumeFilter(args, context);
+
+    if (!filterValue)
+        return nullptr;
+
+    if (!args.atEnd())
+        return nullptr;
+
+    return CSSFilterImageValue::create(imageValue.releaseNonNull(), filterValue.releaseNonNull());
+}
+
</ins><span class="cx"> static RefPtr&lt;CSSValue&gt; consumeGeneratedImage(CSSParserTokenRange&amp; range, CSSParserContext context)
</span><span class="cx"> {
</span><span class="cx">     CSSValueID id = range.peek().functionId();
</span><span class="lines">@@ -1117,7 +1135,8 @@
</span><span class="cx">         result = consumeWebkitCanvas(args);
</span><span class="cx">     else if (id == CSSValueWebkitNamedImage)
</span><span class="cx">         result = consumeWebkitNamedImage(args);
</span><del>-
</del><ins>+    else if (id == CSSValueWebkitFilter || id == CSSValueFilter)
+        result = consumeFilterImage(args, context);
</ins><span class="cx">     if (!result || !args.atEnd())
</span><span class="cx">         return nullptr;
</span><span class="cx">     range = rangeCopy;
</span><span class="lines">@@ -1161,9 +1180,113 @@
</span><span class="cx">         || id == CSSValueWebkitLinearGradient || id == CSSValueWebkitRadialGradient
</span><span class="cx">         || id == CSSValueWebkitRepeatingLinearGradient || id == CSSValueWebkitRepeatingRadialGradient
</span><span class="cx">         || id == CSSValueWebkitGradient || id == CSSValueWebkitCrossFade || id == CSSValueWebkitCanvas
</span><del>-        || id == CSSValueCrossFade || id == CSSValueWebkitNamedImage;
</del><ins>+        || id == CSSValueCrossFade || id == CSSValueWebkitNamedImage || id == CSSValueWebkitFilter || id == CSSValueFilter;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><ins>+RefPtr&lt;CSSFunctionValue&gt; consumeFilterFunction(CSSParserTokenRange&amp; range, const CSSParserContext&amp; context)
+{
+    CSSValueID filterType = range.peek().functionId();
+    if (filterType &lt; CSSValueInvert || filterType &gt; CSSValueDropShadow)
+        return nullptr;
+    CSSParserTokenRange args = consumeFunction(range);
+    auto filterValue = CSSFunctionValue::create(filterType);
+    RefPtr&lt;CSSValue&gt; parsedValue;
+
+    if (filterType == CSSValueDropShadow)
+        parsedValue = consumeSingleShadow(args, context.mode, false, false);
+    else {
+        if (args.atEnd())
+            return filterValue.ptr();
+        if (filterType == CSSValueBrightness) {
+            parsedValue = consumePercent(args, ValueRangeAll);
+            if (!parsedValue)
+                parsedValue = consumeNumber(args, ValueRangeAll);
+        } else if (filterType == CSSValueHueRotate)
+            parsedValue = consumeAngle(args, context.mode, UnitlessQuirk::Forbid);
+        else if (filterType == CSSValueBlur)
+            parsedValue = consumeLength(args, HTMLStandardMode, ValueRangeNonNegative);
+        else {
+            parsedValue = consumePercent(args, ValueRangeNonNegative);
+            if (!parsedValue)
+                parsedValue = consumeNumber(args, ValueRangeNonNegative);
+            if (parsedValue &amp;&amp; filterType != CSSValueSaturate &amp;&amp; filterType != CSSValueContrast) {
+                bool isPercentage = downcast&lt;CSSPrimitiveValue&gt;(*parsedValue).isPercentage();
+                double maxAllowed = isPercentage ? 100.0 : 1.0;
+                if (downcast&lt;CSSPrimitiveValue&gt;(*parsedValue).doubleValue() &gt; maxAllowed)
+                    parsedValue = CSSPrimitiveValue::create(maxAllowed, isPercentage ? CSSPrimitiveValue::UnitTypes::CSS_PERCENTAGE : CSSPrimitiveValue::UnitTypes::CSS_NUMBER);
+            }
+        }
+    }
+    if (!parsedValue || !args.atEnd())
+        return nullptr;
+    filterValue-&gt;append(*parsedValue);
+    return filterValue.ptr();
+}
+
+RefPtr&lt;CSSValue&gt; consumeFilter(CSSParserTokenRange&amp; range, const CSSParserContext&amp; context)
+{
+    if (range.peek().id() == CSSValueNone)
+        return consumeIdent(range);
+
+    auto list = CSSValueList::createSpaceSeparated();
+    do {
+        RefPtr&lt;CSSValue&gt; filterValue = consumeUrl(range);
+        if (!filterValue) {
+            filterValue = consumeFilterFunction(range, context);
+            if (!filterValue)
+                return nullptr;
+        }
+        list-&gt;append(filterValue.releaseNonNull());
+    } while (!range.atEnd());
+
+    return list.ptr();
+}
+
+RefPtr&lt;CSSShadowValue&gt; consumeSingleShadow(CSSParserTokenRange&amp; range, CSSParserMode cssParserMode, bool allowInset, bool allowSpread)
+{
+    RefPtr&lt;CSSPrimitiveValue&gt; style;
+    RefPtr&lt;CSSPrimitiveValue&gt; color;
+
+    if (range.atEnd())
+        return nullptr;
+    if (range.peek().id() == CSSValueInset) {
+        if (!allowInset)
+            return nullptr;
+        style = consumeIdent(range);
+    }
+    color = consumeColor(range, cssParserMode);
+
+    auto horizontalOffset = consumeLength(range, cssParserMode, ValueRangeAll);
+    if (!horizontalOffset)
+        return nullptr;
+
+    auto verticalOffset = consumeLength(range, cssParserMode, ValueRangeAll);
+    if (!verticalOffset)
+        return nullptr;
+
+    auto blurRadius = consumeLength(range, cssParserMode, ValueRangeAll);
+    RefPtr&lt;CSSPrimitiveValue&gt; spreadDistance;
+    if (blurRadius) {
+        // Blur radius must be non-negative.
+        if (blurRadius-&gt;doubleValue() &lt; 0)
+            return nullptr;
+        if (allowSpread)
+            spreadDistance = consumeLength(range, cssParserMode, ValueRangeAll);
+    }
+
+    if (!range.atEnd()) {
+        if (!color)
+            color = consumeColor(range, cssParserMode);
+        if (range.peek().id() == CSSValueInset) {
+            if (!allowInset || style)
+                return nullptr;
+            style = consumeIdent(range);
+        }
+    }
+
+    return CSSShadowValue::create(WTFMove(horizontalOffset), WTFMove(verticalOffset), WTFMove(blurRadius), WTFMove(spreadDistance), WTFMove(style), WTFMove(color));
+}
+
</ins><span class="cx"> RefPtr&lt;CSSValue&gt; consumeImage(CSSParserTokenRange&amp; range, CSSParserContext context, ConsumeGeneratedImage generatedImage)
</span><span class="cx"> {
</span><span class="cx">     AtomicString uri = consumeUrlAsStringView(range).toAtomicString();
</span></span></pre></div>
<a id="trunkSourceWebCorecssparserCSSPropertyParserHelpersh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h (208699 => 208700)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h        2016-11-14 19:42:41 UTC (rev 208699)
+++ trunk/Source/WebCore/css/parser/CSSPropertyParserHelpers.h        2016-11-14 19:57:03 UTC (rev 208700)
</span><span class="lines">@@ -30,9 +30,11 @@
</span><span class="cx"> #pragma once
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSCustomIdentValue.h&quot;
</span><ins>+#include &quot;CSSFunctionValue.h&quot;
</ins><span class="cx"> #include &quot;CSSParserMode.h&quot;
</span><span class="cx"> #include &quot;CSSParserTokenRange.h&quot;
</span><span class="cx"> #include &quot;CSSPrimitiveValue.h&quot;
</span><ins>+#include &quot;CSSShadowValue.h&quot;
</ins><span class="cx"> #include &quot;Length.h&quot; // For ValueRange
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="lines">@@ -88,6 +90,10 @@
</span><span class="cx"> RefPtr&lt;CSSValue&gt; consumeImage(CSSParserTokenRange&amp;, CSSParserContext, ConsumeGeneratedImage = ConsumeGeneratedImage::Allow);
</span><span class="cx"> RefPtr&lt;CSSValue&gt; consumeImageOrNone(CSSParserTokenRange&amp;, CSSParserContext);
</span><span class="cx"> 
</span><ins>+RefPtr&lt;CSSValue&gt; consumeFilter(CSSParserTokenRange&amp;, const CSSParserContext&amp;);
+RefPtr&lt;CSSFunctionValue&gt; consumeFilterFunction(CSSParserTokenRange&amp;, const CSSParserContext&amp;);
+RefPtr&lt;CSSShadowValue&gt; consumeSingleShadow(CSSParserTokenRange&amp;, CSSParserMode, bool allowInset, bool allowSpread);
+
</ins><span class="cx"> // Template implementations are at the bottom of the file for readability.
</span><span class="cx"> 
</span><span class="cx"> template&lt;typename... emptyBaseCase&gt; inline bool identMatches(CSSValueID) { return false; }
</span></span></pre>
</div>
</div>

</body>
</html>