Title: [240110] trunk/Source/WebCore
Revision
240110
Author
simon.fra...@apple.com
Date
2019-01-17 08:07:24 -0800 (Thu, 17 Jan 2019)

Log Message

ScrollingCoordinator: separate updating node geometry from node layers
https://bugs.webkit.org/show_bug.cgi?id=193527

Reviewed by Antti Koivisto.

Updating scrolling tree node layers happens in a different code path from updating geometry;
the former has to be post-flush, when GraphicsLayer has made tiled or structural layers.
Geometry only needs to be updated after layout, and soon we'll do this via compositing updates.

We can also clean up the ScrollingCoordinator API and have a single function that updates
node layers (handling different node types), and separate functions for pushing viewport-constrained
and scrolling node geometry.

No observable behavior change.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setNodeLayers):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
(WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry):
(WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): Deleted.
(WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Deleted.
(WebCore::AsyncScrollingCoordinator::updateNodeLayer): Deleted.
(WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setNodeLayers):
(WebCore::ScrollingCoordinator::setScrollingNodeGeometry):
(WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry):
(WebCore::ScrollingCoordinator::updateNodeLayer): Deleted.
(WebCore::ScrollingCoordinator::updateNodeViewportConstraints): Deleted.
(WebCore::ScrollingCoordinator::updateFrameScrollingNode): Deleted.
(WebCore::ScrollingCoordinator::updateOverflowScrollingNode): Deleted.
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
* rendering/RenderLayerCompositor.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240109 => 240110)


--- trunk/Source/WebCore/ChangeLog	2019-01-17 16:06:22 UTC (rev 240109)
+++ trunk/Source/WebCore/ChangeLog	2019-01-17 16:07:24 UTC (rev 240110)
@@ -1,3 +1,42 @@
+2019-01-17  Simon Fraser  <simon.fra...@apple.com>
+
+        ScrollingCoordinator: separate updating node geometry from node layers
+        https://bugs.webkit.org/show_bug.cgi?id=193527
+
+        Reviewed by Antti Koivisto.
+
+        Updating scrolling tree node layers happens in a different code path from updating geometry;
+        the former has to be post-flush, when GraphicsLayer has made tiled or structural layers.
+        Geometry only needs to be updated after layout, and soon we'll do this via compositing updates.
+        
+        We can also clean up the ScrollingCoordinator API and have a single function that updates
+        node layers (handling different node types), and separate functions for pushing viewport-constrained
+        and scrolling node geometry.
+
+        No observable behavior change.
+
+        * page/scrolling/AsyncScrollingCoordinator.cpp:
+        (WebCore::AsyncScrollingCoordinator::setNodeLayers):
+        (WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
+        (WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry):
+        (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): Deleted.
+        (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): Deleted.
+        (WebCore::AsyncScrollingCoordinator::updateNodeLayer): Deleted.
+        (WebCore::AsyncScrollingCoordinator::updateNodeViewportConstraints): Deleted.
+        * page/scrolling/AsyncScrollingCoordinator.h:
+        * page/scrolling/ScrollingCoordinator.h:
+        (WebCore::ScrollingCoordinator::setNodeLayers):
+        (WebCore::ScrollingCoordinator::setScrollingNodeGeometry):
+        (WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry):
+        (WebCore::ScrollingCoordinator::updateNodeLayer): Deleted.
+        (WebCore::ScrollingCoordinator::updateNodeViewportConstraints): Deleted.
+        (WebCore::ScrollingCoordinator::updateFrameScrollingNode): Deleted.
+        (WebCore::ScrollingCoordinator::updateOverflowScrollingNode): Deleted.
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
+        (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
+        * rendering/RenderLayerCompositor.h:
+
 2019-01-17  Zalan Bujtas  <za...@apple.com>
 
         [LFC][BFC][Quirk] Take body padding and border into account when stretching height.

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp (240109 => 240110)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2019-01-17 16:06:22 UTC (rev 240109)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp	2019-01-17 16:07:24 UTC (rev 240110)
@@ -525,63 +525,58 @@
     attachToStateTree(ScrollingNodeType::MainFrame, frameView.scrollLayerID(), 0, 0);
 }
 
-void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry& scrollingGeometry)
+void AsyncScrollingCoordinator::setNodeLayers(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer)
 {
-    auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID));
+    auto* node = m_scrollingStateTree->stateNodeForID(nodeID);
     ASSERT(node);
     if (!node)
         return;
 
     node->setLayer(layer);
