REGRESSION (r249434): flashy menus on wellsfargo.com
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Nov 2019 00:35:07 +0000 (00:35 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Nov 2019 00:35:07 +0000 (00:35 +0000)
https://bugs.webkit.org/show_bug.cgi?id=204175
<rdar://problem/56654512>

Reviewed by Zalan Bujtas.

Source/WebCore:

Test: compositing/backing/backing-for-clipping.html

r249434 made overflow an "indirect compositing reason" (i.e. we composite for overflow:hidden
when necessary to clip a composited descendant). However this made a clause in RenderLayerCompositor::requiresOwnBackingStore()
return early when this reason is set, skipping the bounds check, so we need to do the bound check first.
This is similar to the fix in r252070.

The change to the perspective test relates to the "FIXME"; we don't use the correct ancestor for the
bounds check, so sometimes layers can have backing store when they don't need it until that's fixed.

* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::requiresOwnBackingStore const):

LayoutTests:

* compositing/backing/backing-for-clipping-expected.html: Added.
* compositing/backing/backing-for-clipping.html: Added.
* compositing/backing/no-backing-for-perspective-expected.txt:
* platform/ios-wk2/compositing/backing/no-backing-for-perspective-expected.txt:

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

LayoutTests/ChangeLog
LayoutTests/compositing/backing/backing-for-clipping-expected.html [new file with mode: 0644]
LayoutTests/compositing/backing/backing-for-clipping.html [new file with mode: 0644]
LayoutTests/compositing/backing/no-backing-for-perspective-expected.txt
LayoutTests/platform/ios-wk2/compositing/backing/no-backing-for-perspective-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayerCompositor.cpp

index 5b713ff..12da970 100644 (file)
         and fast/visual-viewport/zoomed-fixed-scroll-down-then-up.html as
         Failure.
 
+2019-11-13  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r249434): flashy menus on wellsfargo.com
+        https://bugs.webkit.org/show_bug.cgi?id=204175
+        <rdar://problem/56654512>
+
+        Reviewed by Zalan Bujtas.
+
+        * compositing/backing/backing-for-clipping-expected.html: Added.
+        * compositing/backing/backing-for-clipping.html: Added.
+        * compositing/backing/no-backing-for-perspective-expected.txt:
+        * platform/ios-wk2/compositing/backing/no-backing-for-perspective-expected.txt:
+
 2019-11-11  Ryosuke Niwa  <rniwa@webkit.org>
 
         iOS: fast/scrolling/ios/scrollTo-at-page-load.html is flaky
