Title: [255433] branches/safari-610.1.1-branch/Source/WebKit
Revision
255433
Author
[email protected]
Date
2020-01-30 09:48:52 -0800 (Thu, 30 Jan 2020)

Log Message

Cherry-pick r255105. rdar://problem/58936679

    macCatalyst: Right clicking on links follows the link, but shouldn't
    https://bugs.webkit.org/show_bug.cgi?id=206777
    <rdar://problem/56586280>

    Reviewed by Wenson Hsieh.

    * UIProcess/ios/WKMouseGestureRecognizer.mm:
    (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]):
    (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
    I got 'button' and 'buttons' backwards.

    'button' indicates which button the event is about, so in MouseUp,
    it should still be 2.

    'buttons' indicate which buttons are still down, so in MouseUp,
    it should not include 2. Since we don't currently track mouse button
    chording here, we'll just say "none". Leave a FIXME about that.

    This makes WebCore's behavior correct, and now it doesn't follow the link.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255105 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-610.1.1-branch/Source/WebKit/ChangeLog (255432 => 255433)


--- branches/safari-610.1.1-branch/Source/WebKit/ChangeLog	2020-01-30 17:48:49 UTC (rev 255432)
+++ branches/safari-610.1.1-branch/Source/WebKit/ChangeLog	2020-01-30 17:48:52 UTC (rev 255433)
@@ -1,5 +1,54 @@
 2020-01-30  Alan Coon  <[email protected]>
 
+        Cherry-pick r255105. rdar://problem/58936679
+
+    macCatalyst: Right clicking on links follows the link, but shouldn't
+    https://bugs.webkit.org/show_bug.cgi?id=206777
+    <rdar://problem/56586280>
+    
+    Reviewed by Wenson Hsieh.
+    
+    * UIProcess/ios/WKMouseGestureRecognizer.mm:
+    (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]):
+    (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
+    I got 'button' and 'buttons' backwards.
+    
+    'button' indicates which button the event is about, so in MouseUp,
+    it should still be 2.
+    
+    'buttons' indicate which buttons are still down, so in MouseUp,
+    it should not include 2. Since we don't currently track mouse button
+    chording here, we'll just say "none". Leave a FIXME about that.
+    
+    This makes WebCore's behavior correct, and now it doesn't follow the link.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@255105 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2020-01-24  Tim Horton  <[email protected]>
+
+            macCatalyst: Right clicking on links follows the link, but shouldn't
+            https://bugs.webkit.org/show_bug.cgi?id=206777
+            <rdar://problem/56586280>
+
+            Reviewed by Wenson Hsieh.
+
+            * UIProcess/ios/WKMouseGestureRecognizer.mm:
+            (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]):
+            (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
+            I got 'button' and 'buttons' backwards.
+
+            'button' indicates which button the event is about, so in MouseUp,
+            it should still be 2.
+
+            'buttons' indicate which buttons are still down, so in MouseUp,
+            it should not include 2. Since we don't currently track mouse button
+            chording here, we'll just say "none". Leave a FIXME about that.
+
+            This makes WebCore's behavior correct, and now it doesn't follow the link.
+
+2020-01-30  Alan Coon  <[email protected]>
+
         Cherry-pick r254874. rdar://problem/58936679
 
     macCatalyst: Two-finger click is dispatched to DOM as left click

Modified: branches/safari-610.1.1-branch/Source/WebKit/UIProcess/ios/WKMouseGestureRecognizer.mm (255432 => 255433)


--- branches/safari-610.1.1-branch/Source/WebKit/UIProcess/ios/WKMouseGestureRecognizer.mm	2020-01-30 17:48:49 UTC (rev 255432)
+++ branches/safari-610.1.1-branch/Source/WebKit/UIProcess/ios/WKMouseGestureRecognizer.mm	2020-01-30 17:48:52 UTC (rev 255433)
@@ -125,7 +125,7 @@
     BOOL isRightButton = modifiers.contains(WebKit::WebEvent::Modifier::ControlKey) || ([uiEvent _buttonMask] & UIEventButtonMaskSecondary);
 
     auto button = [&] {
-        if (!_touching || type == WebKit::WebEvent::Type::MouseUp)
+        if (!_touching)
             return WebKit::WebMouseEvent::NoButton;
         if (isRightButton)
             return WebKit::WebMouseEvent::RightButton;
@@ -132,8 +132,9 @@
         return WebKit::WebMouseEvent::LeftButton;
     }();
 
+    // FIXME: 'buttons' should report any buttons that are still down in the case when one button is released from a chord.
     auto buttons = [&] {
-        if (!_touching)
+        if (!_touching || type == WebKit::WebEvent::Type::MouseUp)
             return 0;
         if (isRightButton)
             return 2;
@@ -167,11 +168,11 @@
 
 - (void)touchesEnded:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
 {
-    _touching = NO;
-
     _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseUp forEvent:event];
     _lastLocation = [self locationInView:self.view];
 
+    _touching = NO;
+
     self.state = UIGestureRecognizerStateChanged;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to