Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent...
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 27 Jan 2019 16:58:48 +0000 (16:58 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 27 Jan 2019 16:58:48 +0000 (16:58 +0000)
commit387ff21129863485ab1fc3bc5d71d057a425975b
tree1c2616537f589e47e7bc6c7c4f4005eb85ff412d
parent397b367cb75fd4992d3c5ea160447353ff31df30
Have composited RenderIFrame layers make FrameHosting scrolling tree nodes to parent the iframe's scrolling node
https://bugs.webkit.org/show_bug.cgi?id=193879

Reviewed by Antti Koivisto.

Source/WebCore:

Currently we parent iframe scrolling tree nodes by finding the closest ancestor layer with a scrolling tree node.
This results in scrolling tree nodes being connected across iframe boundaries in some arbitrary ancestor. This
makes updating scrolling tree geometry very error-prone, since changes in the parent document will need to trigger
updates of the scrolling tree node in an iframe.

To address this, I already added a new "FrameHosting" scrolling node type. This patch actually instantiates these
nodes, which are owned by the RenderIFrame's composited layer. Connecting across frame boundaries is theforefore
simply a case of getting the FrameHosting node from the ownerElement's renderer; this is very similar to how we
connect GraphicsLayers together.

RenderLayerBacking gains another scrolling role for FrameHosting and ScrollingNodeID.

Tested by existing tests.

* page/FrameView.h:
* rendering/RenderLayer.cpp:
(WebCore::outputPaintOrderTreeRecursive):
* rendering/RenderLayerBacking.cpp:
(WebCore::RenderLayerBacking::updateConfiguration):
(WebCore::RenderLayerBacking::detachFromScrollingCoordinator):
* rendering/RenderLayerCompositor.cpp:
(WebCore::frameContentsRenderView):
(WebCore::RenderLayerCompositor::frameContentsCompositor):
(WebCore::RenderLayerCompositor::parentFrameContentLayers):
(WebCore::RenderLayerCompositor::isLayerForIFrameWithScrollCoordinatedContents const):
(WebCore::RenderLayerCompositor::detachRootLayer):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedStatus):
(WebCore::RenderLayerCompositor::removeFromScrollCoordinatedLayers):
(WebCore::scrollCoordinatedAncestorInParentOfFrame):
(WebCore::RenderLayerCompositor::reattachSubframeScrollLayers):
(WebCore::RenderLayerCompositor::attachScrollingNode):
(WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame):
(WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer):
* rendering/RenderLayerCompositor.h:
* testing/Internals.cpp:
(WebCore::Internals::scrollingStateTreeAsText const):

Source/WebKit:

Need a specialization of dump() for ScrollingStateFrameHostingNode to avoid infinite recursion.

* Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp:
(WebKit::dump):

LayoutTests:

New test results with FrameHosting nodes.

* 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/scrolling-tree-includes-frame-expected.txt:
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-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/scrolling-tree-includes-frame-expected.txt:
* scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@240553 268f45cc-cd09-0410-ab3c-d52691b4dbfc
26 files changed:
LayoutTests/ChangeLog
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/scrolling-tree-includes-frame-expected.txt
LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-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/scrolling-tree-includes-frame-expected.txt
LayoutTests/scrollingcoordinator/scrolling-tree/toggle-coordinated-frame-scrolling-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/page/FrameView.h
Source/WebCore/page/scrolling/ScrollingStateNode.cpp
Source/WebCore/page/scrolling/ScrollingStateTree.cpp
Source/WebCore/rendering/RenderLayer.cpp
Source/WebCore/rendering/RenderLayerBacking.cpp
Source/WebCore/rendering/RenderLayerCompositor.cpp
Source/WebCore/rendering/RenderLayerCompositor.h
Source/WebCore/testing/Internals.cpp
Source/WebKit/ChangeLog
Source/WebKit/Shared/RemoteLayerTree/RemoteScrollingCoordinatorTransaction.cpp