[Async overflow] Handle positioned nodes in a few more places
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Mar 2019 17:37:35 +0000 (17:37 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 19 Mar 2019 17:37:35 +0000 (17:37 +0000)
https://bugs.webkit.org/show_bug.cgi?id=195946

Reviewed by Zalan Bujtas.

When I added support for positioned nodes in the scrolling tree I missed handling
the ScrollCoordinationRole::Positioning in a few places.

I wasn't able to come up with a test for this; when a positioned node toggles between
tiled and non-tiled, hitting the code in didChangePlatformLayerForLayer(), we already
update the node with the new layer.

* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive): Logging.
* rendering/RenderLayerBacking.cpp:
(WebCore::operator<<): Logging.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): Update the node's layer.
(WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Handle detaching of this node type.

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

Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp

index b65386d..1f7370b 100644 (file)
@@ -1,3 +1,25 @@
+2019-03-19  Simon Fraser  <simon.fraser@apple.com>
+
+        [Async overflow] Handle positioned nodes in a few more places
+        https://bugs.webkit.org/show_bug.cgi?id=195946
+
+        Reviewed by Zalan Bujtas.
+
+        When I added support for positioned nodes in the scrolling tree I missed handling
+        the ScrollCoordinationRole::Positioning in a few places.
+
+        I wasn't able to come up with a test for this; when a positioned node toggles between
+        tiled and non-tiled, hitting the code in didChangePlatformLayerForLayer(), we already
+        update the node with the new layer.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::outputPaintOrderTreeRecursive): Logging.
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::operator<<): Logging.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::didChangePlatformLayerForLayer): Update the node's layer.
+        (WebCore::RenderLayerCompositor::detachScrollCoordinatedLayer): Handle detaching of this node type.
+
 2019-03-19  Alex Christensen  <achristensen@webkit.org>
 
         Make WTFLogChannelState and WTFLogLevel enum classes
index 778c17a..c78b6fc 100644 (file)
@@ -6744,6 +6744,7 @@ static void outputPaintOrderTreeRecursive(TextStream& stream, const WebCore::Ren
         auto scrollingNodeID = backing.scrollingNodeIDForRole(WebCore::ScrollCoordinationRole::Scrolling);
         auto frameHostingNodeID = backing.scrollingNodeIDForRole(WebCore::ScrollCoordinationRole::FrameHosting);
         auto viewportConstrainedNodeID = backing.scrollingNodeIDForRole(WebCore::ScrollCoordinationRole::ViewportConstrained);
+        auto positionedNodeID = backing.scrollingNodeIDForRole(WebCore::ScrollCoordinationRole::Positioning);
 
         if (scrollingNodeID || frameHostingNodeID || viewportConstrainedNodeID) {
             stream << " {";
@@ -6766,6 +6767,12 @@ static void outputPaintOrderTreeRecursive(TextStream& stream, const WebCore::Ren
                 stream << "vc " << viewportConstrainedNodeID;
             }
 
+            if (positionedNodeID) {
+                if (!first)
+                    stream << ", ";
+                stream << "pos " << positionedNodeID;
+            }
+
             stream << "}";
         }
     }
index 23bde13..6f6bb8b 100644 (file)
@@ -3135,6 +3135,8 @@ TextStream& operator<<(TextStream& ts, const RenderLayerBacking& backing)
         ts << " scrolling node " << nodeID;
     if (auto nodeID = backing.scrollingNodeIDForRole(ScrollCoordinationRole::FrameHosting))
         ts << " frame hosting node " << nodeID;
+    if (auto nodeID = backing.scrollingNodeIDForRole(ScrollCoordinationRole::Positioning))
+        ts << " positioning node " << nodeID;
     return ts;
 }
 
index 8f5ca6b..5cdfb3a 100644 (file)
@@ -552,6 +552,9 @@ void RenderLayerCompositor::didChangePlatformLayerForLayer(RenderLayer& layer, c
 
     if (auto nodeID = backing->scrollingNodeIDForRole(ScrollCoordinationRole::FrameHosting))
         scrollingCoordinator->setNodeLayers(nodeID, { backing->graphicsLayer() });
+
+    if (auto nodeID = backing->scrollingNodeIDForRole(ScrollCoordinationRole::Positioning))
+        scrollingCoordinator->setNodeLayers(nodeID, { backing->graphicsLayer() });
 }
 
 void RenderLayerCompositor::didPaintBacking(RenderLayerBacking*)
@@ -3959,6 +3962,9 @@ void RenderLayerCompositor::detachScrollCoordinatedLayer(RenderLayer& layer, Opt
     if (roles.contains(ScrollCoordinationRole::ViewportConstrained))
         detachScrollCoordinatedLayerWithRole(layer, *scrollingCoordinator, ScrollCoordinationRole::ViewportConstrained);
 
+    if (roles.contains(ScrollCoordinationRole::Positioning))
+        detachScrollCoordinatedLayerWithRole(layer, *scrollingCoordinator, ScrollCoordinationRole::Positioning);
+
     backing->detachFromScrollingCoordinator(roles);
 }