Add some basic geometry information to the scrolling tree
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2019 16:33:33 +0000 (16:33 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 30 Jan 2019 16:33:33 +0000 (16:33 +0000)
commit4166781dcab655be6dd0fd6e30961b57cecf11ac
tree23370ceee4611450ccdf91828d4461a52ce0d360
parent1e8b8e0db381afee59f4fd89bc727b60582298f7
Add some basic geometry information to the scrolling tree
https://bugs.webkit.org/show_bug.cgi?id=194002
Source/WebCore:

rdar://problem/47656294

Reviewed by Antti Koivisto.

To allow hit-testing in the scrolling tree, store a parent-relative scrollable
rect in "scrolling" and "frame hosting" nodes. This is a rect whose size is the size
of the scrollable area, and whose origin is relative to the parent scrolling tree node.

Frame hosting nodes need this rect because they take care of the geometry offset between
an iframe and its scrolling tree ancestor in the parent document.

Based on a patch by Frédéric Wang in bug 172917.

* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::setScrollingNodeGeometry):
* page/scrolling/ScrollingStateFrameHostingNode.cpp:
(WebCore::ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode):
(WebCore::ScrollingStateFrameHostingNode::setAllPropertiesChanged):
(WebCore::ScrollingStateFrameHostingNode::setParentRelativeScrollableRect):
(WebCore::ScrollingStateFrameHostingNode::dumpProperties const):
* page/scrolling/ScrollingStateFrameHostingNode.h:
* page/scrolling/ScrollingTreeFrameHostingNode.cpp:
(WebCore::ScrollingTreeFrameHostingNode::commitStateBeforeChildren):
(WebCore::ScrollingTreeFrameHostingNode::dumpProperties const):
* page/scrolling/ScrollingTreeFrameHostingNode.h:
(WebCore::ScrollingTreeFrameHostingNode::parentRelativeScrollableRect const):
* rendering/RenderLayer.h:
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateScrollingLayers):
* rendering/RenderLayerCompositor.cpp:
(WebCore::RenderLayerCompositor::computeFrameScrollingGeometry const):
(WebCore::RenderLayerCompositor::computeFrameHostingGeometry const):
(WebCore::RenderLayerCompositor::computeOverflowScrollingGeometry const):
(WebCore::RenderLayerCompositor::updateScrollingNodeForScrollingRole):
(WebCore::RenderLayerCompositor::updateScrollingNodeForFrameHostingRole):
(WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView const):
(WebCore::RenderLayerCompositor::updateScrollSnapPropertiesWithFrameView): Deleted.
* rendering/RenderLayerCompositor.h:

Source/WebKit:

Reviewed by Antti Koivisto.

Add a comment explaining why we don't need to encode/decode ParentRelativeScrollableRect.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateFrameHostingNode>::encode):

LayoutTests:

rdar://problem/47656294

Reviewed by Antti Koivisto.

New test results with "parent relative scrollable rect" output and 0,0 anchorPoints.

