<!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 <cdumez@apple.com>
</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 <cdumez@apple.com>
+
</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<RefPtr<MaskImageOperation>>]
</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 "LengthRepeat.h"
</span><span class="cx"> #include "Pair.h"
</span><span class="cx"> #include "QuotesData.h"
</span><ins>+#include "SVGURIReference.h"
</ins><span class="cx"> #include "Settings.h"
</span><span class="cx"> #include "StyleResolver.h"
</span><span class="cx"> #include "StyleScrollSnapPoints.h"
</span><span class="cx"> #include "TransformFunctions.h"
</span><ins>+#include "WebKitCSSResourceValue.h"
</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&, CSSValue&, float&);
</span><span class="cx"> static bool convertMarqueeIncrement(StyleResolver&, CSSValue&, Length&);
</span><span class="cx"> static bool convertFilterOperations(StyleResolver&, CSSValue&, FilterOperations&);
</span><ins>+ static bool convertMaskImageOperations(StyleResolver&, CSSValue&, Vector<RefPtr<MaskImageOperation>>&);
</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& styleResolver, CSSValue& value, Vector<RefPtr<MaskImageOperation>>& operations)
+{
+ RefPtr<WebKitCSSResourceValue> maskImageValue;
+ RefPtr<CSSValueList> maskImagesList;
+ CSSValueList::iterator listIterator;
+ if (is<WebKitCSSResourceValue>(value))
+ maskImageValue = &downcast<WebKitCSSResourceValue>(value);
+ else if (is<CSSValueList>(value)) {
+ maskImagesList = &downcast<CSSValueList>(value);
+ listIterator = maskImagesList->begin();
+ if (listIterator != maskImagesList->end())
+ maskImageValue = &downcast<WebKitCSSResourceValue>(listIterator->get());
+ }
+
+ while (maskImageValue.get()) {
+ RefPtr<CSSValue> maskInnerValue = maskImageValue->innerValue();
+
+ RefPtr<MaskImageOperation> newMaskImage;
+ if (is<CSSPrimitiveValue>(maskInnerValue.get())) {
+ RefPtr<CSSPrimitiveValue> primitiveValue = downcast<CSSPrimitiveValue>(maskInnerValue.get());
+ if (primitiveValue->isValueID() && primitiveValue->getValueID() == CSSValueNone)
+ newMaskImage = MaskImageOperation::create();
+ else {
+ String cssUrl = primitiveValue->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<StyleImage> 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->end() ? &downcast<WebKitCSSResourceValue>(listIterator->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&) { }
+ static void applyInheritWebkitMaskImage(StyleResolver&) { }
+
</ins><span class="cx"> // Custom handling of inherit + value setting only.
</span><span class="cx"> static void applyInheritDisplay(StyleResolver&);
</span><span class="cx"> static void applyValueDisplay(StyleResolver&, CSSValue&);
</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<RefPtr<MaskImageOperation>> operations;
- if (createMaskImageOperations(value, operations))
- state.style()->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<RefPtr<MaskImageOperation>>& outOperations)
-{
- ASSERT(outOperations.isEmpty());
- if (!inValue)
- return false;
-
- RefPtr<WebKitCSSResourceValue> maskImageValue;
- RefPtr<CSSValueList> maskImagesList;
- CSSValueList::iterator listIterator;
- if (is<WebKitCSSResourceValue>(*inValue))
- maskImageValue = downcast<WebKitCSSResourceValue>(inValue);
- else if (is<CSSValueList>(*inValue)) {
- maskImagesList = downcast<CSSValueList>(inValue);
- listIterator = maskImagesList->begin();
- if (listIterator != maskImagesList->end())
- maskImageValue = &downcast<WebKitCSSResourceValue>(listIterator->get());
- }
-
- while (maskImageValue.get()) {
- RefPtr<CSSValue> maskInnerValue = maskImageValue->innerValue();
- RefPtr<MaskImageOperation> newMaskImage;
-
- if (is<CSSPrimitiveValue>(maskInnerValue.get())) {
- RefPtr<CSSPrimitiveValue> primitiveValue = downcast<CSSPrimitiveValue>(maskInnerValue.get());
- if (primitiveValue->isValueID() && primitiveValue->getValueID() == CSSValueNone)
- newMaskImage = MaskImageOperation::create();
- else {
- String cssUrl = primitiveValue->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<StyleImage> 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->end() ? &downcast<WebKitCSSResourceValue>(listIterator->get()) : nullptr);
- } else
- maskImageValue = nullptr;
- }
-
- return true;
-}
-
</del><span class="cx"> PassRefPtr<StyleImage> StyleResolver::loadPendingImage(const StylePendingImage& pendingImage, const ResourceLoaderOptions& 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& inValue, FilterOperations& outOperations);
</span><del>- bool createMaskImageOperations(CSSValue* inValue, Vector<RefPtr<MaskImageOperation>>& outOperations);
</del><span class="cx"> void loadPendingSVGDocuments();
</span><span class="cx">
</span><span class="cx"> void loadPendingResources();
</span></span></pre>
</div>
</div>
</body>
</html>