WebKit Bugzilla
Attachment 356478 Details for
Bug 192358
: Always pass scrollingGeometry to update*ScrollingNode functions
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-192358-20181204120423.patch (text/plain), 12.81 KB, created by
Frédéric Wang (:fredw)
on 2018-12-04 03:04:25 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-12-04 03:04:25 PST
Size:
12.81 KB
patch
obsolete
>Subversion Revision: 238850 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 833ddf6130712edb11ea7991f4bb4ee18c6a3462..59945fa6fce6247c866239016c047e364e907127 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,23 @@ >+2018-12-04 Frederic Wang <fred.wang@free.fr> >+ >+ Always pass scrollingGeometry to update*ScrollingNode functions >+ https://bugs.webkit.org/show_bug.cgi?id=192358 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ No new tests, no behavior changes. >+ >+ * page/scrolling/AsyncScrollingCoordinator.cpp: >+ (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): >+ (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): >+ * page/scrolling/AsyncScrollingCoordinator.h: >+ * page/scrolling/ScrollingCoordinator.h: >+ (WebCore::ScrollingCoordinator::updateFrameScrollingNode): >+ (WebCore::ScrollingCoordinator::updateOverflowScrollingNode): >+ * rendering/RenderLayerCompositor.cpp: >+ (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): >+ (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): >+ > 2018-12-04 Devin Rousso <drousso@apple.com> > > Web Inspector: Audit: tests should support async operations >diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >index dc30a7e3681c914f91a5a39c91fb3b8594470849..8b42bf6c8d231065eb8093b4de60232fc63b7b4c 100644 >--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >@@ -512,7 +512,7 @@ void AsyncScrollingCoordinator::ensureRootStateNodeForFrameView(FrameView& frame > attachToStateTree(MainFrameScrollingNode, frameView.scrollLayerID(), 0); > } > >-void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry* scrollingGeometry) >+void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry& scrollingGeometry) > { > auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID)); > ASSERT(node); >@@ -523,18 +523,15 @@ void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, > node->setInsetClipLayer(insetClipLayer); > node->setScrolledContentsLayer(scrolledContentsLayer); > node->setCounterScrollingLayer(counterScrollingLayer); >- >- if (scrollingGeometry) { >- node->setParentRelativeScrollableRect(scrollingGeometry->parentRelativeScrollableRect); >- node->setScrollOrigin(scrollingGeometry->scrollOrigin); >- node->setScrollPosition(scrollingGeometry->scrollPosition); >- node->setTotalContentsSize(scrollingGeometry->contentSize); >- node->setReachableContentsSize(scrollingGeometry->reachableContentSize); >- node->setScrollableAreaSize(scrollingGeometry->scrollableAreaSize); >- } >+ node->setParentRelativeScrollableRect(scrollingGeometry.parentRelativeScrollableRect); >+ node->setScrollOrigin(scrollingGeometry.scrollOrigin); >+ node->setScrollPosition(scrollingGeometry.scrollPosition); >+ node->setTotalContentsSize(scrollingGeometry.contentSize); >+ node->setReachableContentsSize(scrollingGeometry.reachableContentSize); >+ node->setScrollableAreaSize(scrollingGeometry.scrollableAreaSize); > } > >-void AsyncScrollingCoordinator::updateOverflowScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry* scrollingGeometry) >+void AsyncScrollingCoordinator::updateOverflowScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry& scrollingGeometry) > { > auto* node = downcast<ScrollingStateOverflowScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID)); > ASSERT(node); >@@ -543,21 +540,18 @@ void AsyncScrollingCoordinator::updateOverflowScrollingNode(ScrollingNodeID node > > node->setLayer(layer); > node->setScrolledContentsLayer(scrolledContentsLayer); >- >- if (scrollingGeometry) { >- node->setParentRelativeScrollableRect(scrollingGeometry->parentRelativeScrollableRect); >- node->setScrollOrigin(scrollingGeometry->scrollOrigin); >- node->setScrollPosition(scrollingGeometry->scrollPosition); >- node->setTotalContentsSize(scrollingGeometry->contentSize); >- node->setReachableContentsSize(scrollingGeometry->reachableContentSize); >- node->setScrollableAreaSize(scrollingGeometry->scrollableAreaSize); >+ 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 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); >+ 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); > #endif >- } > } > > void AsyncScrollingCoordinator::updateNodeLayer(ScrollingNodeID nodeID, GraphicsLayer* graphicsLayer) >diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >index 3d64327a5cb108f001a1276bbc7eb78842cb07b5..5d678e400e59928548f38437c74f069cbcdc2fd3 100644 >--- a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >+++ b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h >@@ -104,8 +104,8 @@ private: > 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* = nullptr) override; >- WEBCORE_EXPORT void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry* = nullptr) 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 reconcileScrollingState(FrameView&, const FloatPoint&, const LayoutViewportOriginOrOverrideRect&, bool programmaticScroll, ViewportRectStability, ScrollingLayerPositionAction) override; > >diff --git a/Source/WebCore/page/scrolling/ScrollingCoordinator.h b/Source/WebCore/page/scrolling/ScrollingCoordinator.h >index a5033b7c3d45a6c89535c1ad7f3f0dde48af6f3e..f917089a5afe429c6631bd2f7157ff3eae1e0edb 100644 >--- a/Source/WebCore/page/scrolling/ScrollingCoordinator.h >+++ b/Source/WebCore/page/scrolling/ScrollingCoordinator.h >@@ -189,8 +189,8 @@ public: > #endif > }; > >- virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry* = nullptr) { } >- virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, const ScrollingGeometry* = nullptr) { } >+ 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 reconcileViewportConstrainedLayerPositions(ScrollingNodeID, const LayoutRect&, ScrollingLayerPositionAction) { } > virtual String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const; > virtual bool isRubberBandInProgress() const { return false; } >diff --git a/Source/WebCore/rendering/RenderLayerCompositor.cpp b/Source/WebCore/rendering/RenderLayerCompositor.cpp >index 208c656124375303d6f7926d9295fa69014859c6..ec2f5a0539d077a1c63f49c94b163174635984db 100644 >--- a/Source/WebCore/rendering/RenderLayerCompositor.cpp >+++ b/Source/WebCore/rendering/RenderLayerCompositor.cpp >@@ -3869,10 +3869,21 @@ void RenderLayerCompositor::detachScrollCoordinatedLayer(RenderLayer& layer, Opt > void RenderLayerCompositor::updateScrollCoordinationForThisFrame(ScrollingNodeID parentNodeID) > { > auto* scrollingCoordinator = this->scrollingCoordinator(); >- ASSERT(scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView())); >+ FrameView& frameView = m_renderView.frameView(); >+ ASSERT(scrollingCoordinator->coordinatesScrollingForFrameView(frameView)); > > ScrollingNodeID nodeID = attachScrollingNode(*m_renderView.layer(), m_renderView.frame().isMainFrame() ? MainFrameScrollingNode : SubframeScrollingNode, parentNodeID); >- scrollingCoordinator->updateFrameScrollingNode(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer()); >+ 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); >+#endif >+ scrollingCoordinator->updateFrameScrollingNode(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer(), scrollingGeometry); > } > > void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, OptionSet<LayerScrollCoordinationRole> reasons, OptionSet<ScrollingNodeChangeFlags> changes) >@@ -3951,6 +3962,7 @@ void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, Opt > return; > > ScrollingCoordinator::ScrollingGeometry scrollingGeometry; >+ // FIXME(https://webkit.org/b/172917): Pass parentRelativeScrollableRect? > scrollingGeometry.scrollOrigin = layer.scrollOrigin(); > scrollingGeometry.scrollPosition = layer.scrollPosition(); > scrollingGeometry.scrollableAreaSize = layer.visibleSize(); >@@ -3971,7 +3983,7 @@ void RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, Opt > > 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->updateOverflowScrollingNode(nodeID, backing->scrollingLayer(), backing->scrollingContentsLayer(), scrollingGeometry); > } > } else > detachScrollCoordinatedLayer(layer, Scrolling);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 192358
:
356478
|
356481
|
356517