Share more code for updating the state of frame scrolling nodes
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2019 00:36:57 +0000 (00:36 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2019 00:36:57 +0000 (00:36 +0000)
commitf4bcd4d3f626e1d36e27119bf9e68fb8d6f435da
tree1d00cdb83c0486348f196d749899e3b5dfb252b0
parenta37a3c5f321d07dc001328a09651b2e141deff9e
Share more code for updating the state of frame scrolling nodes
https://bugs.webkit.org/show_bug.cgi?id=195254

Reviewed by Antti Koivisto.
Source/WebCore:

Responsibility for updating state on ScrollingStateFrameScrolling nodes was split between
AsyncScrollingCoordinator::frameViewLayoutUpdated(), which is called post-layout, and
RenderLayerCompositor. This patch gives that responsibility entirely to RenderLayerCompositor,
ensuring that we update frame scrolling nodes at the same time as the rest of the scrolling
state tree.

We also share code between updating ScrollingStateFrameScrollingNodes and
ScrollingStateOverflowScrollingNodews, since both can be updated from a ScrollableArea.
Some minor cleanup of ScrollableArea is doing to help. For the first time, we're pushing
ScrollableAreaParameters for overflow scrolling nodes, allowing rubber-banding to work
on macOS.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewLayoutUpdated):
(WebCore::AsyncScrollingCoordinator::setRectRelativeToParentNode):
(WebCore::AsyncScrollingCoordinator::setFrameScrollingNodeState):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
(WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeConstraints):
(WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry): Deleted.
(WebCore::AsyncScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::setRectRelativeToParentNode):
(WebCore::ScrollingCoordinator::setScrollingNodeScrollableAreaGeometry):
(WebCore::ScrollingCoordinator::setFrameScrollingNodeState):
(WebCore::ScrollingCoordinator::setViewportConstraintedNodeConstraints):
(WebCore::ScrollingCoordinator::setScrollingNodeGeometry): Deleted.
(WebCore::ScrollingCoordinator::setViewportConstraintedNodeGeometry): Deleted.
* platform/ScrollView.h:
(WebCore::ScrollView::horizontalScrollbarMode const): Deleted.
(WebCore::ScrollView::verticalScrollbarMode const): Deleted.
* platform/ScrollableArea.cpp:
(WebCore::ScrollableArea::reachableTotalContentsSize const):
* platform/ScrollableArea.h:
(WebCore::ScrollableArea::horizontalScrollbarMode const):
(WebCore::ScrollableArea::verticalScrollbarMode const):
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::overhangAmount const):
(WebCore::RenderLayer::reachableTotalContentsSize const):
(WebCore::RenderLayer::scrollableContentsSize const): Deleted.
* rendering/RenderLayer.h:
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::updateCompositingLayers):
(WebCore::RenderLayerCompositor::updateBackingAndHierarchy):
(WebCore::RenderLayerCompositor::updateScrollingNodeForViewportConstrainedRole):
(WebCore::RenderLayerCompositor::rootParentRelativeScrollableRect const):
(WebCore::RenderLayerCompositor::parentRelativeScrollableRect const):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
(WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const): Deleted.
(WebCore::RenderLayerCompositor::computeFrameHostingGeometry const): Deleted.
(WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const): Deleted.
* rendering/RenderLayerCompositor.h:

LayoutTests:

New baselines. Overflow nodes get some state from ScrollableAreaParameters now, and
frame nodes get the current scroll position (which is good, since they already have
the new layout viewport).

* fast/scrolling/ios/change-scrollability-on-content-resize-expected.txt:
* fast/scrolling/ios/change-scrollability-on-content-resize-nested-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt:
* scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt:
* scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt:
* tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt:
* tiled-drawing/scrolling/fixed/four-bars.html:
* tiled-drawing/scrolling/fixed/nested-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt:
* tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242333 268f45cc-cd09-0410-ab3c-d52691b4dbfc
45 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/scrolling/ios/change-scrollability-on-content-resize-expected.txt
LayoutTests/fast/scrolling/ios/change-scrollability-on-content-resize-nested-expected.txt
LayoutTests/fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-expected.txt
LayoutTests/fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up-expected.txt
LayoutTests/platform/ios-wk2/TestExpectations
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/fixed-inside-frame-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/gain-scrolling-node-parent-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/lose-scrolling-node-parent-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/overflow-in-fixed-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/remove-scrolling-role-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/reparent-across-compositing-layers-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/reparent-with-layer-removal-expected.txt
LayoutTests/tiled-drawing/scrolling/clamp-out-of-bounds-scrolls-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/absolute-inside-fixed-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/absolute-inside-out-of-view-fixed-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/fixed-in-overflow-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/four-bars-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/four-bars-with-header-and-footer-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/four-bars.html
LayoutTests/tiled-drawing/scrolling/fixed/nested-fixed-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt
LayoutTests/tiled-drawing/scrolling/sticky/sticky-horizontal-expected.txt
LayoutTests/tiled-drawing/scrolling/sticky/sticky-vertical-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/platform/ScrollView.h
Source/WebCore/platform/ScrollableArea.cpp
Source/WebCore/platform/ScrollableArea.h
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h