Transfer the non-fast-scrollable region to the UI process for iOS
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Feb 2014 06:55:20 +0000 (06:55 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 6 Feb 2014 06:55:20 +0000 (06:55 +0000)
commita0c759cbd67423acf4126a7f5b25ce242ed5ec57
treeea778b8655a092944096715a1fc4aadadb6c5c3a
parent1dc944952948345a2e946c104b9340a113fbd094
Transfer the non-fast-scrollable region to the UI process for iOS
https://bugs.webkit.org/show_bug.cgi?id=128293

Reviewed by Benjamin Poulain.

Source/WebCore:

Two main changes to support sending the non-fast scrollable region
to the UI process for iOS:

1. Add ScrollingCoordinator::frameViewNonFastScrollableRegionChanged(),
which is called when we've updated the touch event region (this can happen
independenly of layout). When called we just scheduled a scrolling tree
commit with the new region.

2. Avoid thinking that we have a new root node with every remote scrolling
transaction. This was a side-effect of reconstructing the scrolling state
tree in the UI process, and caused us to try to grab a nonFastScrollableRegion
from a node which never had one set.

* WebCore.exp.in:
* page/scrolling/AsyncScrollingCoordinator.cpp:
(WebCore::AsyncScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
* page/scrolling/AsyncScrollingCoordinator.h:
* page/scrolling/ScrollingCoordinator.cpp:
(WebCore::ScrollingCoordinator::computeNonFastScrollableRegion):
* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::frameViewNonFastScrollableRegionChanged):
* page/scrolling/ScrollingStateTree.h:
(WebCore::ScrollingStateTree::setHasNewRootStateNode):
* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::commitNewTreeState):
(WebCore::ScrollingTree::isPointInNonFastScrollableRegion):
* page/scrolling/ScrollingTree.h:

Source/WebKit2:

Two main changes to support sending the non-fast scrollable region
to the UI process for iOS:

1. Add ScrollingCoordinator::frameViewNonFastScrollableRegionChanged(),
which is called when we've updated the touch event region (this can happen
independenly of layout). When called we just scheduled a scrolling tree
commit with the new region.

2. Avoid thinking that we have a new root node with every remote scrolling
transaction. This was a side-effect of reconstructing the scrolling state
tree in the UI process, and caused us to try to grab a nonFastScrollableRegion
from a node which never had one set.

Now that we have the non-fast scrollable region in the UI process, we can
use it to avoid sending sync messages to the web process.

* Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp:
(ArgumentCoder<ScrollingStateScrollingNode>::encode): Encode hasNewRootNode.
(ArgumentCoder<ScrollingStateScrollingNode>::decode): Decode hasNewRootNode and set it on
the state tree.
(WebKit::RemoteScrollingCoordinatorTransaction::encode): Encode the nonFastScrollableRegion
now that we can encode Regions.
(WebKit::RemoteScrollingCoordinatorTransaction::decode): Decode the nonFastScrollableRegion
now that we can decode Regions.
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp:
(WebKit::RemoteScrollingCoordinatorProxy::isPointInNonFastScrollableRegion):
* UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h:
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::handleTouchEvent): If we're not in the non-fast scrollable region,
don't both sending touch events to the web process.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@163516 268f45cc-cd09-0410-ab3c-d52691b4dbfc
19 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.cpp
Source/WebCore/page/scrolling/AsyncScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingStateTree.h
Source/WebCore/page/scrolling/ScrollingTree.cpp
Source/WebCore/page/scrolling/ScrollingTree.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/Scrolling/RemoteScrollingCoordinatorTransaction.cpp
Source/WebKit2/Shared/ios/NativeWebTouchEventIOS.mm
Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.cpp
Source/WebKit2/UIProcess/Scrolling/RemoteScrollingCoordinatorProxy.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h