<!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>[178020] 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/178020">178020</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-01-06 22:35:54 -0800 (Tue, 06 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Move 'webkit-mask-image' CSS property to the new StyleBuilder
https://bugs.webkit.org/show_bug.cgi?id=140168

Reviewed by Sam Weinig.

Move 'webkit-mask-image' CSS property to the new StyleBuilder.

* css/CSSPropertyNames.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertMaskImageOperations):
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyInitialWebkitMaskImage):
(WebCore::StyleBuilderCustom::applyInheritWebkitMaskImage):
* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyProperty):
(WebCore::StyleResolver::createMaskImageOperations): Deleted.
* css/StyleResolver.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertyNamesin">trunk/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderConverterh">trunk/Source/WebCore/css/StyleBuilderConverter.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolverh">trunk/Source/WebCore/css/StyleResolver.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (178019 => 178020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-07 03:23:54 UTC (rev 178019)
+++ trunk/Source/WebCore/ChangeLog        2015-01-07 06:35:54 UTC (rev 178020)
</span><span class="lines">@@ -1,5 +1,25 @@
</span><span class="cx"> 2015-01-06  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Move 'webkit-mask-image' CSS property to the new StyleBuilder
+        https://bugs.webkit.org/show_bug.cgi?id=140168
+
+        Reviewed by Sam Weinig.
+
+        Move 'webkit-mask-image' CSS property to the new StyleBuilder.
+
+        * css/CSSPropertyNames.in:
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertMaskImageOperations):
+        * css/StyleBuilderCustom.h:
+        (WebCore::StyleBuilderCustom::applyInitialWebkitMaskImage):
+        (WebCore::StyleBuilderCustom::applyInheritWebkitMaskImage):
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::applyProperty):
+        (WebCore::StyleResolver::createMaskImageOperations): Deleted.
+        * css/StyleResolver.h:
+
+2015-01-06  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Drop ResourceResponseBase::connectionID and connectionReused members
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=140158
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (178019 => 178020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2015-01-07 03:23:54 UTC (rev 178019)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2015-01-07 06:35:54 UTC (rev 178020)
</span><span class="lines">@@ -482,7 +482,7 @@
</span><span class="cx"> -webkit-mask-box-image-width [Custom=All]
</span><span class="cx"> -webkit-mask-clip [FillLayerProperty, TypeName=EFillBox, NameForMethods=Clip]
</span><span class="cx"> -webkit-mask-composite [FillLayerProperty, TypeName=CompositeOperator, NameForMethods=Composite]
</span><del>--webkit-mask-image [LegacyStyleBuilder]
</del><ins>+-webkit-mask-image [Custom=Initial|Inherit, ConditionalConverter=MaskImageOperations, TypeName=Vector&lt;RefPtr&lt;MaskImageOperation&gt;&gt;]
</ins><span class="cx"> -webkit-mask-origin [FillLayerProperty, TypeName=EFillBox, NameForMethods=Origin]
</span><span class="cx"> -webkit-mask-position [LegacyStyleBuilder]
</span><span class="cx"> -webkit-mask-position-x [FillLayerProperty, TypeName=Length, NameForMethods=XPosition]
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (178019 => 178020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderConverter.h        2015-01-07 03:23:54 UTC (rev 178019)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h        2015-01-07 06:35:54 UTC (rev 178020)
</span><span class="lines">@@ -42,10 +42,12 @@
</span><span class="cx"> #include &quot;LengthRepeat.h&quot;
</span><span class="cx"> #include &quot;Pair.h&quot;
</span><span class="cx"> #include &quot;QuotesData.h&quot;
</span><ins>+#include &quot;SVGURIReference.h&quot;
</ins><span class="cx"> #include &quot;Settings.h&quot;
</span><span class="cx"> #include &quot;StyleResolver.h&quot;
</span><span class="cx"> #include &quot;StyleScrollSnapPoints.h&quot;
</span><span class="cx"> #include &quot;TransformFunctions.h&quot;
</span><ins>+#include &quot;WebKitCSSResourceValue.h&quot;
</ins><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="lines">@@ -98,6 +100,7 @@
</span><span class="cx">     static bool convertPerspective(StyleResolver&amp;, CSSValue&amp;, float&amp;);
</span><span class="cx">     static bool convertMarqueeIncrement(StyleResolver&amp;, CSSValue&amp;, Length&amp;);
</span><span class="cx">     static bool convertFilterOperations(StyleResolver&amp;, CSSValue&amp;, FilterOperations&amp;);
</span><ins>+    static bool convertMaskImageOperations(StyleResolver&amp;, CSSValue&amp;, Vector&lt;RefPtr&lt;MaskImageOperation&gt;&gt;&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class StyleBuilderCustom;
</span><span class="lines">@@ -991,6 +994,58 @@
</span><span class="cx">     return styleResolver.createFilterOperations(value, operations);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+inline bool StyleBuilderConverter::convertMaskImageOperations(StyleResolver&amp; styleResolver, CSSValue&amp; value, Vector&lt;RefPtr&lt;MaskImageOperation&gt;&gt;&amp; operations)
+{
+    RefPtr&lt;WebKitCSSResourceValue&gt; maskImageValue;
+    RefPtr&lt;CSSValueList&gt; maskImagesList;
+    CSSValueList::iterator listIterator;
+    if (is&lt;WebKitCSSResourceValue&gt;(value))
+        maskImageValue = &amp;downcast&lt;WebKitCSSResourceValue&gt;(value);
+    else if (is&lt;CSSValueList&gt;(value)) {
+        maskImagesList = &amp;downcast&lt;CSSValueList&gt;(value);
+        listIterator = maskImagesList-&gt;begin();
+        if (listIterator != maskImagesList-&gt;end())
+            maskImageValue = &amp;downcast&lt;WebKitCSSResourceValue&gt;(listIterator-&gt;get());
+    }
+
+    while (maskImageValue.get()) {
+        RefPtr&lt;CSSValue&gt; maskInnerValue = maskImageValue-&gt;innerValue();
+
+        RefPtr&lt;MaskImageOperation&gt; newMaskImage;
+        if (is&lt;CSSPrimitiveValue&gt;(maskInnerValue.get())) {
+            RefPtr&lt;CSSPrimitiveValue&gt; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(maskInnerValue.get());
+            if (primitiveValue-&gt;isValueID() &amp;&amp; primitiveValue-&gt;getValueID() == CSSValueNone)
+                newMaskImage = MaskImageOperation::create();
+            else {
+                String cssUrl = primitiveValue-&gt;getStringValue();
+                URL url = styleResolver.document().completeURL(cssUrl);
+
+                bool isExternalDocument = SVGURIReference::isExternalURIReference(cssUrl, styleResolver.document());
+                newMaskImage = MaskImageOperation::create(maskImageValue, cssUrl, url.fragmentIdentifier(), isExternalDocument, styleResolver.document().cachedResourceLoader());
+                if (isExternalDocument)
+                    styleResolver.state().maskImagesWithPendingSVGDocuments().append(newMaskImage);
+            }
+        } else {
+            if (RefPtr&lt;StyleImage&gt; image = styleResolver.styleImage(CSSPropertyWebkitMaskImage, *maskInnerValue))
+                newMaskImage = MaskImageOperation::create(image);
+        }
+
+        // If we didn't get a valid value, use None so we keep the correct number and order of masks.
+        if (!newMaskImage)
+            newMaskImage = MaskImageOperation::create();
+
+        operations.append(newMaskImage);
+
+        if (maskImagesList) {
+            ++listIterator;
+            maskImageValue = listIterator != maskImagesList-&gt;end() ? &amp;downcast&lt;WebKitCSSResourceValue&gt;(listIterator-&gt;get()) : nullptr;
+        } else
+            maskImageValue = nullptr;
+    }
+
+    return true;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // StyleBuilderConverter_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (178019 => 178020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-01-07 03:23:54 UTC (rev 178019)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-01-07 06:35:54 UTC (rev 178020)
</span><span class="lines">@@ -90,6 +90,10 @@
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(WebkitTextEmphasisStyle);
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(Zoom);
</span><span class="cx"> 
</span><ins>+    // Custom handling of initial + inherit value setting only.
+    static void applyInitialWebkitMaskImage(StyleResolver&amp;) { }
+    static void applyInheritWebkitMaskImage(StyleResolver&amp;) { }
+
</ins><span class="cx">     // Custom handling of inherit + value setting only.
</span><span class="cx">     static void applyInheritDisplay(StyleResolver&amp;);
</span><span class="cx">     static void applyValueDisplay(StyleResolver&amp;, CSSValue&amp;);
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (178019 => 178020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2015-01-07 03:23:54 UTC (rev 178019)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2015-01-07 06:35:54 UTC (rev 178020)
</span><span class="lines">@@ -2308,16 +2308,9 @@
</span><span class="cx">         setFontDescription(fontDescription);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><del>-
-    case CSSPropertyWebkitMaskImage: {
-        Vector&lt;RefPtr&lt;MaskImageOperation&gt;&gt; operations;
-        if (createMaskImageOperations(value, operations))
-            state.style()-&gt;setMaskImage(operations);
-
-        return;
-    }
</del><span class="cx">     
</span><span class="cx">     // These properties are aliased and StyleBuilder already applied the property on the prefixed version.
</span><ins>+    case CSSPropertyWebkitMaskImage:
</ins><span class="cx">     case CSSPropertyAnimationDelay:
</span><span class="cx">     case CSSPropertyAnimationDirection:
</span><span class="cx">     case CSSPropertyAnimationDuration:
</span><span class="lines">@@ -3073,63 +3066,6 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool StyleResolver::createMaskImageOperations(CSSValue* inValue, Vector&lt;RefPtr&lt;MaskImageOperation&gt;&gt;&amp; outOperations)
-{
-    ASSERT(outOperations.isEmpty());
-    if (!inValue)
-        return false;
-
-    RefPtr&lt;WebKitCSSResourceValue&gt; maskImageValue;
-    RefPtr&lt;CSSValueList&gt; maskImagesList;
-    CSSValueList::iterator listIterator;
-    if (is&lt;WebKitCSSResourceValue&gt;(*inValue))
-        maskImageValue = downcast&lt;WebKitCSSResourceValue&gt;(inValue);
-    else if (is&lt;CSSValueList&gt;(*inValue)) {
-        maskImagesList = downcast&lt;CSSValueList&gt;(inValue);
-        listIterator = maskImagesList-&gt;begin();
-        if (listIterator != maskImagesList-&gt;end())
-            maskImageValue = &amp;downcast&lt;WebKitCSSResourceValue&gt;(listIterator-&gt;get());
-    }
-
-    while (maskImageValue.get()) {
-        RefPtr&lt;CSSValue&gt; maskInnerValue = maskImageValue-&gt;innerValue();
-        RefPtr&lt;MaskImageOperation&gt; newMaskImage;
-
-        if (is&lt;CSSPrimitiveValue&gt;(maskInnerValue.get())) {
-            RefPtr&lt;CSSPrimitiveValue&gt; primitiveValue = downcast&lt;CSSPrimitiveValue&gt;(maskInnerValue.get());
-            if (primitiveValue-&gt;isValueID() &amp;&amp; primitiveValue-&gt;getValueID() == CSSValueNone)
-                newMaskImage = MaskImageOperation::create();
-            else {
-                String cssUrl = primitiveValue-&gt;getStringValue();
-                URL url = m_state.document().completeURL(cssUrl);
-                
-                bool isExternalDocument = (SVGURIReference::isExternalURIReference(cssUrl, m_state.document()));
-                newMaskImage = MaskImageOperation::create(maskImageValue, cssUrl, url.fragmentIdentifier(), isExternalDocument, m_state.document().cachedResourceLoader());
-                if (isExternalDocument)
-                    m_state.maskImagesWithPendingSVGDocuments().append(newMaskImage);
-            }
-        } else {
-            RefPtr&lt;StyleImage&gt; image = styleImage(CSSPropertyWebkitMaskImage, *maskInnerValue);
-            if (image.get())
-                newMaskImage = MaskImageOperation::create(image);
-        }
-
-        // If we didn't get a valid value, use None so we keep the correct number and order of masks.
-        if (!newMaskImage.get())
-            newMaskImage = MaskImageOperation::create();
-
-        outOperations.append(newMaskImage);
-
-        if (maskImagesList.get()) {
-            listIterator++;
-            maskImageValue = (listIterator != maskImagesList-&gt;end() ? &amp;downcast&lt;WebKitCSSResourceValue&gt;(listIterator-&gt;get()) : nullptr);
-        } else
-            maskImageValue = nullptr;
-    }
-
-    return true;
-}
-
</del><span class="cx"> PassRefPtr&lt;StyleImage&gt; StyleResolver::loadPendingImage(const StylePendingImage&amp; pendingImage, const ResourceLoaderOptions&amp; options)
</span><span class="cx"> {
</span><span class="cx">     if (auto imageValue = pendingImage.cssImageValue())
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.h (178019 => 178020)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.h        2015-01-07 03:23:54 UTC (rev 178019)
+++ trunk/Source/WebCore/css/StyleResolver.h        2015-01-07 06:35:54 UTC (rev 178020)
</span><span class="lines">@@ -237,7 +237,6 @@
</span><span class="cx">     void clearCachedPropertiesAffectedByViewportUnits();
</span><span class="cx"> 
</span><span class="cx">     bool createFilterOperations(CSSValue&amp; inValue, FilterOperations&amp; outOperations);
</span><del>-    bool createMaskImageOperations(CSSValue* inValue, Vector&lt;RefPtr&lt;MaskImageOperation&gt;&gt;&amp; outOperations);
</del><span class="cx">     void loadPendingSVGDocuments();
</span><span class="cx"> 
</span><span class="cx">     void loadPendingResources();
</span></span></pre>
</div>
</div>

</body>
</html>