<!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>[185925] 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/185925">185925</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2015-06-24 13:54:28 -0700 (Wed, 24 Jun 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Better fix for Element with blur backdrop-filter shows edge duplication and dark edges
https://bugs.webkit.org/show_bug.cgi?id=146287
&lt;rdar://problem/21530437&gt;

Reviewed by Simon Fraser.

There is no need to carry around a bit in FilterOperations indicating what
type of source property the object came from. Whether or not to clip to the
bounds of the filter region is purely a property of the type of CALayer
we are applying the filter to.

This basically reverts <a href="http://trac.webkit.org/projects/webkit/changeset/185846">r185846</a>.

Covered by the test for the previous commit.

* css/CSSPropertyNames.in:
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertBackdropFilterOperations): Deleted.
* page/animation/CSSPropertyAnimation.cpp:
(WebCore::blendFilterOperations): Deleted.
* platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Set the normalized
edges property if we are a CABackdropLayer.
* platform/graphics/filters/FilterOperations.cpp:
(WebCore::FilterOperations::operator==):
(WebCore::FilterOperations::operationsMatch):
(WebCore::FilterOperations::operator=): Deleted.
* platform/graphics/filters/FilterOperations.h:
(WebCore::FilterOperations::isUsedForBackdropFilters): Deleted.
(WebCore::FilterOperations::setUsedForBackdropFilters): Deleted.</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="#trunkSourceWebCorepageanimationCSSPropertyAnimationcpp">trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCAFiltersCocoamm">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFilterOperationscpp">trunk/Source/WebCore/platform/graphics/filters/FilterOperations.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfiltersFilterOperationsh">trunk/Source/WebCore/platform/graphics/filters/FilterOperations.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (185924 => 185925)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-06-24 20:51:13 UTC (rev 185924)
+++ trunk/Source/WebCore/ChangeLog        2015-06-24 20:54:28 UTC (rev 185925)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2015-06-24  Dean Jackson  &lt;dino@apple.com&gt;
+
+        Better fix for Element with blur backdrop-filter shows edge duplication and dark edges
+        https://bugs.webkit.org/show_bug.cgi?id=146287
+        &lt;rdar://problem/21530437&gt;
+
+        Reviewed by Simon Fraser.
+
+        There is no need to carry around a bit in FilterOperations indicating what
+        type of source property the object came from. Whether or not to clip to the
+        bounds of the filter region is purely a property of the type of CALayer
+        we are applying the filter to.
+
+        This basically reverts r185846.
+
+        Covered by the test for the previous commit.
+
+        * css/CSSPropertyNames.in:
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertBackdropFilterOperations): Deleted.
+        * page/animation/CSSPropertyAnimation.cpp:
+        (WebCore::blendFilterOperations): Deleted.
+        * platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm: Set the normalized
+        edges property if we are a CABackdropLayer.
+        * platform/graphics/filters/FilterOperations.cpp:
+        (WebCore::FilterOperations::operator==):
+        (WebCore::FilterOperations::operationsMatch):
+        (WebCore::FilterOperations::operator=): Deleted.
+        * platform/graphics/filters/FilterOperations.h:
+        (WebCore::FilterOperations::isUsedForBackdropFilters): Deleted.
+        (WebCore::FilterOperations::setUsedForBackdropFilters): Deleted.
+
</ins><span class="cx"> 2015-06-24  Doug Russell  &lt;d_russell@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Bug 146177 - AX: AXObjectCache should try to use an unignored accessibilityObject 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (185924 => 185925)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2015-06-24 20:51:13 UTC (rev 185924)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2015-06-24 20:54:28 UTC (rev 185925)
</span><span class="lines">@@ -476,7 +476,7 @@
</span><span class="cx"> justify-content [Initial=initialContentAlignment, Converter=ContentAlignmentData]
</span><span class="cx"> -webkit-justify-content = justify-content
</span><span class="cx"> #if defined(ENABLE_FILTERS_LEVEL_2) &amp;&amp; ENABLE_FILTERS_LEVEL_2
</span><del>--webkit-backdrop-filter [ConditionalConverter=BackdropFilterOperations]
</del><ins>+-webkit-backdrop-filter [ConditionalConverter=FilterOperations]
</ins><span class="cx"> #endif
</span><span class="cx"> justify-self [Initial=initialSelfAlignment, Converter=SelfOrDefaultAlignmentData]
</span><span class="cx"> -webkit-font-size-delta [SkipBuilder]
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (185924 => 185925)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderConverter.h        2015-06-24 20:51:13 UTC (rev 185924)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h        2015-06-24 20:54:28 UTC (rev 185925)
</span><span class="lines">@@ -104,9 +104,6 @@
</span><span class="cx">     static Optional&lt;float&gt; convertPerspective(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx">     static Optional&lt;Length&gt; convertMarqueeIncrement(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx">     static Optional&lt;FilterOperations&gt; convertFilterOperations(StyleResolver&amp;, CSSValue&amp;);
</span><del>-#if ENABLE(FILTERS_LEVEL_2)
-    static Optional&lt;FilterOperations&gt; convertBackdropFilterOperations(StyleResolver&amp;, CSSValue&amp;);
-#endif
</del><span class="cx">     static Vector&lt;RefPtr&lt;MaskImageOperation&gt;&gt; convertMaskImageOperations(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     static bool convertTouchCallout(StyleResolver&amp;, CSSValue&amp;);
</span><span class="lines">@@ -1008,18 +1005,6 @@
</span><span class="cx">     return Nullopt;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-#if ENABLE(FILTERS_LEVEL_2)
-inline Optional&lt;FilterOperations&gt; StyleBuilderConverter::convertBackdropFilterOperations(StyleResolver&amp; styleResolver, CSSValue&amp; value)
-{
-    FilterOperations operations;
-    if (styleResolver.createFilterOperations(value, operations)) {
-        operations.setUsedForBackdropFilters(true);
-        return operations;
-    }
-    return Nullopt;
-}
-#endif
-
</del><span class="cx"> static inline WebKitCSSResourceValue* maskImageValueFromIterator(CSSValueList&amp; maskImagesList, CSSValueList::iterator it)
</span><span class="cx"> {
</span><span class="cx">     // May also be a CSSInitialValue.
</span></span></pre></div>
<a id="trunkSourceWebCorepageanimationCSSPropertyAnimationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp (185924 => 185925)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2015-06-24 20:51:13 UTC (rev 185924)
+++ trunk/Source/WebCore/page/animation/CSSPropertyAnimation.cpp        2015-06-24 20:54:28 UTC (rev 185925)
</span><span class="lines">@@ -192,10 +192,6 @@
</span><span class="cx">                 result.operations().append(fromOp ? fromOp : identityOp);
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-#if ENABLE(FILTERS_LEVEL_2)
-    result.setUsedForBackdropFilters(from.isUsedForBackdropFilters() || to.isUsedForBackdropFilters());
-#endif
-
</del><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCAFiltersCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm (185924 => 185925)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm        2015-06-24 20:51:13 UTC (rev 185924)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCAFiltersCocoa.mm        2015-06-24 20:54:28 UTC (rev 185925)
</span><span class="lines">@@ -33,6 +33,11 @@
</span><span class="cx"> #import &quot;QuartzCoreSPI.h&quot;
</span><span class="cx"> #import &lt;QuartzCore/QuartzCore.h&gt;
</span><span class="cx"> 
</span><ins>+#if ENABLE(FILTERS_LEVEL_2)
+@interface CABackdropLayer : CALayer
+@end
+#endif
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> // FIXME: Should share these values with FilterEffectRenderer::build() (https://bugs.webkit.org/show_bug.cgi?id=76008).
</span><span class="lines">@@ -162,7 +167,7 @@
</span><span class="cx">             CAFilter *filter = [CAFilter filterWithType:kCAFilterGaussianBlur];
</span><span class="cx">             [filter setValue:[NSNumber numberWithFloat:floatValueForLength(blurOperation.stdDeviation(), 0)] forKey:@&quot;inputRadius&quot;];
</span><span class="cx"> #if ENABLE(FILTERS_LEVEL_2)
</span><del>-            if (filters.isUsedForBackdropFilters())
</del><ins>+            if ([layer isKindOfClass:[CABackdropLayer class]])
</ins><span class="cx">                 [filter setValue:[NSNumber numberWithBool:YES] forKey:@&quot;inputNormalizeEdges&quot;];
</span><span class="cx"> #endif
</span><span class="cx">             [filter setName:filterName];
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFilterOperationscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FilterOperations.cpp (185924 => 185925)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FilterOperations.cpp        2015-06-24 20:51:13 UTC (rev 185924)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterOperations.cpp        2015-06-24 20:54:28 UTC (rev 185925)
</span><span class="lines">@@ -51,9 +51,6 @@
</span><span class="cx"> FilterOperations&amp; FilterOperations::operator=(const FilterOperations&amp; other)
</span><span class="cx"> {
</span><span class="cx">     m_operations = other.m_operations;
</span><del>-#if ENABLE(FILTERS_LEVEL_2)
-    m_usedForBackdropFilters = other.m_usedForBackdropFilters;
-#endif
</del><span class="cx">     return *this;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -62,17 +59,12 @@
</span><span class="cx">     if (m_operations.size() != o.m_operations.size())
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-#if ENABLE(FILTERS_LEVEL_2)
-    if (m_usedForBackdropFilters != o.m_usedForBackdropFilters)
-        return false;
-#endif
-
</del><span class="cx">     unsigned s = m_operations.size();
</span><span class="cx">     for (unsigned i = 0; i &lt; s; i++) {
</span><span class="cx">         if (*m_operations[i] != *o.m_operations[i])
</span><span class="cx">             return false;
</span><span class="cx">     }
</span><del>-    
</del><ins>+
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -82,7 +74,7 @@
</span><span class="cx">     // If the sizes of the function lists don't match, the lists don't match
</span><span class="cx">     if (numOperations != other.operations().size())
</span><span class="cx">         return false;
</span><del>-    
</del><ins>+
</ins><span class="cx">     // If the types of each function are not the same, the lists don't match
</span><span class="cx">     for (size_t i = 0; i &lt; numOperations; ++i) {
</span><span class="cx">         if (!operations()[i]-&gt;isSameType(*other.operations()[i]))
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfiltersFilterOperationsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/filters/FilterOperations.h (185924 => 185925)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/filters/FilterOperations.h        2015-06-24 20:51:13 UTC (rev 185924)
+++ trunk/Source/WebCore/platform/graphics/filters/FilterOperations.h        2015-06-24 20:54:28 UTC (rev 185925)
</span><span class="lines">@@ -40,7 +40,7 @@
</span><span class="cx"> public:
</span><span class="cx">     WEBCORE_EXPORT FilterOperations();
</span><span class="cx">     FilterOperations(const FilterOperations&amp; other) { *this = other; }
</span><del>-    
</del><ins>+
</ins><span class="cx">     WEBCORE_EXPORT FilterOperations&amp; operator=(const FilterOperations&amp;);
</span><span class="cx"> 
</span><span class="cx">     bool operator==(const FilterOperations&amp;) const;
</span><span class="lines">@@ -70,17 +70,8 @@
</span><span class="cx">     bool hasFilterThatMovesPixels() const;
</span><span class="cx"> 
</span><span class="cx">     bool hasReferenceFilter() const;
</span><del>-
-#if ENABLE(FILTERS_LEVEL_2)
-    bool isUsedForBackdropFilters() const { return m_usedForBackdropFilters; }
-    void setUsedForBackdropFilters(bool usedForBackdrop) { m_usedForBackdropFilters = usedForBackdrop; }
-#endif
-
</del><span class="cx"> private:
</span><span class="cx">     Vector&lt;RefPtr&lt;FilterOperation&gt;&gt; m_operations;
</span><del>-#if ENABLE(FILTERS_LEVEL_2)
-    bool m_usedForBackdropFilters { false };
-#endif
</del><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>

</body>
</html>