-    node->setInsetClipLayer(insetClipLayer);
-    node->setScrolledContentsLayer(scrolledContentsLayer);
-    node->setCounterScrollingLayer(counterScrollingLayer);
-    node->setParentRelativeScrollableRect(scrollingGeometry.parentRelativeScrollableRect);
-    node->setScrollOrigin(scrollingGeometry.scrollOrigin);
-    node->setScrollPosition(scrollingGeometry.scrollPosition);
-    node->setTotalContentsSize(scrollingGeometry.contentSize);
-    node->setReachableContentsSize(scrollingGeometry.reachableContentSize);
-    node->setScrollableAreaSize(scrollingGeometry.scrollableAreaSize);
+
+    if (is<ScrollingStateScrollingNode>(node)) {
+        auto& scrollingNode = downcast<ScrollingStateScrollingNode>(*node);
+        scrollingNode.setScrolledContentsLayer(scrolledContentsLayer);
+    
+        if (is<ScrollingStateFrameScrollingNode>(node)) {
+            auto& frameScrollingNode = downcast<ScrollingStateFrameScrollingNode>(*node);
+            frameScrollingNode.setInsetClipLayer(insetClipLayer);
+            frameScrollingNode.setCounterScrollingLayer(counterScrollingLayer);
+        }
+    }
 }
-    
-void AsyncScrollingCoordinator::updateOverflowScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry& scrollingGeometry)
+
+void AsyncScrollingCoordinator::setScrollingNodeGeometry(ScrollingNodeID nodeID, const ScrollingGeometry& scrollingGeometry)
 {
-    auto* node = downcast<ScrollingStateOverflowScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID));
-    ASSERT(node);
-    if (!node)
+    auto* scrollingNode = downcast<ScrollingStateScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID));
+    ASSERT(scrollingNode);
+    if (!scrollingNode)
         return;
 
-    node->setLayer(layer);
-    node->setScrolledContentsLayer(scrolledContentsLayer);
-    node->setParentRelativeScrollableRect(scrollingGeometry.parentRelativeScrollableRect);
-    node->setScrollOrigin(scrollingGeometry.scrollOrigin);
-    node->setScrollPosition(scrollingGeometry.scrollPosition);
-    node->setTotalContentsSize(scrollingGeometry.contentSize);
-    node->setReachableContentsSize(scrollingGeometry.reachableContentSize);
-    node->setScrollableAreaSize(scrollingGeometry.scrollableAreaSize);
+    scrollingNode->setParentRelativeScrollableRect(scrollingGeometry.parentRelativeScrollableRect);
+    scrollingNode->setScrollOrigin(scrollingGeometry.scrollOrigin);
+    scrollingNode->setScrollPosition(scrollingGeometry.scrollPosition);
+    scrollingNode->setTotalContentsSize(scrollingGeometry.contentSize);
+    scrollingNode->setReachableContentsSize(scrollingGeometry.reachableContentSize);
+    scrollingNode->setScrollableAreaSize(scrollingGeometry.scrollableAreaSize);
+
 #if ENABLE(CSS_SCROLL_SNAP)
