Dynamically-added backdrop filter to clip-path'd element with 3D transform renders...
authormitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 Oct 2016 02:49:41 +0000 (02:49 +0000)
committermitz@apple.com <mitz@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 23 Oct 2016 02:49:41 +0000 (02:49 +0000)
https://bugs.webkit.org/show_bug.cgi?id=163497

Reviewed by Simon Fraser.

Source/WebCore:

Test: css3/filters/backdrop/dynamic-with-clip-path.html

* platform/graphics/ca/GraphicsLayerCA.cpp:
(WebCore::GraphicsLayerCA::ensureStructuralLayer): Added MaskLayerChanged to
  structuralLayerChangeFlags to ensure that the mask layer is updated.

LayoutTests:

Based on the test case from Tim Horton.

* css3/filters/backdrop/dynamic-with-clip-path-expected.html: Added.
* css3/filters/backdrop/dynamic-with-clip-path.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@207723 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/css3/filters/backdrop/dynamic-with-clip-path-expected.html [new file with mode: 0644]
LayoutTests/css3/filters/backdrop/dynamic-with-clip-path.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/ca/GraphicsLayerCA.cpp

index f0f26d1..ad24a96 100644 (file)
@@ -1,3 +1,15 @@
+2016-10-22  Dan Bernstein  <mitz@apple.com>
+
+        Dynamically-added backdrop filter to clip-path'd element with 3D transform renders incorrectly (without clip)
+        https://bugs.webkit.org/show_bug.cgi?id=163497
+
+        Reviewed by Simon Fraser.
+
+        Based on the test case from Tim Horton.
+
+        * css3/filters/backdrop/dynamic-with-clip-path-expected.html: Added.
+        * css3/filters/backdrop/dynamic-with-clip-path.html: Added.
+
 2016-10-22  Simon Fraser  <simon.fraser@apple.com>
 
         Backdrop filter doesn't show if removed then re-added
diff --git a/LayoutTests/css3/filters/backdrop/dynamic-with-clip-path-expected.html b/LayoutTests/css3/filters/backdrop/dynamic-with-clip-path-expected.html
new file mode 100644 (file)
index 0000000..2f1e716
--- /dev/null
@@ -0,0 +1,19 @@
+<!DOCTYPE html>
+<style>
+    #box {
+        position: absolute;
+        width: 200px;
+        height: 200px;
+        background-color: green;
+    }
+    #filter {
+            position: absolute;
+            width: 200px;
+            height: 200px;
+            transform: translatez(0);
+            -webkit-clip-path: circle(25px at 225px);
+            -webkit-backdrop-filter: invert();
+    }
+</style>
+<div id="box"></div>
+<div id="filter"></div>
diff --git a/LayoutTests/css3/filters/backdrop/dynamic-with-clip-path.html b/LayoutTests/css3/filters/backdrop/dynamic-with-clip-path.html
new file mode 100644 (file)
index 0000000..65cd0e9
--- /dev/null
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<style>
+    #box {
+        position: absolute;
+        width: 200px;
+        height: 200px;
+        background-color: green;
+    }
+    #filter {
+        position: absolute;
+        width: 200px;
+        height: 200px;
+        transform: translatez(0);
+        -webkit-clip-path: circle(25px at 225px);
+    }
+    .backdrop {
+        -webkit-backdrop-filter: invert();
+    }
+</style>
+<div id="box"></div>
+<div id="filter"></div>
+<script>
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+    setTimeout(function() {
+        document.getElementById("filter").classList.add("backdrop");
+        if (window.testRunner)
+            testRunner.notifyDone();
+    }, 0);
+</script>
index a40799e..78ea21b 100644 (file)
@@ -1,3 +1,16 @@
+2016-10-22  Dan Bernstein  <mitz@apple.com>
+
+        Dynamically-added backdrop filter to clip-path'd element with 3D transform renders incorrectly (without clip)
+        https://bugs.webkit.org/show_bug.cgi?id=163497
+
+        Reviewed by Simon Fraser.
+
+        Test: css3/filters/backdrop/dynamic-with-clip-path.html
+
+        * platform/graphics/ca/GraphicsLayerCA.cpp:
+        (WebCore::GraphicsLayerCA::ensureStructuralLayer): Added MaskLayerChanged to
+          structuralLayerChangeFlags to ensure that the mask layer is updated.
+
 2016-10-22  Simon Fraser  <simon.fraser@apple.com>
 
         Backdrop filter doesn't show if removed then re-added
index 07c8509..b5d6054 100644 (file)
@@ -2071,6 +2071,7 @@ void GraphicsLayerCA::ensureStructuralLayer(StructuralLayerPurpose purpose)
         | BackfaceVisibilityChanged
         | FiltersChanged
         | BackdropFiltersChanged
+        | MaskLayerChanged
         | OpacityChanged;
 
     if (purpose == NoStructuralLayer) {