Title: [169850] trunk/Source/WebKit2
Revision
169850
Author
[email protected]
Date
2014-06-11 15:47:16 -0700 (Wed, 11 Jun 2014)

Log Message

Implement swipeWithEvent for non-fluid swipes
https://bugs.webkit.org/show_bug.cgi?id=133766
<rdar://problem/17126889>

Reviewed by Anders Carlsson.

* UIProcess/API/mac/WKView.mm:
(-[WKView swipeWithEvent:]):
On non-fluid swipes, go back or forward depending on the swipe direction.

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (169849 => 169850)


--- trunk/Source/WebKit2/ChangeLog	2014-06-11 22:41:03 UTC (rev 169849)
+++ trunk/Source/WebKit2/ChangeLog	2014-06-11 22:47:16 UTC (rev 169850)
@@ -1,3 +1,15 @@
+2014-06-11  Tim Horton  <[email protected]>
+
+        Implement swipeWithEvent for non-fluid swipes
+        https://bugs.webkit.org/show_bug.cgi?id=133766
+        <rdar://problem/17126889>
+
+        Reviewed by Anders Carlsson.
+
+        * UIProcess/API/mac/WKView.mm:
+        (-[WKView swipeWithEvent:]):
+        On non-fluid swipes, go back or forward depending on the swipe direction.
+
 2014-06-11  Dan Bernstein  <[email protected]>
 
         [Cocoa] Xcode cannot infer that the WebKit target implicitly depends on WebCore.framework

Modified: trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm (169849 => 169850)


--- trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-06-11 22:41:03 UTC (rev 169849)
+++ trunk/Source/WebKit2/UIProcess/API/mac/WKView.mm	2014-06-11 22:47:16 UTC (rev 169850)
@@ -1174,6 +1174,24 @@
     _data->_page->handleWheelEvent(webEvent);
 }
 
+- (void)swipeWithEvent:(NSEvent *)event
+{
+    if ([self shouldIgnoreMouseEvents])
+        return;
+
+    if (!_data->_allowsBackForwardNavigationGestures) {
+        [super swipeWithEvent:event];
+        return;
+    }
+
+    if (event.deltaX > 0.0)
+        _data->_page->goBack();
+    else if (event.deltaX < 0.0)
+        _data->_page->goForward();
+    else
+        [super swipeWithEvent:event];
+}
+
 - (void)mouseMoved:(NSEvent *)event
 {
     if ([self shouldIgnoreMouseEvents])
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to