-    setStateScrollingNodeSnapOffsetsAsFloat(*node, ScrollEventAxis::Horizontal, &scrollingGeometry.horizontalSnapOffsets, &scrollingGeometry.horizontalSnapOffsetRanges, m_page->deviceScaleFactor());
-    setStateScrollingNodeSnapOffsetsAsFloat(*node, ScrollEventAxis::Vertical, &scrollingGeometry.verticalSnapOffsets, &scrollingGeometry.verticalSnapOffsetRanges, m_page->deviceScaleFactor());
-    node->setCurrentHorizontalSnapPointIndex(scrollingGeometry.currentHorizontalSnapPointIndex);
-    node->setCurrentVerticalSnapPointIndex(scrollingGeometry.currentVerticalSnapPointIndex);
+    // updateScrollSnapPropertiesWithFrameView() sets these for frame scrolling nodes. FIXME: Why the difference?
+    if (is<ScrollingStateOverflowScrollingNode>(scrollingNode)) {
+        setStateScrollingNodeSnapOffsetsAsFloat(*scrollingNode, ScrollEventAxis::Horizontal, &scrollingGeometry.horizontalSnapOffsets, &scrollingGeometry.horizontalSnapOffsetRanges, m_page->deviceScaleFactor());
+        setStateScrollingNodeSnapOffsetsAsFloat(*scrollingNode, ScrollEventAxis::Vertical, &scrollingGeometry.verticalSnapOffsets, &scrollingGeometry.verticalSnapOffsetRanges, m_page->deviceScaleFactor());
+        scrollingNode->setCurrentHorizontalSnapPointIndex(scrollingGeometry.currentHorizontalSnapPointIndex);
+        scrollingNode->setCurrentVerticalSnapPointIndex(scrollingGeometry.currentVerticalSnapPointIndex);
+    }
 #endif
 }
 
-void AsyncScrollingCoordinator::updateNodeLayer(ScrollingNodeID nodeID, GraphicsLayer* graphicsLayer)
+void AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry(ScrollingNodeID nodeID, const ViewportConstraints& constraints)
 {
     auto* node = m_scrollingStateTree->stateNodeForID(nodeID);
     if (!node)
         return;
 
-    node->setLayer(graphicsLayer);
-}
-
-void AsyncScrollingCoordinator::updateNodeViewportConstraints(ScrollingNodeID nodeID, const ViewportConstraints& constraints)
-{
-    auto* node = m_scrollingStateTree->stateNodeForID(nodeID);
-    if (!node)
-        return;
-
     switch (constraints.constraintType()) {
     case ViewportConstraints::FixedPositionConstraint: {
         auto& fixedNode = downcast<ScrollingStateFixedNode>(*node);

Modified: trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h (240109 => 240110)


--- trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2019-01-17 16:06:22 UTC (rev 240109)
+++ trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h	2019-01-17 16:07:24 UTC (rev 240110)
@@ -101,12 +101,10 @@
     WEBCORE_EXPORT void detachFromStateTree(ScrollingNodeID) override;
     WEBCORE_EXPORT void clearStateTree() override;
     
-    WEBCORE_EXPORT void updateNodeLayer(ScrollingNodeID, GraphicsLayer*) override;
-    WEBCORE_EXPORT void updateNodeViewportConstraints(ScrollingNodeID, const ViewportConstraints&) override;
-    
-    WEBCORE_EXPORT void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry&) override;
-    WEBCORE_EXPORT void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry&) override;
-    
+    WEBCORE_EXPORT void setNodeLayers(ScrollingNodeID, GraphicsLayer* /*layer*/, GraphicsLayer* /*scrolledContentsLayer*/ = nullptr, GraphicsLayer* /*counterScrollingLayer*/ = nullptr, GraphicsLayer* /*insetClipLayer*/ = nullptr) override;
+    WEBCORE_EXPORT void setScrollingNodeGeometry(ScrollingNodeID, const ScrollingGeometry&) override;
+    WEBCORE_EXPORT void setViewportConstraintedNodeGeometry(ScrollingNodeID, const ViewportConstraints&) override;
+
     WEBCORE_EXPORT void reconcileScrollingState(FrameView&, const FloatPoint&, const LayoutViewportOriginOrOverrideRect&, bool programmaticScroll, ViewportRectStability, ScrollingLayerPositionAction) override;
 
     bool isRubberBandInProgress() const override;

Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (240109 => 240110)


--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2019-01-17 16:06:22 UTC (rev 240109)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h	2019-01-17 16:07:24 UTC (rev 240110)
@@ -172,8 +172,7 @@
     virtual void detachFromStateTree(ScrollingNodeID) { }
     virtual void clearStateTree() { }
 
-    virtual void updateNodeLayer(ScrollingNodeID, GraphicsLayer*) { }
-    virtual void updateNodeViewportConstraints(ScrollingNodeID, const ViewportConstraints&) { }
+    virtual void setNodeLayers(ScrollingNodeID, GraphicsLayer* /*layer*/, GraphicsLayer* /*scrolledContentsLayer*/ = nullptr, GraphicsLayer* /*counterScrollingLayer*/ = nullptr, GraphicsLayer* /*insetClipLayer*/ = nullptr) { }
 
     struct ScrollingGeometry {
         LayoutRect parentRelativeScrollableRect;
@@ -192,8 +191,9 @@
 #endif
     };
 
-    virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry&) { }
-    virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, const ScrollingGeometry&) { }
+    virtual void setScrollingNodeGeometry(ScrollingNodeID, const ScrollingGeometry&) { }
+    virtual void setViewportConstraintedNodeGeometry(ScrollingNodeID, const ViewportConstraints&) { }
+
     virtual void reconcileViewportConstrainedLayerPositions(ScrollingNodeID, const LayoutRect&, ScrollingLayerPositionAction) { }
     virtual String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const;
     virtual bool isRubberBandInProgress() const { return false; }

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (240109 => 240110)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-01-17 16:06:22 UTC (rev 240109)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-01-17 16:07:24 UTC (rev 240110)
@@ -3846,7 +3846,7 @@
     backing->detachFromScrollingCoordinator(roles);
 }
 
