Captcha images render as blank white space
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Nov 2019 01:59:16 +0000 (01:59 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 12 Nov 2019 01:59:16 +0000 (01:59 +0000)
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:

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

13 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt
LayoutTests/compositing/visibility/resources/become-composited.html [new file with mode: 0644]
LayoutTests/compositing/visibility/resources/frame-with-visibility-change.html [new file with mode: 0644]
LayoutTests/compositing/visibility/visibility-change-in-subframe-expected.txt [new file with mode: 0644]
LayoutTests/compositing/visibility/visibility-change-in-subframe.html [new file with mode: 0644]
LayoutTests/platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/layer-for-negative-z-in-scroller-expected.txt
LayoutTests/platform/ios-wk2/compositing/visibility/visibility-change-in-subframe-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac-wk1/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerCompositor.cpp

index 4470fff..77f2119 100644 (file)
         * platform/mac/TestExpectations:
         * platform/wpe/TestExpectations:
 
+2019-11-11  Simon Fraser  <simon.fraser@apple.com>
+
+        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  <drousso@apple.com>
 
         Web Inspector: REGRESSION(r250087): inspector/model/remote-object.html is timing out
index 79e3419..8457c50 100644 (file)
@@ -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)
+                    )
+                  )
                 )
               )
             )
diff --git a/LayoutTests/compositing/visibility/resources/become-composited.html b/LayoutTests/compositing/visibility/resources/become-composited.html
new file mode 100644 (file)
index 0000000..e383c66
--- /dev/null
@@ -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>
diff --git a/LayoutTests/compositing/visibility/resources/frame-with-visibility-change.html b/LayoutTests/compositing/visibility/resources/frame-with-visibility-change.html
new file mode 100644 (file)
index 0000000..d8a7b42
--- /dev/null
@@ -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="become-composited.html"></iframe>
+    </div>
+    <script>
+        document.getElementById('inner-frame').addEventListener('load', () => {
+            frameLoaded();
+        }, false);
+    </script>
+</body>
+</html>
diff --git a/LayoutTests/compositing/visibility/visibility-change-in-subframe-expected.txt b/LayoutTests/compositing/visibility/visibility-change-in-subframe-expected.txt
new file mode 100644 (file)
index 0000000..32f1d39
--- /dev/null
@@ -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)
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
diff --git a/LayoutTests/compositing/visibility/visibility-change-in-subframe.html b/LayoutTests/compositing/visibility/visibility-change-in-subframe.html
new file mode 100644 (file)
index 0000000..c930371
--- /dev/null
@@ -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="resources/frame-with-visibility-change.html"></iframe>
+<pre id="layers"></pre>
+</body>
+</html>
index 85ccdaf..b7cdeff 100644 (file)
@@ -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)
+                    )
+                  )
                 )
               )
             )
diff --git a/LayoutTests/platform/ios-wk2/compositing/visibility/visibility-change-in-subframe-expected.txt b/LayoutTests/platform/ios-wk2/compositing/visibility/visibility-change-in-subframe-expected.txt
new file mode 100644 (file)
index 0000000..90a4cc5
--- /dev/null
@@ -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)
+                                )
+                              )
+                            )
+                          )
+                        )
+                      )
+                    )
+                  )
+                )
+              )
+            )
+          )
+        )
+      )
+    )
+  )
+)
+
index 43191a7..43668e4 100644 (file)
@@ -372,6 +372,7 @@ fast/scrolling/scroll-container-horizontally.html [ Failure ]
 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
index cfe3a68..c7e2272 100644 (file)
         * rendering/RenderListBox.cpp:
         (WebCore::RenderListBox::scrollTo):
 
+2019-11-08  Simon Fraser  <simon.fraser@apple.com>
+
+        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  <zalan@apple.com>
 
         [LFC][MarginCollapsing] Drag anonymous block level boxes into margin collapsing
index d28e6a2..f612a13 100644 (file)
@@ -715,7 +715,9 @@ void RenderLayer::rebuildZOrderLists()
 {
     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 @@ void RenderLayer::rebuildZOrderLists()
         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 @@ void RenderLayer::rebuildZOrderLists(std::unique_ptr<Vector<RenderLayer*>>& posZ
         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 @@ void RenderLayer::collectLayers(bool includeHiddenLayers, std::unique_ptr<Vector
         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 @@ void RenderLayer::collectLayers(bool includeHiddenLayers, std::unique_ptr<Vector
         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 @@ void RenderLayer::styleChanged(StyleDifference diff, const RenderStyle* oldStyle
 #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()) {
index a97c3f9..5c8ca29 100644 (file)
@@ -929,8 +929,8 @@ private:
 
     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();
index e9a9133..972fc9c 100644 (file)
@@ -864,6 +864,9 @@ static bool backingProviderLayerCanIncludeLayer(const RenderLayer& sharedLayer,
 
 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 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
     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,15 +1105,15 @@ void RenderLayerCompositor::computeCompositingRequirements(RenderLayer* ancestor
 // 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());
 
     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 @@ void RenderLayerCompositor::rootLayerConfigurationChanged()
 
 String RenderLayerCompositor::layerTreeAsText(LayerTreeFlags flags)
 {
+    LOG_WITH_STREAM(Compositing, stream << "RenderLayerCompositor " << this << " layerTreeAsText");
     updateCompositingLayers(CompositingUpdateType::AfterLayout);
 
     if (!m_rootContentsLayer)