12017-09-12 Frederic Wang <fwang@igalia.com>
2
3 Add ParentRelativeScrollableRect to ScrollingCoordinator::ScrollingGeometry
4 https://bugs.webkit.org/show_bug.cgi?id=172914
5
6 Reviewed by NOBODY (OOPS!).
7
8 This patch introduce a new ParentRelativeScrollableRect parameter to the scrolling geometry. It is the
9 target rectangle for mouse event with coordinates relative to the parent scrolling node. This
10 will be used for iframes to implement hit testing in the scrolling tree.
11
12 Test: fast/scrolling/scrolling-tree-iframe-parent-relative-scrollable-rect.html
13
14 * page/scrolling/AsyncScrollingCoordinator.cpp: Take parentRelativeScrollableRect into account.
15 (WebCore::AsyncScrollingCoordinator::updateFrameScrollingNode):
16 (WebCore::AsyncScrollingCoordinator::updateOverflowScrollingNode):
17 * page/scrolling/ScrollingCoordinator.h: Add parentRelativeScrollableRect.
18 * page/scrolling/ScrollingStateScrollingNode.cpp: Ditto.
19 (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode):
20 (WebCore::ScrollingStateScrollingNode::setParentRelativeScrollableRect):
21 (WebCore::ScrollingStateScrollingNode::dumpProperties const):
22 * page/scrolling/ScrollingStateScrollingNode.h: Ditto.
23 (WebCore::ScrollingStateScrollingNode::parentRelativeScrollableRect const):
24 * page/scrolling/ScrollingTreeScrollingNode.cpp: Ditto.
25 (WebCore::ScrollingTreeScrollingNode::commitStateBeforeChildren):
26 (WebCore::ScrollingTreeScrollingNode::dumpProperties const):
27 * page/scrolling/ScrollingTreeScrollingNode.h: Ditto.
28 (WebCore::ScrollingTreeScrollingNode::parentRelativeScrollableRect const):
29 * rendering/RenderLayerCompositor.cpp:
30 (WebCore::RenderLayerCompositor::findEnclosingScrollingNode): This function is renamed from
31 enclosingScrollingNodeID. It now returns an EnclosingNodeData containing the enclosing node
32 id together with the target rect of the node relative to its enclosing node.
33 (WebCore::RenderLayerCompositor::scrollCoordinatedAncestorInParentOfFrame): This function
34 is generalized to return the EnclosingNodeData.
35 (WebCore::RenderLayerCompositor::reattachSubframeScrollLayers): Use EnclosingNodeData.
36 (WebCore::RenderLayerCompositor::scrollingGeometryFor): New helper function to retrieve the
37 scrolling geometry associated to a layer.
38 (WebCore::RenderLayerCompositor::updateScrollCoordinationForThisFrame): For non-main frames,
39 this now properly sets the scrolling geometry.
40 (WebCore::RenderLayerCompositor::updateScrollCoordinatedLayer): Use the new helper functions
41 to calculate the enclosing node and scrolling geometry.
42 * rendering/RenderLayerCompositor.h: Define an EnclosingNodeData, which contains data for the
43 enclosing node (node id and offset from parent).
44