-void RenderLayerCompositor::updateScrollCoordinationForThisFrame(ScrollingNodeID parentNodeID)
+void RenderLayerCompositor::updateScrollCoordinationForThisFrame(ScrollingNodeID parentNodeID, OptionSet<ScrollingNodeChangeFlags> changes)
 {
     auto* scrollingCoordinator = this->scrollingCoordinator();
     FrameView& frameView = m_renderView.frameView();
@@ -3853,17 +3853,23 @@
     ASSERT(scrollingCoordinator->coordinatesScrollingForFrameView(frameView));
 
     ScrollingNodeID nodeID = attachScrollingNode(*m_renderView.layer(), m_renderView.frame().isMainFrame() ? ScrollingNodeType::MainFrame : ScrollingNodeType::Subframe, parentNodeID);
-    ScrollingCoordinator::ScrollingGeometry scrollingGeometry;
-    // FIXME(https://webkit.org/b/172917): Pass parentRelativeScrollableRect?
-    scrollingGeometry.scrollOrigin = frameView.scrollOrigin();
-    scrollingGeometry.scrollableAreaSize = frameView.visibleContentRect().size();
-    scrollingGeometry.contentSize = frameView.totalContentsSize();
-    scrollingGeometry.reachableContentSize = frameView.totalContentsSize();
+
+    if (changes & ScrollingNodeChangeFlags::Layer)
+        scrollingCoordinator->setNodeLayers(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer());
+
+    if (changes & ScrollingNodeChangeFlags::LayerGeometry) {
+        ScrollingCoordinator::ScrollingGeometry scrollingGeometry;
+        // FIXME(https://webkit.org/b/172917): Pass parentRelativeScrollableRect?
+        scrollingGeometry.scrollOrigin = frameView.scrollOrigin();
+        scrollingGeometry.scrollableAreaSize = frameView.visibleContentRect().size();
+        scrollingGeometry.contentSize = frameView.totalContentsSize();
+        scrollingGeometry.reachableContentSize = frameView.totalContentsSize();
 #if ENABLE(CSS_SCROLL_SNAP)
-    frameView.updateSnapOffsets();
-    scrollingCoordinator->updateScrollSnapPropertiesWithFrameView(frameView);
+        frameView.updateSnapOffsets();
+        scrollingCoordinator->updateScrollSnapPropertiesWithFrameView(frameView);
 #endif
-    scrollingCoordinator->updateFrameScrollingNode(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer(), scrollingGeometry);
+        scrollingCoordinator->setScrollingNodeGeometry(nodeID, scrollingGeometry);
+    }
 }
 
 void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, OptionSet<ScrollCoordinationRole> roles, OptionSet<ScrollingNodeChangeFlags> changes)
