WebKit Bugzilla
Attachment 356517 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
0001-Bug-192358-Always-pass-scrollingGeometry-to-update-S.patch (text/plain), 13.73 KB, created by
Frédéric Wang (:fredw)
on 2018-12-04 11:07:33 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Frédéric Wang (:fredw)
Created:
2018-12-04 11:07:33 PST
Size:
13.73 KB
patch
obsolete
>From e2400be4c0f4739ae01cfedaa810daff5be6c06c Mon Sep 17 00:00:00 2001 >From: Frederic Wang <fwang@igalia.com> >Date: Tue, 4 Dec 2018 15:41:39 +0100 >Subject: [PATCH xserver 1/2] Bug 192358 - Always pass scrollingGeometry to > update*ScrollingNode functions > >--- > Source/WebCore/ChangeLog | 28 +++++++++++++ > .../scrolling/AsyncScrollingCoordinator.cpp | 42 ++++++++----------- > .../scrolling/AsyncScrollingCoordinator.h | 4 +- > .../page/scrolling/ScrollingCoordinator.h | 4 +- > .../rendering/RenderLayerCompositor.cpp | 18 ++++++-- > 5 files changed, 65 insertions(+), 31 deletions(-) > >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d85b8dac7d0..7829fa2b517 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,31 @@ >+2018-12-04 Frederic Wang <fwang@igalia.com> >+ >+ Always pass scrollingGeometry to update*ScrollingNode functions >+ https://bugs.webkit.org/show_bug.cgi?id=192358 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Currently, the scrollingGeometry parameter of updateOverflowScrollingNode is always used >+ while the one of updateFrameScrollingNode is never used. Both of them are passed as possibly >+ null pointers. This commit makes things more consistent by making the parameter a reference >+ and explicitly setting the scrollingGeometry of updateFrameScrollingNode. This will help >+ other efforts (such as support for macOS/iOS asynchronous scrolling of overflow nodes / >+ subframes or for CSS overscroll-behavior) for which new data members have to be passed to the >+ scrolling nodes. >+ >+ 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 Carlos Garcia Campos <cgarcia@igalia.com> > > [SOUP] Move URLSoup back to WebCore after r238771 >diff --git a/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp b/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp >index dc30a7e3681..2638826b507 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 3d64327a5cb..5d678e400e5 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 a5033b7c3d4..f917089a5af 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 208c6561243..ec2f5a0539d 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); >-- >2.19.1 >
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