Add a way to get the UI-side scrolling tree as text via UIScriptController
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Nov 2016 07:19:07 +0000 (07:19 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 13 Nov 2016 07:19:07 +0000 (07:19 +0000)
commit2ce6e13d1a8415317fa483fe7b61b70fa1102067
treedf9f8719c8dd8260f785087dc62aeb60f50b4973
parenta17c409b8d60d4d080b63853e8c602241917b742
Add a way to get the UI-side scrolling tree as text via UIScriptController
https://bugs.webkit.org/show_bug.cgi?id=164697

Reviewed by Zalan Bujtas.

Source/WebCore:

Add dumping to ScrollingTreeNode and subclasses (previously, we could only dump
the scrolling state tree). This re-uses the flags used for state tree dumping.

NodeIDs are not dumped by default because they can depend on earlier tests.

Test: scrollingcoordinator/ios/ui-scrolling-tree.html

* page/scrolling/ScrollingStateNode.h:
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::scrollingTreeAsText):
* page/scrolling/ScrollingTree.h:
* page/scrolling/ScrollingTreeFrameScrollingNode.cpp:
(WebCore::ScrollingTreeFrameScrollingNode::dumpProperties):
* page/scrolling/ScrollingTreeFrameScrollingNode.h:
* page/scrolling/ScrollingTreeNode.cpp:
(WebCore::ScrollingTreeNode::dumpProperties):
(WebCore::ScrollingTreeNode::dump):
* page/scrolling/ScrollingTreeNode.h:
* page/scrolling/ScrollingTreeScrollingNode.cpp:
(WebCore::ScrollingTreeScrollingNode::dumpProperties):
* page/scrolling/ScrollingTreeScrollingNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.h:
* page/scrolling/mac/ScrollingTreeFixedNode.mm:
(WebCore::ScrollingTreeFixedNode::dumpProperties):
* page/scrolling/mac/ScrollingTreeStickyNode.h:
* page/scrolling/mac/ScrollingTreeStickyNode.mm:
(WebCore::ScrollingTreeStickyNode::dumpProperties):

Source/WebKit2:

Add a property to WKWebView to retrieve the scrolling tree as text, for testing.
Expose it via the RemoteScrollingCoordinatorProxy.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _scrollingTreeAsText]):
* UIProcess/API/Cocoa/WKWebViewPrivate.h:
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::scrollingTreeAsText):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:

Tools:

Add UIScriptController::scrollingTreeAsText(), which gets the state of the scrolling
tree in the UI process, including the current positions of CALayers. This will be used
to test UI-side scrolling and visual viewports.

* DumpRenderTree/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::scrollingTreeAsText):
* TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl:
* TestRunnerShared/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::scrollingTreeAsText):
* TestRunnerShared/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::scrollingTreeAsText):

LayoutTests:

Add a test that dumps the scrolling state tree with a fixed element.

* scrollingcoordinator/ios/ui-scrolling-tree-expected.txt: Added.
* scrollingcoordinator/ios/ui-scrolling-tree.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@208666 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
LayoutTests/ChangeLog
LayoutTests/scrollingcoordinator/ios/ui-scrolling-tree-expected.txt [new file with mode: 0644]
LayoutTests/scrollingcoordinator/ios/ui-scrolling-tree.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/scrolling/ScrollingStateNode.h
Source/WebCore/page/scrolling/ScrollingTree.cpp
Source/WebCore/page/scrolling/ScrollingTree.h
Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeFrameScrollingNode.h
Source/WebCore/page/scrolling/ScrollingTreeNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeNode.h
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp
Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h
Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.h
Source/WebCore/page/scrolling/mac/ScrollingTreeFixedNode.mm
Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.h
Source/WebCore/page/scrolling/mac/ScrollingTreeStickyNode.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h
Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h
Tools/ChangeLog
Tools/DumpRenderTree/ios/UIScriptControllerIOS.mm
Tools/TestRunnerShared/UIScriptContext/Bindings/UIScriptController.idl
Tools/TestRunnerShared/UIScriptContext/UIScriptController.cpp
Tools/TestRunnerShared/UIScriptContext/UIScriptController.h
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm