Allow UI clients to handle vertical wheel events.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Feb 2013 01:42:47 +0000 (01:42 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 20 Feb 2013 01:42:47 +0000 (01:42 +0000)
commiteed040d30136787ed5fb0da9a36d5f5a8ecb9c27
treec41ac7db538c8bf64034b302c981a894e77842d0
parentf35f22853e6ea7a93b74d5c2e469fb7cd987c21f
Allow UI clients to handle vertical wheel events.
https://bugs.webkit.org/show_bug.cgi?id=110006

Patch by Conrad Shultz <conrad_shultz@apple.com> on 2013-02-19
Reviewed by Tim Horton.

Source/WebCore:

Add API to allow matching changes in WebKit2 to control rubber-banding behavior at vertical page extrema.
If rubber-banding is disabled during a scroll event that would otherwise trigger rubber-banding, dispatch
didNotHandleWheelEvent() to the page UI client.

* WebCore.exp.in:
Export new rubber-banding API.

* page/Page.cpp:
(WebCore):
(WebCore::Page::rubberBandsAtBottom):
Proxy for the corresponding function in ScrollingCoordinator.
(WebCore::Page::setRubberBandsAtBottom):
Ditto.
(WebCore::Page::rubberBandsAtTop):
Ditto.
(WebCore::Page::setRubberBandsAtTop):
Ditto.

* page/Page.h:
(Page):
Declare new rubber-banding API (above).

* page/scrolling/ScrollingCoordinator.h:
(WebCore::ScrollingCoordinator::rubberBandsAtBottom):
Stub API implementation.
(WebCore::ScrollingCoordinator::setRubberBandsAtBottom):
Ditto.
(WebCore::ScrollingCoordinator::rubberBandsAtTop):
Ditto.
(WebCore::ScrollingCoordinator::setRubberBandsAtTop):
Ditto.

* page/scrolling/ScrollingTree.cpp:
(WebCore::ScrollingTree::ScrollingTree):
Initialize new member variables.
(WebCore::ScrollingTree::setMainFramePinState):
Set top/bottom pinned states.
(WebCore::ScrollingTree::rubberBandsAtBottom):
New accessor function.
(WebCore::ScrollingTree::setRubberBandsAtBottom):
New mutator function.
(WebCore::ScrollingTree::rubberBandsAtTop):
New accessor function.
(WebCore::ScrollingTree::setRubberBandsAtTop):
New mutator function.
(WebCore::ScrollingTree::willWheelEventStartSwipeGesture):
Start a vertical swipe event if the frame is pinned at the top or bottom and associated rubber-banding is disabled.

* page/scrolling/ScrollingTree.h:
(ScrollingTree):
Declare new rubber-banding API and associated member variables.

* page/scrolling/mac/ScrollingCoordinatorMac.h:
(ScrollingCoordinatorMac):
Declare API overrides.

* page/scrolling/mac/ScrollingCoordinatorMac.mm:
(WebCore::ScrollingCoordinatorMac::rubberBandsAtBottom):
Method override; proxy to corresponding function in ScrollingTree.
(WebCore::ScrollingCoordinatorMac::setRubberBandsAtBottom):
Ditto.
(WebCore::ScrollingCoordinatorMac::rubberBandsAtTop):
Ditto.
(WebCore::ScrollingCoordinatorMac::setRubberBandsAtTop):
Ditto.

* page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm:
(WebCore::ScrollingTreeScrollingNodeMac::pinnedInDirection):
Remove trailing whitespace.
(WebCore::ScrollingTreeScrollingNodeMac::updateMainFramePinState):
Calculate and pass vertical pinning state to ScrollingTree::setMainFramePinState().

Source/WebKit2:

Add API to allow clients to selectively control rubber-banding at vertical page extrema.

* UIProcess/API/C/WKPage.cpp:
(WKPageRubberBandsAtBottom):
Proxy for the corresponding function in WebCore::Page.
(WKPageSetRubberBandsAtBottom):
Ditto.
(WKPageRubberBandsAtTop):
Ditto.
(WKPageSetRubberBandsAtTop):
Ditto.

* UIProcess/API/C/WKPage.h:
Declare new API.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
Initialize new member variables.
(WebKit::WebPageProxy::setRubberBandsAtBottom):
New function; dispatches a matching message to the WebKit::WebPage.
(WebKit::WebPageProxy::setRubberBandsAtTop):
Ditto.

* UIProcess/WebPageProxy.h:
(WebPageProxy):
Declare new API.
(WebKit::WebPageProxy::rubberBandsAtBottom):
New accessor function.
(WebKit::WebPageProxy::rubberBandsAtTop):
Ditto.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::setRubberBandsAtBottom):
New function; call the matching function on the associated WebCore::Page.
(WebKit::WebPage::setRubberBandsAtTop):
Ditto.

* WebProcess/WebPage/WebPage.h:
(WebPage):
Declare new rubber-banding API.

* WebProcess/WebPage/WebPage.messages.in:
Declare new rubber-banding API.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@143418 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/page/scrolling/ScrollingCoordinator.h
Source/WebCore/page/scrolling/ScrollingTree.cpp
Source/WebCore/page/scrolling/ScrollingTree.h
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h
Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm
Source/WebCore/page/scrolling/mac/ScrollingTreeScrollingNodeMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/WKPage.cpp
Source/WebKit2/UIProcess/API/C/WKPage.h
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in