@@ -3882,7 +3888,7 @@
         if (!parentDocumentHostingNodeID)
             return;
 
-        updateScrollCoordinationForThisFrame(parentDocumentHostingNodeID);
+        updateScrollCoordinationForThisFrame(parentDocumentHostingNodeID, changes);
         if (!(roles.contains(ScrollCoordinationRole::ViewportConstrained)) && isRenderViewLayer)
             return;
     }
@@ -3911,15 +3917,15 @@
         LOG_WITH_STREAM(Compositing, stream << "Registering ViewportConstrained " << nodeType << " node " << nodeID << " (layer " << backing->graphicsLayer()->primaryLayerID() << ") as child of " << parentNodeID);
 
         if (changes & ScrollingNodeChangeFlags::Layer)
-            scrollingCoordinator->updateNodeLayer(nodeID, backing->graphicsLayer());
+            scrollingCoordinator->setNodeLayers(nodeID, backing->graphicsLayer());
 
         if (changes & ScrollingNodeChangeFlags::LayerGeometry) {
             switch (nodeType) {
             case ScrollingNodeType::Fixed:
-                scrollingCoordinator->updateNodeViewportConstraints(nodeID, computeFixedViewportConstraints(layer));
+                scrollingCoordinator->setViewportConstraintedNodeGeometry(nodeID, computeFixedViewportConstraints(layer));
                 break;
             case ScrollingNodeType::Sticky:
-                scrollingCoordinator->updateNodeViewportConstraints(nodeID, computeStickyViewportConstraints(layer));
+                scrollingCoordinator->setViewportConstraintedNodeGeometry(nodeID, computeStickyViewportConstraints(layer));
                 break;
             case ScrollingNodeType::MainFrame:
             case ScrollingNodeType::Subframe:
@@ -3934,7 +3940,7 @@
         
     if (roles.contains(ScrollCoordinationRole::Scrolling)) {
         if (isRenderViewLayer)
-            updateScrollCoordinationForThisFrame(parentNodeID);
+            updateScrollCoordinationForThisFrame(parentNodeID, changes);
         else {
             ScrollingNodeType nodeType = ScrollingNodeType::Overflow;
             ScrollingNodeID nodeID = attachScrollingNode(layer, nodeType, parentNodeID);
@@ -3941,29 +3947,34 @@
             if (!nodeID)
                 return;
 
-            ScrollingCoordinator::ScrollingGeometry scrollingGeometry;
-            // FIXME(https://webkit.org/b/172917): Pass parentRelativeScrollableRect?
-            scrollingGeometry.scrollOrigin = layer.scrollOrigin();
-            scrollingGeometry.scrollPosition = layer.scrollPosition();
-            scrollingGeometry.scrollableAreaSize = layer.visibleSize();
-            scrollingGeometry.contentSize = layer.contentsSize();
-            scrollingGeometry.reachableContentSize = layer.scrollableContentsSize();
+            if (changes & ScrollingNodeChangeFlags::Layer)
+                scrollingCoordinator->setNodeLayers(nodeID, backing->scrollingLayer(), backing->scrollingContentsLayer());
+
+            if (changes & ScrollingNodeChangeFlags::LayerGeometry) {
+                ScrollingCoordinator::ScrollingGeometry scrollingGeometry;
+                // FIXME(https://webkit.org/b/172917): Pass parentRelativeScrollableRect?
+                scrollingGeometry.scrollOrigin = layer.scrollOrigin();
+                scrollingGeometry.scrollPosition = layer.scrollPosition();
+                scrollingGeometry.scrollableAreaSize = layer.visibleSize();
+                scrollingGeometry.contentSize = layer.contentsSize();
+                scrollingGeometry.reachableContentSize = layer.scrollableContentsSize();
 #if ENABLE(CSS_SCROLL_SNAP)
-            if (const Vector<LayoutUnit>* offsets = layer.horizontalSnapOffsets())
-                scrollingGeometry.horizontalSnapOffsets = *offsets;
-            if (const Vector<LayoutUnit>* offsets = layer.verticalSnapOffsets())
-                scrollingGeometry.verticalSnapOffsets = *offsets;
-            if (const Vector<ScrollOffsetRange<LayoutUnit>>* ranges = layer.horizontalSnapOffsetRanges())
-                scrollingGeometry.horizontalSnapOffsetRanges = *ranges;
-            if (const Vector<ScrollOffsetRange<LayoutUnit>>* ranges = layer.verticalSnapOffsetRanges())
-                scrollingGeometry.verticalSnapOffsetRanges = *ranges;
-            scrollingGeometry.currentHorizontalSnapPointIndex = layer.currentHorizontalSnapPointIndex();
-            scrollingGeometry.currentVerticalSnapPointIndex = layer.currentVerticalSnapPointIndex();
+                if (const Vector<LayoutUnit>* offsets = layer.horizontalSnapOffsets())
+                    scrollingGeometry.horizontalSnapOffsets = *offsets;
+                if (const Vector<LayoutUnit>* offsets = layer.verticalSnapOffsets())
+                    scrollingGeometry.verticalSnapOffsets = *offsets;
+                if (const Vector<ScrollOffsetRange<LayoutUnit>>* ranges = layer.horizontalSnapOffsetRanges())
+                    scrollingGeometry.horizontalSnapOffsetRanges = *ranges;
+                if (const Vector<ScrollOffsetRange<LayoutUnit>>* ranges = layer.verticalSnapOffsetRanges())
+                    scrollingGeometry.verticalSnapOffsetRanges = *ranges;
+                scrollingGeometry.currentHorizontalSnapPointIndex = layer.currentHorizontalSnapPointIndex();
+                scrollingGeometry.currentVerticalSnapPointIndex = layer.currentVerticalSnapPointIndex();
 #endif
 
-            LOG(Compositing, "Registering Scrolling scrolling node %" PRIu64 " (layer %" PRIu64 ") as child of %" PRIu64, nodeID, backing->graphicsLayer()->primaryLayerID(), parentNodeID);
+                LOG(Compositing, "Registering Scrolling scrolling node %" PRIu64 " (layer %" PRIu64 ") as child of %" PRIu64, nodeID, backing->graphicsLayer()->primaryLayerID(), parentNodeID);
 
-            scrollingCoordinator->updateOverflowScrollingNode(nodeID, backing->scrollingLayer(), backing->scrollingContentsLayer(), scrollingGeometry);
+                scrollingCoordinator->setScrollingNodeGeometry(nodeID, scrollingGeometry);
+            }
         }
     } else
         detachScrollCoordinatedLayer(layer, ScrollCoordinationRole::Scrolling);

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.h (240109 => 240110)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2019-01-17 16:06:22 UTC (rev 240109)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.h	2019-01-17 16:07:24 UTC (rev 240110)
@@ -474,7 +474,7 @@
 
     void updateCustomLayersAfterFlush();
 
-    void updateScrollCoordinationForThisFrame(ScrollingNodeID);
+    void updateScrollCoordinationForThisFrame(ScrollingNodeID, OptionSet<ScrollingNodeChangeFlags>);
     ScrollingNodeID attachScrollingNode(RenderLayer&, ScrollingNodeType, ScrollingNodeID parentNodeID);
     void updateScrollCoordinatedLayer(RenderLayer&, OptionSet<ScrollCoordinationRole>, OptionSet<ScrollingNodeChangeFlags>);
     void detachScrollCoordinatedLayer(RenderLayer&, OptionSet<ScrollCoordinationRole>);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to