diff --git a/LayoutTests/compositing/backing/backing-for-clipping-expected.html b/LayoutTests/compositing/backing/backing-for-clipping-expected.html
new file mode 100644 (file)
index 0000000..b6dc2f9
--- /dev/null
@@ -0,0 +1,53 @@
+<html>
+<head>
+    <style>
+        header {
+            position: fixed;
+            left: 0px;
+            right: 0px;
+            top: 0px;
+            height: 50px;
+            width: 400px;
+            background-color: silver;
+        }
+
+        .container
+        {
+            position: absolute;
+            left: 50px;
+            top: 30px;
+            background-color: silver;
+            width: 300px;
+            z-index: 1;        
+        }
+    
+        .child {
+            width: 100%;
+            height: 50px;
+            background-color: green;
+        }
+        
+        body.changed .composited {
+              transform: translateZ(0);
+        }
+    </style>
+    <script>
+        
+        window.addEventListener('load', () => {
+            setTimeout(() => {
+                document.body.classList.add('changed');
+            }, 0)
+        }, false);
+    </script>
+</head>
+<body>
+    <header>
+        &nbsp;
+        <div class="container">
+            <div class="child">&nbsp;</div>
+            <div class="child">&nbsp;</div>
+            <div class="composited child">&nbsp;</div>
+        </div>
+    </header>
+</body>
+</html>
\ No newline at end of file
diff --git a/LayoutTests/compositing/backing/backing-for-clipping.html b/LayoutTests/compositing/backing/backing-for-clipping.html
new file mode 100644 (file)
index 0000000..2c2b41c
--- /dev/null
@@ -0,0 +1,58 @@
+<html>
+<head>
+    <style>
+        header {
+            position: fixed;
+            left: 0px;
+            right: 0px;
+            top: 0px;
+            height: 50px;
+            width: 400px;
+            background-color: silver;
+        }
+
+        .container
+        {
+            position: absolute;
+            left: 50px;
+            top: 30px;
+            background-color: silver;
+            overflow-x: hidden;
+            overflow-y: auto;
+            width: 300px;
+            z-index: 1;        
+        }
+    
+        .child {
+            width: 100%;
+            height: 50px;
+            background-color: green;
+        }
+        
+        body.changed .composited {
+              transform: translateZ(0);
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.waitUntilDone();
+        window.addEventListener('load', () => {
+            setTimeout(() => {
+                document.body.classList.add('changed');
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }, 0)
+        }, false);
+    </script>
+</head>
+<body>
+    <header>
+        &nbsp;
+        <div class="container">
+            <div class="child">&nbsp;</div>
+            <div class="child">&nbsp;</div>
+            <div class="composited child">&nbsp;</div>
+        </div>
+    </header>
+</body>
+</html>
\ No newline at end of file
index f06a826..ad10fb5 100644 (file)
@@ -16,6 +16,7 @@ This layer should not have backing store.
             (GraphicsLayer
               (position 21.00 39.00)
               (bounds 342.00 180.00)
+              (drawsContent 1)
               (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 -0.00] [0.00 0.00 0.00 1.00])
               (children 1
                 (GraphicsLayer
index d9f560a..a054b3d 100644 (file)
@@ -16,6 +16,7 @@ This layer should not have backing store.
             (GraphicsLayer
               (position 21.00 41.00)
               (bounds 342.00 182.00)
+              (drawsContent 1)
               (childrenTransform [1.00 0.00 0.00 0.00] [0.00 1.00 0.00 0.00] [0.00 0.00 1.00 -0.00] [0.00 0.00 0.00 1.00])
               (children 1
                 (GraphicsLayer
index 0b5d449..6b8f36a 100644 (file)
         * Modules/modern-media-controls/media/pip-support.js:
         (PiPSupport.prototype.buttonWasPressed):
 
+2019-11-13  Simon Fraser  <simon.fraser@apple.com>
+
+        REGRESSION (r249434): flashy menus on wellsfargo.com
+        https://bugs.webkit.org/show_bug.cgi?id=204175
+        <rdar://problem/56654512>
+
+        Reviewed by Zalan Bujtas.
+
+        Test: compositing/backing/backing-for-clipping.html
+        
+        r249434 made overflow an "indirect compositing reason" (i.e. we composite for overflow:hidden
+        when necessary to clip a composited descendant). However this made a clause in RenderLayerCompositor::requiresOwnBackingStore()
+        return early when this reason is set, skipping the bounds check, so we need to do the bound check first.
+        This is similar to the fix in r252070.
+
+        The change to the perspective test relates to the "FIXME"; we don't use the correct ancestor for the
+        bounds check, so sometimes layers can have backing store when they don't need it until that's fixed.
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::requiresOwnBackingStore const):
+
 2019-11-11  Per Arne Vollan  <pvollan@apple.com>
 
         Many legacy animation tests are timing out with VS2019
index 972fc9c..9d45452 100644 (file)
@@ -2426,6 +2426,10 @@ bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer& layer, co
     if (layer.isComposited() && layer.backing()->hasBackingSharingLayers())
         return true;
 
+    // FIXME: We really need to keep track of the ancestor layer that has its own backing store.
+    if (!ancestorCompositedBounds.contains(layerCompositedBoundsInAncestor))
+        return true;
+
     if (layer.mustCompositeForIndirectReasons()) {
         IndirectCompositingReason reason = layer.indirectCompositingReason();
         return reason == IndirectCompositingReason::Overlap
@@ -2436,10 +2440,6 @@ bool RenderLayerCompositor::requiresOwnBackingStore(const RenderLayer& layer, co
             || reason == IndirectCompositingReason::Preserve3D; // preserve-3d has to create backing store to ensure that 3d-transformed elements intersect.
     }
 
-    // FIXME: We really need to keep track of the ancestor layer that has its own backing store.
-    if (!ancestorCompositedBounds.contains(layerCompositedBoundsInAncestor))
-        return true;
-
     return false;
 }