<!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>[201648] 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/201648">201648</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2016-06-03 11:13:52 -0700 (Fri, 03 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Reflection of element does not respect backdrop-filter property
https://bugs.webkit.org/show_bug.cgi?id=158201

Patch by Antoine Quint &lt;graouts@apple.com&gt; on 2016-06-03
Reviewed by Dean Jackson.

Source/WebCore:

We weren't cloning the PlatformCALayer for the backdrop so reflections would simply
not show their backdrops. We now follow the same pattern as other PlatformCALayers
owned by a GraphicsLayerCA and keep a list of backdrop layer clones that we add
to the structural layer when cloning to match the layer order of the original
and update the backdrop layer clone properties to match the original when the
backdrop filters or rectangle changes.

Tests: css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop.html
       css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop.html
       css3/filters/backdrop/backdrop-filter-with-reflection-value-change.html
       css3/filters/backdrop/backdrop-filter-with-reflection.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::updateBackdropFilters):
(WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
Update backdrop layer clones to match new values set when the backdrop filter
configuration changes.

(WebCore::GraphicsLayerCA::ensureCloneLayers):
Create the backdrop layer clones map if needed and clone the existing backdrop layer.

(WebCore::GraphicsLayerCA::clearClones):
Clear the backdrop layer clones map.

(WebCore::GraphicsLayerCA::fetchCloneLayers):
Obtain a clone for the backdrop layer, and if we have a valid clone, add it to the
structural layer clone as its first child to match the operation in updateSublayerList().

* platform/graphics/ca/GraphicsLayerCA.h:
Modify the signature for ensureCloneLayers() to account for the new backdrop layer clone and
declare the backdrop layer clone map.

* platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
(PlatformCALayerCocoa::clone):
Reflect the backdrop layer type when cloning a PlatformCALayer.

LayoutTests:

* css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop-expected.html: Added.
* css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop.html: Added.

Covers the case where a reflected element without a backdrop-filter initially has one added later.

* css3/filters/backdrop/backdrop-filter-with-reflection-expected.html: Added.
* css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop-expected.html: Added.

Covers the case where a reflected element with a backdrop-filter initially has it removed later.

* css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop.html: Added.
* css3/filters/backdrop/backdrop-filter-with-reflection-value-change-expected.html: Added.

Covers the case where a reflected element with a backdrop-filter has its backdrop-filter property changed later.

* css3/filters/backdrop/backdrop-filter-with-reflection-value-change.html: Added.
* css3/filters/backdrop/backdrop-filter-with-reflection.html: Added.

Covers the basic case of a reflected element with a backdrop-filter.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh">trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoamm">trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionaddbackdropexpectedhtml">trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop-expected.html</a></li>
<li><a href="#trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionaddbackdrophtml">trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop.html</a></li>
<li><a href="#trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionexpectedhtml">trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-expected.html</a></li>
<li><a href="#trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionremovebackdropexpectedhtml">trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop-expected.html</a></li>
<li><a href="#trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionremovebackdrophtml">trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop.html</a></li>
<li><a href="#trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionvaluechangeexpectedhtml">trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-value-change-expected.html</a></li>
<li><a href="#trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionvaluechangehtml">trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-value-change.html</a></li>
<li><a href="#trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionhtml">trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201647 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-03 17:09:42 UTC (rev 201647)
+++ trunk/LayoutTests/ChangeLog        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -1,5 +1,32 @@
</span><span class="cx"> 2016-06-03  Antoine Quint  &lt;graouts@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Reflection of element does not respect backdrop-filter property
+        https://bugs.webkit.org/show_bug.cgi?id=158201
+
+        Reviewed by Dean Jackson.
+
+        * css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop-expected.html: Added.
+        * css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop.html: Added.
+
+        Covers the case where a reflected element without a backdrop-filter initially has one added later.
+
+        * css3/filters/backdrop/backdrop-filter-with-reflection-expected.html: Added.
+        * css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop-expected.html: Added.
+
+        Covers the case where a reflected element with a backdrop-filter initially has it removed later.
+
+        * css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop.html: Added.
+        * css3/filters/backdrop/backdrop-filter-with-reflection-value-change-expected.html: Added.
+
+        Covers the case where a reflected element with a backdrop-filter has its backdrop-filter property changed later.
+
+        * css3/filters/backdrop/backdrop-filter-with-reflection-value-change.html: Added.
+        * css3/filters/backdrop/backdrop-filter-with-reflection.html: Added.
+
+        Covers the basic case of a reflected element with a backdrop-filter.
+
+2016-06-03  Antoine Quint  &lt;graouts@apple.com&gt;
+
</ins><span class="cx">         REGRESSION: WebGL doesn't show up in CSS reflections
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=76489
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionaddbackdropexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop-expected.html (0 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop-expected.html                                (rev 0)
+++ trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop-expected.html        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+&lt;head&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width&quot;&gt;
+    &lt;title&gt;This tests that the reflection of an element without a backdrop-filter value initially updates its rendering when the reflected layer has a backdrop-filter applied later.&lt;/title&gt;
+    &lt;style&gt;
+
+    svg {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        width: 200px;
+        height: 200px;
+        background-color: lightgray;
+    }
+
+    .backdrop {
+        position: absolute;
+        top: 10px;
+        left: 60px;
+        width: 80px;
+        height: 80px;
+        background-color: rgba(255, 255, 255, 0.5);
+        -webkit-backdrop-filter: saturate(180%) blur(5px);
+    }
+
+    .backdrop:last-of-type {
+        top: 110px;
+    }
+
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;svg viewbox=&quot;0 0 2 2&quot;&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;0&quot; y=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;1&quot; y=&quot;1&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+&lt;/svg&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionaddbackdrophtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop.html (0 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop.html                                (rev 0)
+++ trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop.html        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -0,0 +1,47 @@
</span><ins>+&lt;head&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width&quot;&gt;
+    &lt;title&gt;This tests that the reflection of an element without a backdrop-filter value initially updates its rendering when the reflected layer has a backdrop-filter applied later.&lt;/title&gt;
+    &lt;style&gt;
+
+    svg {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        width: 200px;
+        height: 200px;
+        background-color: lightgray;
+    }
+
+    .backdrop {
+        position: absolute;
+        top: 10px;
+        left: 60px;
+        width: 80px;
+        height: 80px;
+        background-color: rgba(255, 255, 255, 0.5);
+        -webkit-box-reflect: below 20px;
+    }
+
+    .backdrop.changed {
+        -webkit-backdrop-filter: saturate(180%) blur(5px);
+    }
+
+    &lt;/style&gt;
+    &lt;script type=&quot;text/javascript&quot;&gt;
+        
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+
+    window.requestAnimationFrame(function() {
+        document.querySelector(&quot;.backdrop&quot;).classList.add(&quot;changed&quot;);
+        if (window.testRunner)
+            testRunner.notifyDone();
+    });
+
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;svg viewbox=&quot;0 0 2 2&quot;&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;0&quot; y=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;1&quot; y=&quot;1&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+&lt;/svg&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-expected.html (0 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-expected.html                                (rev 0)
+++ trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-expected.html        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+&lt;head&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width&quot;&gt;
+    &lt;title&gt;This tests that the reflection of an element with a backdrop-filter applied also has a backdrop-filter of its own.&lt;/title&gt;
+    &lt;style&gt;
+
+    svg {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        width: 200px;
+        height: 200px;
+        background-color: lightgray;
+    }
+
+    .backdrop {
+        position: absolute;
+        top: 10px;
+        left: 60px;
+        width: 80px;
+        height: 80px;
+        background-color: rgba(255, 255, 255, 0.5);
+        -webkit-backdrop-filter: saturate(180%) blur(5px);
+    }
+
+    .backdrop:last-of-type {
+        top: 110px;
+    }
+
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;svg viewbox=&quot;0 0 2 2&quot;&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;0&quot; y=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;1&quot; y=&quot;1&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+&lt;/svg&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionremovebackdropexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop-expected.html (0 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop-expected.html                                (rev 0)
+++ trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop-expected.html        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;head&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width&quot;&gt;
+    &lt;title&gt;This tests that the reflection of an element with a backdrop-filter applied updates its rendering when the reflected layer no longer has a backdrop-filter applied.&lt;/title&gt;
+    &lt;style&gt;
+
+    svg {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        width: 200px;
+        height: 200px;
+        background-color: lightgray;
+    }
+
+    .backdrop {
+        position: absolute;
+        top: 10px;
+        left: 60px;
+        width: 80px;
+        height: 80px;
+        background-color: rgba(255, 255, 255, 0.5);
+    }
+
+    .backdrop:last-of-type {
+        top: 110px;
+    }
+
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;svg viewbox=&quot;0 0 2 2&quot;&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;0&quot; y=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;1&quot; y=&quot;1&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+&lt;/svg&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionremovebackdrophtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop.html (0 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop.html                                (rev 0)
+++ trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop.html        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+&lt;head&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width&quot;&gt;
+    &lt;title&gt;This tests that the reflection of an element with a backdrop-filter applied updates its rendering when the reflected layer no longer has a backdrop-filter applied.&lt;/title&gt;
+    &lt;style&gt;
+
+    svg {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        width: 200px;
+        height: 200px;
+        background-color: lightgray;
+    }
+
+    .backdrop {
+        position: absolute;
+        top: 10px;
+        left: 60px;
+        width: 80px;
+        height: 80px;
+        background-color: rgba(255, 255, 255, 0.5);
+        -webkit-backdrop-filter: saturate(180%) blur(5px);
+        -webkit-box-reflect: below 20px;
+    }
+
+    .backdrop.changed {
+        -webkit-backdrop-filter: none;
+    }
+
+    &lt;/style&gt;
+    &lt;script type=&quot;text/javascript&quot;&gt;
+        
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+
+    window.requestAnimationFrame(function() {
+        document.querySelector(&quot;.backdrop&quot;).classList.add(&quot;changed&quot;);
+        if (window.testRunner)
+            testRunner.notifyDone();
+    });
+
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;svg viewbox=&quot;0 0 2 2&quot;&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;0&quot; y=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;1&quot; y=&quot;1&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+&lt;/svg&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionvaluechangeexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-value-change-expected.html (0 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-value-change-expected.html                                (rev 0)
+++ trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-value-change-expected.html        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+&lt;head&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width&quot;&gt;
+    &lt;title&gt;This tests that the reflection of an element with a backdrop-filter applied updates its rendering when the reflected layer has a change of backdrop-filter value.&lt;/title&gt;
+    &lt;style&gt;
+
+    svg {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        width: 200px;
+        height: 200px;
+        background-color: lightgray;
+    }
+
+    .backdrop {
+        position: absolute;
+        top: 10px;
+        left: 60px;
+        width: 80px;
+        height: 80px;
+        background-color: rgba(255, 255, 255, 0.5);
+        -webkit-backdrop-filter: saturate(180%) blur(10px);
+    }
+
+    .backdrop:last-of-type {
+        top: 110px;
+    }
+
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;svg viewbox=&quot;0 0 2 2&quot;&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;0&quot; y=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;1&quot; y=&quot;1&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+&lt;/svg&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionvaluechangehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-value-change.html (0 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-value-change.html                                (rev 0)
+++ trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection-value-change.html        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+&lt;head&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width&quot;&gt;
+    &lt;title&gt;This tests that the reflection of an element with a backdrop-filter applied updates its rendering when the reflected layer has a change of backdrop-filter value.&lt;/title&gt;
+    &lt;style&gt;
+
+    svg {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        width: 200px;
+        height: 200px;
+        background-color: lightgray;
+    }
+
+    .backdrop {
+        position: absolute;
+        top: 10px;
+        left: 60px;
+        width: 80px;
+        height: 80px;
+        background-color: rgba(255, 255, 255, 0.5);
+        -webkit-backdrop-filter: saturate(180%) blur(5px);
+        -webkit-box-reflect: below 20px;
+    }
+
+    .backdrop.changed {
+        -webkit-backdrop-filter: saturate(180%) blur(10px);
+    }
+
+    &lt;/style&gt;
+    &lt;script type=&quot;text/javascript&quot;&gt;
+        
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+
+    window.requestAnimationFrame(function() {
+        document.querySelector(&quot;.backdrop&quot;).classList.add(&quot;changed&quot;);
+        if (window.testRunner)
+            testRunner.notifyDone();
+    });
+
+    &lt;/script&gt;
+&lt;/head&gt;
+&lt;svg viewbox=&quot;0 0 2 2&quot;&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;0&quot; y=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;1&quot; y=&quot;1&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+&lt;/svg&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestscss3filtersbackdropbackdropfilterwithreflectionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection.html (0 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection.html                                (rev 0)
+++ trunk/LayoutTests/css3/filters/backdrop/backdrop-filter-with-reflection.html        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -0,0 +1,32 @@
</span><ins>+&lt;head&gt;
+    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width&quot;&gt;
+    &lt;title&gt;This tests that the reflection of an element with a backdrop-filter applied also has a backdrop-filter of its own.&lt;/title&gt;
+    &lt;style&gt;
+
+    svg {
+        position: absolute;
+        top: 0px;
+        left: 0px;
+        width: 200px;
+        height: 200px;
+        background-color: lightgray;
+    }
+
+    .backdrop {
+        position: absolute;
+        top: 10px;
+        left: 60px;
+        width: 80px;
+        height: 80px;
+        background-color: rgba(255, 255, 255, 0.5);
+        -webkit-backdrop-filter: saturate(180%) blur(5px);
+        -webkit-box-reflect: below 20px;
+    }
+
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;svg viewbox=&quot;0 0 2 2&quot;&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;0&quot; y=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+    &lt;rect fill=&quot;black&quot; x=&quot;1&quot; y=&quot;1&quot; width=&quot;1&quot; height=&quot;1&quot;&gt;&lt;/rect&gt;
+&lt;/svg&gt;
+&lt;div class=&quot;backdrop&quot;&gt;&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201647 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-03 17:09:42 UTC (rev 201647)
+++ trunk/Source/WebCore/ChangeLog        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -1,3 +1,46 @@
</span><ins>+2016-06-03  Antoine Quint  &lt;graouts@apple.com&gt;
+
+        Reflection of element does not respect backdrop-filter property
+        https://bugs.webkit.org/show_bug.cgi?id=158201
+
+        Reviewed by Dean Jackson.
+
+        We weren't cloning the PlatformCALayer for the backdrop so reflections would simply
+        not show their backdrops. We now follow the same pattern as other PlatformCALayers
+        owned by a GraphicsLayerCA and keep a list of backdrop layer clones that we add
+        to the structural layer when cloning to match the layer order of the original
+        and update the backdrop layer clone properties to match the original when the
+        backdrop filters or rectangle changes.
+
+        Tests: css3/filters/backdrop/backdrop-filter-with-reflection-add-backdrop.html
+               css3/filters/backdrop/backdrop-filter-with-reflection-remove-backdrop.html
+               css3/filters/backdrop/backdrop-filter-with-reflection-value-change.html
+               css3/filters/backdrop/backdrop-filter-with-reflection.html
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::updateBackdropFilters):
+        (WebCore::GraphicsLayerCA::updateBackdropFiltersRect):
+        Update backdrop layer clones to match new values set when the backdrop filter
+        configuration changes.
+
+        (WebCore::GraphicsLayerCA::ensureCloneLayers):
+        Create the backdrop layer clones map if needed and clone the existing backdrop layer.
+
+        (WebCore::GraphicsLayerCA::clearClones):
+        Clear the backdrop layer clones map.
+
+        (WebCore::GraphicsLayerCA::fetchCloneLayers):
+        Obtain a clone for the backdrop layer, and if we have a valid clone, add it to the
+        structural layer clone as its first child to match the operation in updateSublayerList().
+
+        * platform/graphics/ca/GraphicsLayerCA.h:
+        Modify the signature for ensureCloneLayers() to account for the new backdrop layer clone and
+        declare the backdrop layer clone map.
+
+        * platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm:
+        (PlatformCALayerCocoa::clone):
+        Reflect the backdrop layer type when cloning a PlatformCALayer.
+
</ins><span class="cx"> 2016-06-03  Brady Eidson  &lt;beidson@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ResourceResponseBase cleanup.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp (201647 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2016-06-03 17:09:42 UTC (rev 201647)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -1950,6 +1950,14 @@
</span><span class="cx"> 
</span><span class="cx">     m_backdropLayer-&gt;setHidden(!m_contentsVisible);
</span><span class="cx">     m_backdropLayer-&gt;setFilters(m_backdropFilters);
</span><ins>+
+    if (LayerMap* layerCloneMap = m_backdropLayerClones.get()) {
+        for (auto&amp; clone : *layerCloneMap) {
+            PlatformCALayer* cloneLayer = clone.value.get();
+            cloneLayer-&gt;setHidden(!m_contentsVisible);
+            cloneLayer-&gt;setFilters(m_backdropFilters);
+        }
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerCA::updateBackdropFiltersRect()
</span><span class="lines">@@ -1959,6 +1967,14 @@
</span><span class="cx">     FloatRect contentBounds(0, 0, m_backdropFiltersRect.width(), m_backdropFiltersRect.height());
</span><span class="cx">     m_backdropLayer-&gt;setBounds(contentBounds);
</span><span class="cx">     m_backdropLayer-&gt;setPosition(m_backdropFiltersRect.location());
</span><ins>+
+    if (LayerMap* layerCloneMap = m_backdropLayerClones.get()) {
+        for (auto&amp; clone : *layerCloneMap) {
+            PlatformCALayer* cloneLayer = clone.value.get();
+            cloneLayer-&gt;setBounds(contentBounds);
+            cloneLayer-&gt;setPosition(m_backdropFiltersRect.location());
+        }
+    }
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_COMPOSITING)
</span><span class="lines">@@ -3580,7 +3596,7 @@
</span><span class="cx"> }   
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerCA::ensureCloneLayers(CloneID cloneID, RefPtr&lt;PlatformCALayer&gt;&amp; primaryLayer, RefPtr&lt;PlatformCALayer&gt;&amp; structuralLayer,
</span><del>-    RefPtr&lt;PlatformCALayer&gt;&amp; contentsLayer, RefPtr&lt;PlatformCALayer&gt;&amp; contentsClippingLayer, RefPtr&lt;PlatformCALayer&gt;&amp; contentsShapeMaskLayer, RefPtr&lt;PlatformCALayer&gt;&amp; shapeMaskLayer, CloneLevel cloneLevel)
</del><ins>+    RefPtr&lt;PlatformCALayer&gt;&amp; contentsLayer, RefPtr&lt;PlatformCALayer&gt;&amp; contentsClippingLayer, RefPtr&lt;PlatformCALayer&gt;&amp; contentsShapeMaskLayer, RefPtr&lt;PlatformCALayer&gt;&amp; shapeMaskLayer, RefPtr&lt;PlatformCALayer&gt;&amp; backdropLayer, CloneLevel cloneLevel)
</ins><span class="cx"> {
</span><span class="cx">     structuralLayer = nullptr;
</span><span class="cx">     contentsLayer = nullptr;
</span><span class="lines">@@ -3603,12 +3619,16 @@
</span><span class="cx">     if (!m_shapeMaskLayerClones &amp;&amp; m_shapeMaskLayer)
</span><span class="cx">         m_shapeMaskLayerClones = std::make_unique&lt;LayerMap&gt;();
</span><span class="cx"> 
</span><ins>+    if (!m_backdropLayerClones &amp;&amp; m_backdropLayer)
+        m_backdropLayerClones = std::make_unique&lt;LayerMap&gt;();
+    
</ins><span class="cx">     primaryLayer = findOrMakeClone(cloneID, m_layer.get(), m_layerClones.get(), cloneLevel);
</span><span class="cx">     structuralLayer = findOrMakeClone(cloneID, m_structuralLayer.get(), m_structuralLayerClones.get(), cloneLevel);
</span><span class="cx">     contentsLayer = findOrMakeClone(cloneID, m_contentsLayer.get(), m_contentsLayerClones.get(), cloneLevel);
</span><span class="cx">     contentsClippingLayer = findOrMakeClone(cloneID, m_contentsClippingLayer.get(), m_contentsClippingLayerClones.get(), cloneLevel);
</span><span class="cx">     contentsShapeMaskLayer = findOrMakeClone(cloneID, m_contentsShapeMaskLayer.get(), m_contentsShapeMaskLayerClones.get(), cloneLevel);
</span><span class="cx">     shapeMaskLayer = findOrMakeClone(cloneID, m_shapeMaskLayer.get(), m_shapeMaskLayerClones.get(), cloneLevel);
</span><ins>+    backdropLayer = findOrMakeClone(cloneID, m_backdropLayer.get(), m_backdropLayerClones.get(), cloneLevel);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void GraphicsLayerCA::clearClones(std::unique_ptr&lt;LayerMap&gt;&amp; layerMap)
</span><span class="lines">@@ -3630,6 +3650,7 @@
</span><span class="cx">     clearClones(m_contentsClippingLayerClones);
</span><span class="cx">     clearClones(m_contentsShapeMaskLayerClones);
</span><span class="cx">     clearClones(m_shapeMaskLayerClones);
</span><ins>+    clearClones(m_backdropLayerClones);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> FloatPoint GraphicsLayerCA::positionForCloneRootLayer() const
</span><span class="lines">@@ -3663,7 +3684,8 @@
</span><span class="cx">     RefPtr&lt;PlatformCALayer&gt; contentsClippingLayer;
</span><span class="cx">     RefPtr&lt;PlatformCALayer&gt; contentsShapeMaskLayer;
</span><span class="cx">     RefPtr&lt;PlatformCALayer&gt; shapeMaskLayer;
</span><del>-    ensureCloneLayers(replicaState.cloneID(), primaryLayer, structuralLayer, contentsLayer, contentsClippingLayer, contentsShapeMaskLayer, shapeMaskLayer, cloneLevel);
</del><ins>+    RefPtr&lt;PlatformCALayer&gt; backdropLayer;
+    ensureCloneLayers(replicaState.cloneID(), primaryLayer, structuralLayer, contentsLayer, contentsClippingLayer, contentsShapeMaskLayer, shapeMaskLayer, backdropLayer, cloneLevel);
</ins><span class="cx"> 
</span><span class="cx">     if (m_maskLayer) {
</span><span class="cx">         RefPtr&lt;PlatformCALayer&gt; maskClone = downcast&lt;GraphicsLayerCA&gt;(*m_maskLayer).fetchCloneLayers(replicaRoot, replicaState, IntermediateCloneLevel);
</span><span class="lines">@@ -3707,9 +3729,12 @@
</span><span class="cx"> 
</span><span class="cx">     if (shapeMaskLayer)
</span><span class="cx">         primaryLayer-&gt;setMask(shapeMaskLayer.get());
</span><del>-    
</del><ins>+
</ins><span class="cx">     if (replicaLayer || structuralLayer || contentsLayer || contentsClippingLayer || childLayers.size() &gt; 0) {
</span><span class="cx">         if (structuralLayer) {
</span><ins>+            if (backdropLayer)
+                clonalSublayers.append(backdropLayer);
+            
</ins><span class="cx">             // Replicas render behind the actual layer content.
</span><span class="cx">             if (replicaLayer)
</span><span class="cx">                 clonalSublayers.append(replicaLayer);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscaGraphicsLayerCAh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h (201647 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2016-06-03 17:09:42 UTC (rev 201647)
+++ trunk/Source/WebCore/platform/graphics/ca/GraphicsLayerCA.h        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -374,7 +374,7 @@
</span><span class="cx">     PassRefPtr&lt;PlatformCALayer&gt; findOrMakeClone(CloneID, PlatformCALayer *, LayerMap*, CloneLevel);
</span><span class="cx"> 
</span><span class="cx">     void ensureCloneLayers(CloneID, RefPtr&lt;PlatformCALayer&gt;&amp; primaryLayer, RefPtr&lt;PlatformCALayer&gt;&amp; structuralLayer,
</span><del>-        RefPtr&lt;PlatformCALayer&gt;&amp; contentsLayer, RefPtr&lt;PlatformCALayer&gt;&amp; contentsClippingLayer, RefPtr&lt;PlatformCALayer&gt;&amp; contentsShapeMaskLayer, RefPtr&lt;PlatformCALayer&gt;&amp; shapeMaskLayer, CloneLevel);
</del><ins>+        RefPtr&lt;PlatformCALayer&gt;&amp; contentsLayer, RefPtr&lt;PlatformCALayer&gt;&amp; contentsClippingLayer, RefPtr&lt;PlatformCALayer&gt;&amp; contentsShapeMaskLayer, RefPtr&lt;PlatformCALayer&gt;&amp; shapeMaskLayer, RefPtr&lt;PlatformCALayer&gt;&amp; backdropLayer, CloneLevel);
</ins><span class="cx"> 
</span><span class="cx">     static void clearClones(std::unique_ptr&lt;LayerMap&gt;&amp;);
</span><span class="cx"> 
</span><span class="lines">@@ -518,6 +518,7 @@
</span><span class="cx">     std::unique_ptr&lt;LayerMap&gt; m_contentsClippingLayerClones;
</span><span class="cx">     std::unique_ptr&lt;LayerMap&gt; m_contentsShapeMaskLayerClones;
</span><span class="cx">     std::unique_ptr&lt;LayerMap&gt; m_shapeMaskLayerClones;
</span><ins>+    std::unique_ptr&lt;LayerMap&gt; m_backdropLayerClones;
</ins><span class="cx"> 
</span><span class="cx"> #ifdef VISIBLE_TILE_WASH
</span><span class="cx">     RefPtr&lt;PlatformCALayer&gt; m_visibleTileWashLayer;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscacocoaPlatformCALayerCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm (201647 => 201648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm        2016-06-03 17:09:42 UTC (rev 201647)
+++ trunk/Source/WebCore/platform/graphics/ca/cocoa/PlatformCALayerCocoa.mm        2016-06-03 18:13:52 UTC (rev 201648)
</span><span class="lines">@@ -326,6 +326,9 @@
</span><span class="cx">     case LayerTypeShapeLayer:
</span><span class="cx">         type = LayerTypeShapeLayer;
</span><span class="cx">         break;
</span><ins>+    case LayerTypeBackdropLayer:
+        type = LayerTypeBackdropLayer;
+        break;
</ins><span class="cx">     case LayerTypeLayer:
</span><span class="cx">     default:
</span><span class="cx">         type = LayerTypeLayer;
</span></span></pre>
</div>
</div>

</body>
</html>