* compositing/scrolling/overflow-scrolling-layers-are-self-painting-expected.txt:
* fast/scrolling/ios/change-scrollability-on-content-resize-expected.txt:
* fast/scrolling/ios/change-scrollability-on-content-resize-nested-expected.txt:
* fast/scrolling/ios/overflow-scroll-touch-expected.txt:
* fast/scrolling/ios/reconcile-layer-position-recursive-expected.txt:
* fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolled-down-then-up-expected.txt:
* fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state-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/fixed-inside-frame-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-coordinated-frame-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:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:
* platform/ios/compositing/overflow/overflow-auto-with-touch-expected.txt:
* platform/ios/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt:
* platform/ios/compositing/overflow/overflow-overlay-with-touch-expected.txt:
* platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt:
* platform/ios/compositing/overflow/scrolling-without-painting-expected.txt:
* platform/ios/compositing/overflow/textarea-scroll-touch-expected.txt:
* platform/ios/compositing/overflow/updating-scrolling-content-expected.txt:
* platform/ios/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt:
* platform/ios/compositing/scrolling/overflow-scrolling-layers-are-self-painting-expected.txt:
* platform/ios/fast/scrolling/ios/overflow-scrolling-ancestor-clip-expected.txt:
* platform/ios/fast/scrolling/ios/overflow-scrolling-ancestor-clip-size-expected.txt:
* platform/ios/fast/scrolling/ios/scrolling-content-clip-to-viewport-expected.txt:
* platform/ios/fast/scrolling/ios/textarea-scroll-touch-expected.txt:
* platform/ios/media/video-play-glyph-composited-outside-overflow-scrolling-touch-container-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt:
* scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt:
* scrollingcoordinator/scrolling-tree/fixed-inside-frame-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-coordinated-frame-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:
* scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt:
* scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-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/fixed-position-out-of-view-expected.txt:
* tiled-drawing/scrolling/fixed/fixed-position-out-of-view-negative-zindex-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/negative-scroll-offset-expected.txt:
* tiled-drawing/scrolling/fixed/negative-scroll-offset-in-view-expected.txt:
* tiled-drawing/scrolling/fixed/nested-fixed-expected.txt:
* tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt:
* tiled-drawing/scrolling/frames/scroll-region-after-frame-layout-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-after-scroll-expected.txt:
* tiled-drawing/scrolling/scrolling-tree-slow-scrolling-expected.txt:
* tiled-drawing/scrolling/sticky/negative-scroll-offset-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@240713 268f45cc-cd09-0410-ab3c-d52691b4dbfc
84 files changed:
LayoutTests/ChangeLog
LayoutTests/compositing/scrolling/overflow-scrolling-layers-are-self-painting-expected.txt
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/scrolling/ios/overflow-scroll-touch-expected.txt
LayoutTests/fast/scrolling/ios/reconcile-layer-position-recursive-expected.txt
LayoutTests/fast/scrolling/ios/subpixel-overflow-scrolling-with-ancestor-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/fast/visual-viewport/tiled-drawing/zoomed-fixed-scrolling-layers-state-expected.txt
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-coordinated-frame-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/platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt
LayoutTests/platform/ios/compositing/overflow/overflow-auto-with-touch-expected.txt
LayoutTests/platform/ios/compositing/overflow/overflow-auto-with-touch-toggle-expected.txt
LayoutTests/platform/ios/compositing/overflow/overflow-overlay-with-touch-expected.txt
LayoutTests/platform/ios/compositing/overflow/scrolling-content-clip-to-viewport-expected.txt
LayoutTests/platform/ios/compositing/overflow/scrolling-without-painting-expected.txt
LayoutTests/platform/ios/compositing/overflow/textarea-scroll-touch-expected.txt
LayoutTests/platform/ios/compositing/overflow/updating-scrolling-content-expected.txt
LayoutTests/platform/ios/compositing/rtl/rtl-scrolling-with-transformed-descendants-expected.txt
LayoutTests/platform/ios/compositing/scrolling/overflow-scrolling-layers-are-self-painting-expected.txt
LayoutTests/platform/ios/fast/scrolling/ios/overflow-scrolling-ancestor-clip-expected.txt
LayoutTests/platform/ios/fast/scrolling/ios/overflow-scrolling-ancestor-clip-size-expected.txt
LayoutTests/platform/ios/fast/scrolling/ios/scrolling-content-clip-to-viewport-expected.txt
LayoutTests/platform/ios/fast/scrolling/ios/textarea-scroll-touch-expected.txt
LayoutTests/platform/ios/media/video-play-glyph-composited-outside-overflow-scrolling-touch-container-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-gain-scrolling-ancestor-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-in-fixed-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/coordinated-frame-lose-scrolling-ancestor-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/fixed-inside-frame-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-coordinated-frame-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/scrollingcoordinator/scrolling-tree/scrolling-tree-includes-frame-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/scrolling-tree-is-z-order-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-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/fixed-position-out-of-view-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/fixed-position-out-of-view-negative-zindex-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/negative-scroll-offset-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/negative-scroll-offset-in-view-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/nested-fixed-expected.txt
LayoutTests/tiled-drawing/scrolling/fixed/percentage-inside-fixed-expected.txt
LayoutTests/tiled-drawing/scrolling/frames/scroll-region-after-frame-layout-expected.txt
LayoutTests/tiled-drawing/scrolling/scrolling-tree-after-scroll-expected.txt
LayoutTests/tiled-drawing/scrolling/scrolling-tree-slow-scrolling-expected.txt
LayoutTests/tiled-drawing/scrolling/sticky/negative-scroll-offset-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/ScrollingStateFrameHostingNode.cpp
Source/WebCore/page/scrolling/ScrollingStateFrameHostingNode.h
Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeFrameHostingNode.h
Source/WebCore/rendering/RenderLayer.h
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebKit/ChangeLog
Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp