Title: [252353] trunk
Revision
252353
Author
[email protected]
Date
2019-11-11 17:59:16 -0800 (Mon, 11 Nov 2019)

Log Message

Captcha images render as blank white space
https://bugs.webkit.org/show_bug.cgi?id=204013
rdar://problem/50095458

Reviewed by Zalan Bujtas.
Source/WebCore:

If updating z-order lists adds layers to the paint-order lists that have
dirty bits, we need to propagate those dirty bits up the tree so that
later dirty bit propagation doesn't stop prematurely. This could happen
when content triggered visibility, and the missing dirty bits caused
subframe layers to not get parented, resulting in missing layers with reCaptcha.
We do this by accumulating dirty bits inside of collectLayers().

Test: compositing/visibility/visibility-change-in-subframe.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::rebuildZOrderLists):
(WebCore::RenderLayer::collectLayers):
(WebCore::RenderLayer::calculateClipRects const):
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeCompositingRequirements):
(WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
(WebCore::RenderLayerCompositor::layerTreeAsText): Log so that debugging test failures is easier.

LayoutTests:

New test. Fails in WK1 because of compositing timing differences in iframes in DRT which
has a non auto-displaying window.

* compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt: Progression.
* compositing/visibility/resources/become-composited.html: Added.
* compositing/visibility/resources/frame-with-visibility-change.html: Added.
* compositing/visibility/visibility-change-in-subframe-expected.txt: Added.
* compositing/visibility/visibility-change-in-subframe.html: Added.
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt:
* platform/ios-wk2/compositing/visibility/visibility-change-in-subframe-expected.txt: Added.
* platform/mac-wk1/TestExpectations:

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (252352 => 252353)


--- trunk/LayoutTests/ChangeLog	2019-11-12 01:58:52 UTC (rev 252352)
+++ trunk/LayoutTests/ChangeLog	2019-11-12 01:59:16 UTC (rev 252353)
@@ -432,6 +432,26 @@
         * platform/mac/TestExpectations:
         * platform/wpe/TestExpectations:
 
+2019-11-11  Simon Fraser  <[email protected]>
+
+        Captcha images render as blank white space
+        https://bugs.webkit.org/show_bug.cgi?id=204013
+        rdar://problem/50095458
+
+        Reviewed by Zalan Bujtas.
+
+        New test. Fails in WK1 because of compositing timing differences in iframes in DRT which
+        has a non auto-displaying window.
+
+        * compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt: Progression.
+        * compositing/visibility/resources/become-composited.html: Added.
+        * compositing/visibility/resources/frame-with-visibility-change.html: Added.
+        * compositing/visibility/visibility-change-in-subframe-expected.txt: Added.
+        * compositing/visibility/visibility-change-in-subframe.html: Added.
+        * platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt:
+        * platform/ios-wk2/compositing/visibility/visibility-change-in-subframe-expected.txt: Added.
+        * platform/mac-wk1/TestExpectations:
+
 2019-11-07  Devin Rousso  <[email protected]>
 
         Web Inspector: REGRESSION(r250087): inspector/model/remote-object.html is timing out

Modified: trunk/LayoutTests/compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt (252352 => 252353)


--- trunk/LayoutTests/compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt	2019-11-12 01:58:52 UTC (rev 252352)
+++ trunk/LayoutTests/compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt	2019-11-12 01:59:16 UTC (rev 252353)
@@ -8,21 +8,41 @@
       (contentsOpaque 1)
       (children 1
         (GraphicsLayer
-          (position 8.00 8.00)
-          (bounds 302.00 302.00)
-          (drawsContent 1)
-          (children 1
+          (bounds 800.00 600.00)
+          (children 3
             (GraphicsLayer
-              (offsetFromRenderer width=1 height=1)
-              (position 1.00 1.00)
+              (position 9.00 9.00)
               (bounds 285.00 300.00)
               (clips 1)
               (children 1
                 (GraphicsLayer
+                  (position 20.00 20.00)
+                  (bounds 200.00 200.00)
+                  (contentsOpaque 1)
+                )
+              )
+            )
+            (GraphicsLayer
+              (bounds 800.00 600.00)
+            )
+            (GraphicsLayer
+              (position 8.00 8.00)
+              (bounds 302.00 302.00)
+              (drawsContent 1)
+              (children 1
+                (GraphicsLayer
                   (offsetFromRenderer width=1 height=1)
-                  (anchor 0.00 0.00)
-                  (bounds 285.00 1240.00)
-                  (drawsContent 1)
+                  (position 1.00 1.00)
+                  (bounds 285.00 300.00)
+                  (clips 1)
+                  (children 1
+                    (GraphicsLayer
+                      (offsetFromRenderer width=1 height=1)
+                      (anchor 0.00 0.00)
+                      (bounds 285.00 1240.00)
+                      (drawsContent 1)
+                    )
+                  )
                 )
               )
             )

Added: trunk/LayoutTests/compositing/visibility/resources/become-composited.html (0 => 252353)


--- trunk/LayoutTests/compositing/visibility/resources/become-composited.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/visibility/resources/become-composited.html	2019-11-12 01:59:16 UTC (rev 252353)
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        .box {
+            width: 100px;
+            height: 100px;
+            background-color: blue;
+        }
+        
+        .composited {
+            transform: translate3d(0, 0, 1px);
+        }
+    </style>
+    <script>
+        function doCompositingChange()
+        {
+            document.getElementById('target').classList.add('composited');
+        }
+    </script>
+</head>
+<body>
+    <p>This text and the blue box should not disappear</p>
+    <div id="target" class="box">box</div>
+</body>
+</html>

Added: trunk/LayoutTests/compositing/visibility/resources/frame-with-visibility-change.html (0 => 252353)


--- trunk/LayoutTests/compositing/visibility/resources/frame-with-visibility-change.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/visibility/resources/frame-with-visibility-change.html	2019-11-12 01:59:16 UTC (rev 252353)
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<html>
+<head>
+    <style>
+        iframe {
+            margin: 20px;
+            display: block;
+        }
+        
+        .wrapper {
+            position: absolute;
+            opacity: 0;
+            visibility: hidden;
+            z-index: 0;
+            left: 60px;
+            top: 10px;
+        }
+
+        .wrapper.visible {
+            opacity: 1;
+            visibility: visible;
+        }
+    </style>
+    <script>
+        function doVisibilityChange()
+        {
+            document.querySelector('.wrapper').classList.add('visible');
+        }
+
+        const expectedLoads = 2;
+        let receivedLoads = 0;
+        function frameLoaded()
+        {
+            if (++receivedLoads == expectedLoads)
+                window.parent.receivedLoad();
+        }
+        
+        window.addEventListener('load', () => {
+            frameLoaded();
+        }, false);
+    </script>
+</head>
+<body>
+    <div class="wrapper">
+        <div style="padding: 10px; position: fixed; top: 0px; left: 0px; background-color: magenta">fixed</div>
+        <iframe id="inner-frame" scrolling="no" width="400" src=""
+    </div>
+    <script>
+        document.getElementById('inner-frame').addEventListener('load', () => {
+            frameLoaded();
+        }, false);
+    </script>
+</body>
+</html>

Added: trunk/LayoutTests/compositing/visibility/visibility-change-in-subframe-expected.txt (0 => 252353)


--- trunk/LayoutTests/compositing/visibility/visibility-change-in-subframe-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/visibility/visibility-change-in-subframe-expected.txt	2019-11-12 01:59:16 UTC (rev 252353)
@@ -0,0 +1,96 @@
+
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 788.00 154.00)
+          (drawsContent 1)
+          (children 1
+            (GraphicsLayer
+              (position 2.00 2.00)
+              (children 1
+                (GraphicsLayer
+                  (anchor 0.00 0.00)
+                  (bounds 769.00 150.00)
+                  (children 1
+                    (GraphicsLayer
+                      (anchor 0.00 0.00)
+                      (children 1
+                        (GraphicsLayer
+                          (anchor 0.00 0.00)
+                          (bounds 769.00 204.00)
+                          (children 1
+                            (GraphicsLayer
+                              (bounds 769.00 204.00)
+                              (drawsContent 1)
+                              (children 2
+                                (GraphicsLayer
+                                  (position 80.00 30.00)
+                                  (bounds 404.00 154.00)
+                                  (drawsContent 1)
+                                  (children 1
+                                    (GraphicsLayer
+                                      (position 2.00 2.00)
+                                      (children 1
+                                        (GraphicsLayer
+                                          (anchor 0.00 0.00)
+                                          (bounds 400.00 150.00)
+                                          (children 1
+                                            (GraphicsLayer
+                                              (anchor 0.00 0.00)
+                                              (children 1
+                                                (GraphicsLayer
+                                                  (anchor 0.00 0.00)
+                                                  (bounds 400.00 158.00)
+                                                  (children 1
+                                                    (GraphicsLayer
+                                                      (bounds 400.00 158.00)
+                                                      (drawsContent 1)
+                                                      (children 1
+                                                        (GraphicsLayer
+                                                          (position 8.00 50.00)
+                                                          (bounds 100.00 100.00)
+                                                          (contentsOpaque 1)
+                                                          (drawsContent 1)
+                                                          (transform [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 1.00 1.00])
+                                                        )
+                                                      )
+                                                    )
+                                                  )
+                                                )
+                                              )
+                                            )
+                                          )
+                                        )
+                                      )
+                                    )
+                                  )
+                                )
+                                (GraphicsLayer
+                                  (bounds 52.00 38.00)
+                                  (contentsOpaque 1)
+                                  (drawsContent 1)
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/compositing/visibility/visibility-change-in-subframe.html (0 => 252353)


--- trunk/LayoutTests/compositing/visibility/visibility-change-in-subframe.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/visibility/visibility-change-in-subframe.html	2019-11-12 01:59:16 UTC (rev 252353)
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<html class="root">
+<head>
+    <style>
+        iframe {
+            width: 100%;
+        }
+    </style>
+    <script>
+        if (window.testRunner) {
+            testRunner.waitUntilDone();
+            testRunner.dumpAsText();
+        }
+
+        function runTest()
+        {
+            let firstFrameWindow = document.getElementById('frame').contentWindow;
+            let innerFrame = firstFrameWindow.document.getElementById('inner-frame').contentWindow;
+            
+            requestAnimationFrame(() => {
+                firstFrameWindow.doVisibilityChange();
+                requestAnimationFrame(() => {
+                    innerFrame.doCompositingChange();
+                    requestAnimationFrame(() => {
+                        if (window.testRunner) {
+                            document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
+                            testRunner.notifyDone();
+                        }
+                    });
+                });
+            });
+        }
+
+        const expectedLoads = 2;
+        let receivedLoads = 0;
+        function receivedLoad()
+        {
+            if (++receivedLoads == expectedLoads)
+                runTest();
+        }
+        
+        window.addEventListener('load', async () => {
+            receivedLoad();
+        }, false);
+    </script>
+</head>
+<body>
+    <iframe id="frame" src=""
+<pre id="layers"></pre>
+</body>
+</html>

Modified: trunk/LayoutTests/platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt (252352 => 252353)


--- trunk/LayoutTests/platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt	2019-11-12 01:58:52 UTC (rev 252352)
+++ trunk/LayoutTests/platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt	2019-11-12 01:59:16 UTC (rev 252353)
@@ -8,21 +8,41 @@
       (contentsOpaque 1)
       (children 1
         (GraphicsLayer
-          (position 8.00 8.00)
-          (bounds 302.00 302.00)
-          (drawsContent 1)
-          (children 1
+          (bounds 800.00 600.00)
+          (children 3
             (GraphicsLayer
-              (offsetFromRenderer width=1 height=1)
-              (position 1.00 1.00)
+              (position 9.00 9.00)
               (bounds 300.00 300.00)
               (clips 1)
               (children 1
                 (GraphicsLayer
+                  (position 20.00 20.00)
+                  (bounds 200.00 200.00)
+                  (contentsOpaque 1)
+                )
+              )
+            )
+            (GraphicsLayer
+              (bounds 800.00 600.00)
+            )
+            (GraphicsLayer
+              (position 8.00 8.00)
+              (bounds 302.00 302.00)
+              (drawsContent 1)
+              (children 1
+                (GraphicsLayer
                   (offsetFromRenderer width=1 height=1)
-                  (anchor 0.00 0.00)
-                  (bounds 300.00 1240.00)
-                  (drawsContent 1)
+                  (position 1.00 1.00)
+                  (bounds 300.00 300.00)
+                  (clips 1)
+                  (children 1
+                    (GraphicsLayer
+                      (offsetFromRenderer width=1 height=1)
+                      (anchor 0.00 0.00)
+                      (bounds 300.00 1240.00)
+                      (drawsContent 1)
+                    )
+                  )
                 )
               )
             )

Added: trunk/LayoutTests/platform/ios-wk2/compositing/visibility/visibility-change-in-subframe-expected.txt (0 => 252353)


--- trunk/LayoutTests/platform/ios-wk2/compositing/visibility/visibility-change-in-subframe-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/compositing/visibility/visibility-change-in-subframe-expected.txt	2019-11-12 01:59:16 UTC (rev 252353)
@@ -0,0 +1,95 @@
+
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 8.00)
+          (bounds 788.00 154.00)
+          (drawsContent 1)
+          (children 1
+            (GraphicsLayer
+              (position 2.00 2.00)
+              (children 1
+                (GraphicsLayer
+                  (anchor 0.00 0.00)
+                  (bounds 784.00 150.00)
+                  (children 1
+                    (GraphicsLayer
+                      (anchor 0.00 0.00)
+                      (children 1
+                        (GraphicsLayer
+                          (anchor 0.00 0.00)
+                          (bounds 784.00 204.00)
+                          (children 1
+                            (GraphicsLayer
+                              (bounds 784.00 204.00)
+                              (drawsContent 1)
+                              (children 2
+                                (GraphicsLayer
+                                  (position 80.00 30.00)
+                                  (bounds 404.00 154.00)
+                                  (drawsContent 1)
+                                  (children 1
+                                    (GraphicsLayer
+                                      (position 2.00 2.00)
+                                      (children 1
+                                        (GraphicsLayer
+                                          (anchor 0.00 0.00)
+                                          (bounds 400.00 150.00)
+                                          (children 1
+                                            (GraphicsLayer
+                                              (anchor 0.00 0.00)
+                                              (children 1
+                                                (GraphicsLayer
+                                                  (anchor 0.00 0.00)
+                                                  (bounds 400.00 160.00)
+                                                  (children 1
+                                                    (GraphicsLayer
+                                                      (bounds 400.00 160.00)
+                                                      (drawsContent 1)
+                                                      (children 1
+                                                        (GraphicsLayer
+                                                          (position 8.00 52.00)
+                                                          (bounds 100.00 100.00)
+                                                          (contentsOpaque 1)
+                                                          (drawsContent 1)
+                                                          (transform [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 1.00 1.00])
+                                                        )
+                                                      )
+                                                    )
+                                                  )
+                                                )
+                                              )
+                                            )
+                                          )
+                                        )
+                                      )
+                                    )
+                                  )
+                                )
+                                (GraphicsLayer
+                                  (bounds 53.00 40.00)
+                                  (drawsContent 1)
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+

Modified: trunk/LayoutTests/platform/mac-wk1/TestExpectations (252352 => 252353)


--- trunk/LayoutTests/platform/mac-wk1/TestExpectations	2019-11-12 01:58:52 UTC (rev 252352)
+++ trunk/LayoutTests/platform/mac-wk1/TestExpectations	2019-11-12 01:59:16 UTC (rev 252353)
@@ -372,6 +372,7 @@
 compositing/rtl/rtl-fixed-overflow-scrolled.html [ Failure ]
 compositing/iframes/overlapped-nested-iframes.html [ Pass Failure ]
 compositing/clipping/border-radius-async-overflow-non-stacking.html [ ImageOnlyFailure ]
+compositing/visibility/visibility-change-in-subframe.html [ Failure ]
 
 # Disk cache is WK2 only
 http/tests/cache/disk-cache

Modified: trunk/Source/WebCore/ChangeLog (252352 => 252353)


--- trunk/Source/WebCore/ChangeLog	2019-11-12 01:58:52 UTC (rev 252352)
+++ trunk/Source/WebCore/ChangeLog	2019-11-12 01:59:16 UTC (rev 252353)
@@ -1442,6 +1442,33 @@
         * rendering/RenderListBox.cpp:
         (WebCore::RenderListBox::scrollTo):
 
+2019-11-08  Simon Fraser  <[email protected]>
+
+        Captcha images render as blank white space
+        https://bugs.webkit.org/show_bug.cgi?id=204013
+        rdar://problem/50095458
+
+        Reviewed by Zalan Bujtas.
+        
+        If updating z-order lists adds layers to the paint-order lists that have
+        dirty bits, we need to propagate those dirty bits up the tree so that
+        later dirty bit propagation doesn't stop prematurely. This could happen
+        when content triggered visibility, and the missing dirty bits caused
+        subframe layers to not get parented, resulting in missing layers with reCaptcha.
+        We do this by accumulating dirty bits inside of collectLayers().
+
+        Test: compositing/visibility/visibility-change-in-subframe.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::rebuildZOrderLists):
+        (WebCore::RenderLayer::collectLayers):
+        (WebCore::RenderLayer::calculateClipRects const):
+        * rendering/RenderLayer.h:
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::computeCompositingRequirements):
+        (WebCore::RenderLayerCompositor::traverseUnchangedSubtree):
+        (WebCore::RenderLayerCompositor::layerTreeAsText): Log so that debugging test failures is easier.
+
 2019-11-07  Zalan Bujtas  <[email protected]>
 
         [LFC][MarginCollapsing] Drag anonymous block level boxes into margin collapsing

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (252352 => 252353)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2019-11-12 01:58:52 UTC (rev 252352)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2019-11-12 01:59:16 UTC (rev 252353)
@@ -715,7 +715,9 @@
 {
     ASSERT(layerListMutationAllowed());
     ASSERT(isDirtyStackingContext());
-    rebuildZOrderLists(m_posZOrderList, m_negZOrderList);
+    
+    OptionSet<Compositing> childDirtyFlags;
+    rebuildZOrderLists(m_posZOrderList, m_negZOrderList, childDirtyFlags);
     m_zOrderListsDirty = false;
     
     bool hasNegativeZOrderList = m_negZOrderList && m_negZOrderList->size();
@@ -727,14 +729,24 @@
         if (isComposited())
             setNeedsCompositingConfigurationUpdate();
     }
+
+    // Building lists may have added layers with dirty flags, so make sure we propagate dirty bits up the tree.
+    if (m_compositingDirtyBits.containsAll({ Compositing::DescendantsNeedRequirementsTraversal, Compositing::DescendantsNeedBackingAndHierarchyTraversal }))
+        return;
+
+    if (childDirtyFlags.containsAny(computeCompositingRequirementsFlags()))
+        setDescendantsNeedCompositingRequirementsTraversal();
+
+    if (childDirtyFlags.containsAny(updateBackingOrHierarchyFlags()))
+        setDescendantsNeedUpdateBackingAndHierarchyTraversal();
 }
 
-void RenderLayer::rebuildZOrderLists(std::unique_ptr<Vector<RenderLayer*>>& posZOrderList, std::unique_ptr<Vector<RenderLayer*>>& negZOrderList)
+void RenderLayer::rebuildZOrderLists(std::unique_ptr<Vector<RenderLayer*>>& posZOrderList, std::unique_ptr<Vector<RenderLayer*>>& negZOrderList, OptionSet<Compositing>& accumulatedDirtyFlags)
 {
     bool includeHiddenLayers = compositor().usesCompositing();
     for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) {
         if (!isReflectionLayer(*child))
-            child->collectLayers(includeHiddenLayers, posZOrderList, negZOrderList);
+            child->collectLayers(includeHiddenLayers, posZOrderList, negZOrderList, accumulatedDirtyFlags);
     }
 
     auto compareZIndex = [] (const RenderLayer* first, const RenderLayer* second) -> bool {
@@ -749,7 +761,7 @@
         std::stable_sort(negZOrderList->begin(), negZOrderList->end(), compareZIndex);
 }
 
-void RenderLayer::collectLayers(bool includeHiddenLayers, std::unique_ptr<Vector<RenderLayer*>>& positiveZOrderList, std::unique_ptr<Vector<RenderLayer*>>& negativeZOrderList)
+void RenderLayer::collectLayers(bool includeHiddenLayers, std::unique_ptr<Vector<RenderLayer*>>& positiveZOrderList, std::unique_ptr<Vector<RenderLayer*>>& negativeZOrderList, OptionSet<Compositing>& accumulatedDirtyFlags)
 {
     updateDescendantDependentFlags();
 
@@ -761,6 +773,7 @@
         if (!layerList)
             layerList = makeUnique<Vector<RenderLayer*>>();
         layerList->append(this);
+        accumulatedDirtyFlags.add(m_compositingDirtyBits);
     }
 
     // Recur into our children to collect more layers, but only if we don't establish
@@ -769,7 +782,7 @@
         for (RenderLayer* child = firstChild(); child; child = child->nextSibling()) {
             // Ignore reflections.
             if (!isReflectionLayer(*child))
-                child->collectLayers(includeHiddenLayers, positiveZOrderList, negativeZOrderList);
+                child->collectLayers(includeHiddenLayers, positiveZOrderList, negativeZOrderList, accumulatedDirtyFlags);
         }
     }
 }
@@ -6585,7 +6598,7 @@
 #endif
     }
 
-    // FIXME: RenderLayer already handles visibility changes through our visiblity dirty bits. This logic could
+    // FIXME: RenderLayer already handles visibility changes through our visibility dirty bits. This logic could
     // likely be folded along with the rest.
     if (oldStyle) {
         if (oldStyle->zIndex() != renderer().style().zIndex() || oldStyle->visibility() != renderer().style().visibility()) {

Modified: trunk/Source/WebCore/rendering/RenderLayer.h (252352 => 252353)


--- trunk/Source/WebCore/rendering/RenderLayer.h	2019-11-12 01:58:52 UTC (rev 252352)
+++ trunk/Source/WebCore/rendering/RenderLayer.h	2019-11-12 01:59:16 UTC (rev 252353)
@@ -929,8 +929,8 @@
 
     void updateZOrderLists();
     void rebuildZOrderLists();
-    void rebuildZOrderLists(std::unique_ptr<Vector<RenderLayer*>>&, std::unique_ptr<Vector<RenderLayer*>>&);
-    void collectLayers(bool includeHiddenLayers, std::unique_ptr<Vector<RenderLayer*>>&, std::unique_ptr<Vector<RenderLayer*>>&);
+    void rebuildZOrderLists(std::unique_ptr<Vector<RenderLayer*>>&, std::unique_ptr<Vector<RenderLayer*>>&, OptionSet<Compositing>&);
+    void collectLayers(bool includeHiddenLayers, std::unique_ptr<Vector<RenderLayer*>>&, std::unique_ptr<Vector<RenderLayer*>>&, OptionSet<Compositing>&);
     void clearZOrderLists();
 
     void updateNormalFlowList();

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (252352 => 252353)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-11-12 01:58:52 UTC (rev 252352)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-11-12 01:59:16 UTC (rev 252353)
@@ -864,6 +864,9 @@
 
 void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestorLayer, RenderLayer& layer, LayerOverlapMap& overlapMap, CompositingState& compositingState, BackingSharingState& backingSharingState, bool& descendantHas3DTransform)
 {
+    layer.updateDescendantDependentFlags();
+    layer.updateLayerListsIfNeeded();
+
     if (!layer.hasDescendantNeedingCompositingRequirementsTraversal()
         && !layer.needsCompositingRequirementsTraversal()
         && !compositingState.fullPaintOrderTraversalRequired
@@ -878,9 +881,6 @@
     compositingState.fullPaintOrderTraversalRequired |= layer.needsCompositingRequirementsTraversal();
     compositingState.descendantsRequireCompositingUpdate |= layer.descendantsNeedCompositingRequirementsTraversal();
 
-    layer.updateDescendantDependentFlags();
-    layer.updateLayerListsIfNeeded();
-
     layer.setHasCompositingDescendant(false);
 
     // We updated compositing for direct reasons in layerStyleChanged(). Here, check for compositing that can only be evaluated after layout.
@@ -1105,6 +1105,9 @@
 // We have to traverse unchanged layers to fill in the overlap map.
 void RenderLayerCompositor::traverseUnchangedSubtree(RenderLayer* ancestorLayer, RenderLayer& layer, LayerOverlapMap& overlapMap, CompositingState& compositingState, BackingSharingState& backingSharingState, bool& descendantHas3DTransform)
 {
+    layer.updateDescendantDependentFlags();
+    layer.updateLayerListsIfNeeded();
+
     ASSERT(!compositingState.fullPaintOrderTraversalRequired);
     ASSERT(!layer.hasDescendantNeedingCompositingRequirementsTraversal());
     ASSERT(!layer.needsCompositingRequirementsTraversal());
@@ -1111,9 +1114,6 @@
 
     LOG_WITH_STREAM(Compositing, stream << TextStream::Repeat(compositingState.depth * 2, ' ') << &layer << (layer.isNormalFlowOnly() ? " n" : " s") << " traverseUnchangedSubtree");
 
-    layer.updateDescendantDependentFlags();
-    layer.updateLayerListsIfNeeded();
-
     bool layerIsComposited = layer.isComposited();
     bool layerPaintsIntoProvidedBacking = false;
     bool didPushOverlapContainer = false;
@@ -2106,6 +2106,7 @@
 
 String RenderLayerCompositor::layerTreeAsText(LayerTreeFlags flags)
 {
+    LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor " << this << " layerTreeAsText");
     updateCompositingLayers(CompositingUpdateType::AfterLayout);
 
     if (!m_rootContentsLayer)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to