Changeset 238690 in webkit
- Timestamp:
- Nov 29, 2018 1:22:02 PM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r238689 r238690 1 2018-11-29 Frederic Wang <fwang@igalia.com> 2 3 Make reconcileViewportConstrainedLayerPositions start from a specified scrolling node 4 https://bugs.webkit.org/show_bug.cgi?id=180002 5 6 Reviewed by Simon Fraser. 7 8 For non-programmatic scrolling of frames, AsyncScrollingCoordinator::reconcileScrollingState 9 currently always call reconcileViewportConstrainedLayerPositions for the main frame 10 since async subframe scrolling is not supported yet (bug 171667 and bug 149264). This 11 function in turn calls reconcileLayerPositionForViewportRect on the whole scrolling tree to 12 readjust position of fixed/sticky descendants. This patch refactors a bit the code so that 13 the operation is actually only applied to the descendants of the frame's scrolling node, 14 which would mean a small optimization when subframe are asynchronously scrollable. The code 15 is already covered by reconcile-layer-position-recursive.html. 16 17 No new tests, behavior unchanged and already covered by existing tests. 18 19 * page/scrolling/AsyncScrollingCoordinator.cpp: 20 (WebCore::AsyncScrollingCoordinator::reconcileScrollingState): Pass the frame's scrolling 21 node id. 22 (WebCore::AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Start 23 reconciliation from the specified scrolling node and log its ID. 24 * page/scrolling/AsyncScrollingCoordinator.h: Add ScrollingNodeID parameter. 25 * page/scrolling/ScrollingCoordinator.h: 26 (WebCore::ScrollingCoordinator::reconcileViewportConstrainedLayerPositions): Ditto. 27 1 28 2018-11-29 Zalan Bujtas <zalan@apple.com> 2 29 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
r238665 r238690 399 399 400 400 if (!programmaticScroll && scrollingLayerPositionAction != ScrollingLayerPositionAction::Set) { 401 auto scrollingNodeID = frameView.scrollLayerID(); 401 402 if (viewportRectStability == ViewportRectStability::Stable) 402 reconcileViewportConstrainedLayerPositions( frameView.rectForFixedPositionLayout(), scrollingLayerPositionAction);403 reconcileViewportConstrainedLayerPositions(scrollingNodeID, frameView.rectForFixedPositionLayout(), scrollingLayerPositionAction); 403 404 else if (layoutViewportRect) 404 reconcileViewportConstrainedLayerPositions( LayoutRect(layoutViewportRect.value()), scrollingLayerPositionAction);405 reconcileViewportConstrainedLayerPositions(scrollingNodeID, LayoutRect(layoutViewportRect.value()), scrollingLayerPositionAction); 405 406 } 406 407 … … 489 490 } 490 491 491 void AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions(const LayoutRect& viewportRect, ScrollingLayerPositionAction action) 492 { 493 if (!m_scrollingStateTree->rootStateNode()) 494 return; 495 496 LOG_WITH_STREAM(Scrolling, stream << getCurrentProcessID() << " AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions for viewport rect " << viewportRect); 497 498 m_scrollingStateTree->rootStateNode()->reconcileLayerPositionForViewportRect(viewportRect, action); 492 void AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions(ScrollingNodeID scrollingNodeID, const LayoutRect& viewportRect, ScrollingLayerPositionAction action) 493 { 494 auto* scrollingNode = m_scrollingStateTree->stateNodeForID(scrollingNodeID); 495 if (!scrollingNode) 496 return; 497 498 LOG_WITH_STREAM(Scrolling, stream << getCurrentProcessID() << " AsyncScrollingCoordinator::reconcileViewportConstrainedLayerPositions for viewport rect " << viewportRect << " and node " << scrollingNodeID); 499 500 scrollingNode->reconcileLayerPositionForViewportRect(viewportRect, action); 499 501 } 500 502 -
trunk/Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
r219668 r238690 117 117 #endif 118 118 119 WEBCORE_EXPORT void reconcileViewportConstrainedLayerPositions( const LayoutRect& viewportRect, ScrollingLayerPositionAction) override;119 WEBCORE_EXPORT void reconcileViewportConstrainedLayerPositions(ScrollingNodeID, const LayoutRect& viewportRect, ScrollingLayerPositionAction) override; 120 120 WEBCORE_EXPORT void scrollableAreaScrollbarLayerDidChange(ScrollableArea&, ScrollbarOrientation) override; 121 121 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h
r238665 r238690 192 192 virtual void updateFrameScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, GraphicsLayer* /*counterScrollingLayer*/, GraphicsLayer* /*insetClipLayer*/, const ScrollingGeometry* = nullptr) { } 193 193 virtual void updateOverflowScrollingNode(ScrollingNodeID, GraphicsLayer* /*scrollLayer*/, GraphicsLayer* /*scrolledContentsLayer*/, const ScrollingGeometry* = nullptr) { } 194 virtual void reconcileViewportConstrainedLayerPositions( const LayoutRect&, ScrollingLayerPositionAction) { }194 virtual void reconcileViewportConstrainedLayerPositions(ScrollingNodeID, const LayoutRect&, ScrollingLayerPositionAction) { } 195 195 virtual String scrollingStateTreeAsText(ScrollingStateTreeAsTextBehavior = ScrollingStateTreeAsTextBehaviorNormal) const; 196 196 virtual bool isRubberBandInProgress() const { return false; }
Note: See TracChangeset
for help on using the changeset viewer.