Swipe view gesture should be reversed in right-to-left contexts
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2016 23:00:29 +0000 (23:00 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 18 Apr 2016 23:00:29 +0000 (23:00 +0000)
commitf6fac5d5b4eb5e430c67a8fd6b5df3b3546683b6
tree23960ab4beb789cf7bd6402b78fa106b1051cb27
parent7db7c09c7dd8f78d76598009fb8bd7db0a4e9a1c
Swipe view gesture should be reversed in right-to-left contexts
https://bugs.webkit.org/show_bug.cgi?id=156714

Reviewed by Anders Carlsson.

* UIProcess/API/gtk/PageClientImpl.h:
* UIProcess/PageClient.h:
* UIProcess/UserInterfaceLayoutDirection.h: Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::userInterfaceLayoutDirection):
* UIProcess/WebPageProxy.h:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::userInterfaceLayoutDirection):
* UIProcess/mac/PageClientImpl.h:
* UIProcess/mac/PageClientImpl.mm:
(WebKit::PageClientImpl::userInterfaceLayoutDirection):
Plumb RTL-ness through to WebPageProxy.
We look at the WK(Web)View's UI layout direction.
For other platforms, we just assume LTR.

* UIProcess/mac/ViewGestureController.h:
* UIProcess/mac/ViewGestureControllerMac.mm:
(WebKit::ViewGestureController::PendingSwipeTracker::scrollEventCanBecomeSwipe):
Decide which way to swipe (and which way to look for back-forward items)
based on the WebPageProxy's reported RTLness.

(WebKit::ViewGestureController::isPhysicallySwipingLeft):
"Back" means "swiping left" in LTR and "swiping right" in RTL.

(WebKit::ViewGestureController::trackSwipeGesture):
(WebKit::ViewGestureController::determineLayerAdjacentToSnapshotForParent):
(WebKit::ViewGestureController::beginSwipeGesture):
(WebKit::ViewGestureController::handleSwipeGesture):
Make things that were equating "back" with "left" instead check isPhysicallySwipingLeft.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199695 268f45cc-cd09-0410-ab3c-d52691b4dbfc
13 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/gtk/PageClientImpl.h
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/UserInterfaceLayoutDirection.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/efl/WebView.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit2/UIProcess/mac/PageClientImpl.h
Source/WebKit2/UIProcess/mac/PageClientImpl.mm
Source/WebKit2/UIProcess/mac/ViewGestureController.h
Source/WebKit2/UIProcess/mac/ViewGestureControllerMac.mm