Changeset 238885 in webkit
- Timestamp:
- Dec 4, 2018 7:58:01 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r238880 r238885 1 2018-12-04 Frederic Wang <fwang@igalia.com> 2 3 Always pass scrollingGeometry to update*ScrollingNode functions 4 https://bugs.webkit.org/show_bug.cgi?id=192358 5 6 Reviewed by Simon Fraser. 7 8 Currently, the scrollingGeometry parameter of updateOverflowScrollingNode is always used 9 while the one of updateFrameScrollingNode is never used. Both of them are passed as possibly 10 null pointers. This commit makes things more consistent by making the parameter a reference 11 and explicitly setting the scrollingGeometry of updateFrameScrollingNode. This will help 12 other efforts (such as support for macOS/iOS asynchronous scrolling of overflow nodes / 13 subframes or for CSS overscroll-behavior) for which new data members have to be passed to the 14 scrolling nodes. 15 16 No new tests, no behavior changes. 17 18 * page/scrolling/AsyncScrollingCoordinator.cpp: 19 (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode): 20 (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode): 21 * page/scrolling/AsyncScrollingCoordinator.h: 22 * page/scrolling/ScrollingCoordinator.h: 23 (WebCore::ScrollingCoordinator::updateFrameScrollingNode): 24 (WebCore::ScrollingCoordinator::updateOverflowScrollingNode): 25 * rendering/RenderLayerCompositor.cpp: 26 (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): 27 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): 28 1 29 2018-12-04 Ryosuke Niwa <rniwa@webkit.org> 2 30 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r238690 r238885 513 513 } 514 514 515 void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry *scrollingGeometry)515 void AsyncScrollingCoordinator::updateFrameScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry& scrollingGeometry) 516 516 { 517 517 auto* node = downcast<ScrollingStateFrameScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID)); … … 524 524 node->setScrolledContentsLayer(scrolledContentsLayer); 525 525 node->setCounterScrollingLayer(counterScrollingLayer); 526 527 if (scrollingGeometry) { 528 node->setParentRelativeScrollableRect(scrollingGeometry->parentRelativeScrollableRect); 529 node->setScrollOrigin(scrollingGeometry->scrollOrigin); 530 node->setScrollPosition(scrollingGeometry->scrollPosition); 531 node->setTotalContentsSize(scrollingGeometry->contentSize); 532 node->setReachableContentsSize(scrollingGeometry->reachableContentSize); 533 node->setScrollableAreaSize(scrollingGeometry->scrollableAreaSize); 534 } 535 } 536 537 void AsyncScrollingCoordinator::updateOverflowScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry* scrollingGeometry) 526 node->setParentRelativeScrollableRect(scrollingGeometry.parentRelativeScrollableRect); 527 node->setScrollOrigin(scrollingGeometry.scrollOrigin); 528 node->setScrollPosition(scrollingGeometry.scrollPosition); 529 node->setTotalContentsSize(scrollingGeometry.contentSize); 530 node->setReachableContentsSize(scrollingGeometry.reachableContentSize); 531 node->setScrollableAreaSize(scrollingGeometry.scrollableAreaSize); 532 } 533 534 void AsyncScrollingCoordinator::updateOverflowScrollingNode(ScrollingNodeID nodeID, GraphicsLayer* layer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry& scrollingGeometry) 538 535 { 539 536 auto* node = downcast<ScrollingStateOverflowScrollingNode>(m_scrollingStateTree->stateNodeForID(nodeID)); … … 544 541 node->setLayer(layer); 545 542 node->setScrolledContentsLayer(scrolledContentsLayer); 546 547 if (scrollingGeometry) { 548 node->setParentRelativeScrollableRect(scrollingGeometry->parentRelativeScrollableRect); 549 node->setScrollOrigin(scrollingGeometry->scrollOrigin); 550 node->setScrollPosition(scrollingGeometry->scrollPosition); 551 node->setTotalContentsSize(scrollingGeometry->contentSize); 552 node->setReachableContentsSize(scrollingGeometry->reachableContentSize); 553 node->setScrollableAreaSize(scrollingGeometry->scrollableAreaSize); 543 node->setParentRelativeScrollableRect(scrollingGeometry.parentRelativeScrollableRect); 544 node->setScrollOrigin(scrollingGeometry.scrollOrigin); 545 node->setScrollPosition(scrollingGeometry.scrollPosition); 546 node->setTotalContentsSize(scrollingGeometry.contentSize); 547 node->setReachableContentsSize(scrollingGeometry.reachableContentSize); 548 node->setScrollableAreaSize(scrollingGeometry.scrollableAreaSize); 554 549 #if ENABLE(CSS_SCROLL_SNAP) 555 setStateScrollingNodeSnapOffsetsAsFloat(*node, ScrollEventAxis::Horizontal, &scrollingGeometry->horizontalSnapOffsets, &scrollingGeometry->horizontalSnapOffsetRanges, m_page->deviceScaleFactor()); 556 setStateScrollingNodeSnapOffsetsAsFloat(*node, ScrollEventAxis::Vertical, &scrollingGeometry->verticalSnapOffsets, &scrollingGeometry->verticalSnapOffsetRanges, m_page->deviceScaleFactor()); 557 node->setCurrentHorizontalSnapPointIndex(scrollingGeometry->currentHorizontalSnapPointIndex); 558 node->setCurrentVerticalSnapPointIndex(scrollingGeometry->currentVerticalSnapPointIndex); 559 #endif 560 } 550 setStateScrollingNodeSnapOffsetsAsFloat(*node, ScrollEventAxis::Horizontal, &scrollingGeometry.horizontalSnapOffsets, &scrollingGeometry.horizontalSnapOffsetRanges, m_page->deviceScaleFactor()); 551 setStateScrollingNodeSnapOffsetsAsFloat(*node, ScrollEventAxis::Vertical, &scrollingGeometry.verticalSnapOffsets, &scrollingGeometry.verticalSnapOffsetRanges, m_page->deviceScaleFactor()); 552 node->setCurrentHorizontalSnapPointIndex(scrollingGeometry.currentHorizontalSnapPointIndex); 553 node->setCurrentVerticalSnapPointIndex(scrollingGeometry.currentVerticalSnapPointIndex); 554 #endif 561 555 } 562 556 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r238690 r238885 105 105 WEBCORE_EXPORT void updateNodeViewportConstraints(ScrollingNodeID, const ViewportConstraints&) override; 106 106 107 WEBCORE_EXPORT void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry * = nullptr) override;108 WEBCORE_EXPORT void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry * = nullptr) override;107 WEBCORE_EXPORT void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, GraphicsLayer* counterScrollingLayer, GraphicsLayer* insetClipLayer, const ScrollingGeometry&) override; 108 WEBCORE_EXPORT void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* scrollLayer, GraphicsLayer* scrolledContentsLayer, const ScrollingGeometry&) override; 109 109 110 110 WEBCORE_EXPORT void reconcileScrollingState(FrameView&, const FloatPoint&, const LayoutViewportOriginOrOverrideRect&, bool programmaticScroll, ViewportRectStability, ScrollingLayerPositionAction) override; -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r238690 r238885 190 190 }; 191 191 192 virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry * = nullptr) { }193 virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, const ScrollingGeometry * = nullptr) { }192 virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry&) { } 193 virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, const ScrollingGeometry&) { } 194 194 virtual void reconcileViewportConstrainedLayerPositions(ScrollingNodeID, const LayoutRect&, ScrollingLayerPositionAction) { } 195 195 virtual String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const; -
trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp
r238876 r238885 3870 3870 { 3871 3871 auto* scrollingCoordinator = this->scrollingCoordinator(); 3872 ASSERT(scrollingCoordinator->coordinatesScrollingForFrameView(m_renderView.frameView())); 3872 FrameView& frameView = m_renderView.frameView(); 3873 ASSERT(scrollingCoordinator->coordinatesScrollingForFrameView(frameView)); 3873 3874 3874 3875 ScrollingNodeID nodeID = attachScrollingNode(*m_renderView.layer(), m_renderView.frame().isMainFrame() ? MainFrameScrollingNode : SubframeScrollingNode, parentNodeID); 3875 scrollingCoordinator->updateFrameScrollingNode(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer()); 3876 ScrollingCoordinator::ScrollingGeometry scrollingGeometry; 3877 // FIXME(https://webkit.org/b/172917): Pass parentRelativeScrollableRect? 3878 scrollingGeometry.scrollOrigin = frameView.scrollOrigin(); 3879 scrollingGeometry.scrollableAreaSize = frameView.visibleContentRect().size(); 3880 scrollingGeometry.contentSize = frameView.totalContentsSize(); 3881 scrollingGeometry.reachableContentSize = frameView.totalContentsSize(); 3882 #if ENABLE(CSS_SCROLL_SNAP) 3883 frameView.updateSnapOffsets(); 3884 scrollingCoordinator->updateScrollSnapPropertiesWithFrameView(frameView); 3885 #endif 3886 scrollingCoordinator->updateFrameScrollingNode(nodeID, m_scrollLayer.get(), m_rootContentLayer.get(), fixedRootBackgroundLayer(), clipLayer(), scrollingGeometry); 3876 3887 } 3877 3888 … … 3952 3963 3953 3964 ScrollingCoordinator::ScrollingGeometry scrollingGeometry; 3965 // FIXME(https://webkit.org/b/172917): Pass parentRelativeScrollableRect? 3954 3966 scrollingGeometry.scrollOrigin = layer.scrollOrigin(); 3955 3967 scrollingGeometry.scrollPosition = layer.scrollPosition(); … … 3972 3984 LOG(Compositing, "Registering Scrolling scrolling node %" PRIu64 " (layer %" PRIu64 ") as child of %" PRIu64, nodeID, backing->graphicsLayer()->primaryLayerID(), parentNodeID); 3973 3985 3974 scrollingCoordinator->updateOverflowScrollingNode(nodeID, backing->scrollingLayer(), backing->scrollingContentsLayer(), &scrollingGeometry);3986 scrollingCoordinator->updateOverflowScrollingNode(nodeID, backing->scrollingLayer(), backing->scrollingContentsLayer(), scrollingGeometry); 3975 3987 } 3976 3988 } else
Note: See TracChangeset
for help on using the changeset viewer.