Title: [255432] branches/safari-610.1.1-branch/Source/WebKit
- Revision
- 255432
- Author
- [email protected]
- Date
- 2020-01-30 09:48:49 -0800 (Thu, 30 Jan 2020)
Log Message
Cherry-pick r254874. rdar://problem/58936679
macCatalyst: Two-finger click is dispatched to DOM as left click
https://bugs.webkit.org/show_bug.cgi?id=206549
Reviewed by Simon Fraser.
* UIProcess/ios/WKMouseGestureRecognizer.mm:
(-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]):
(-[WKMouseGestureRecognizer touchesBegan:withEvent:]):
(-[WKMouseGestureRecognizer touchesMoved:withEvent:]):
(-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
(-[WKMouseGestureRecognizer _hoverEntered:withEvent:]):
(-[WKMouseGestureRecognizer _hoverMoved:withEvent:]):
(-[WKMouseGestureRecognizer _hoverExited:withEvent:]):
(-[WKMouseGestureRecognizer createMouseEventWithType:]): Deleted.
We correctly say button=2 for ctrl-click, but not for secondary-button click.
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
Diff
Modified: branches/safari-610.1.1-branch/Source/WebKit/ChangeLog (255431 => 255432)
--- branches/safari-610.1.1-branch/Source/WebKit/ChangeLog 2020-01-30 17:35:20 UTC (rev 255431)
+++ branches/safari-610.1.1-branch/Source/WebKit/ChangeLog 2020-01-30 17:48:49 UTC (rev 255432)
@@ -1,3 +1,44 @@
+2020-01-30 Alan Coon <[email protected]>
+
+ Cherry-pick r254874. rdar://problem/58936679
+
+ macCatalyst: Two-finger click is dispatched to DOM as left click
+ https://bugs.webkit.org/show_bug.cgi?id=206549
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/ios/WKMouseGestureRecognizer.mm:
+ (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]):
+ (-[WKMouseGestureRecognizer touchesBegan:withEvent:]):
+ (-[WKMouseGestureRecognizer touchesMoved:withEvent:]):
+ (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
+ (-[WKMouseGestureRecognizer _hoverEntered:withEvent:]):
+ (-[WKMouseGestureRecognizer _hoverMoved:withEvent:]):
+ (-[WKMouseGestureRecognizer _hoverExited:withEvent:]):
+ (-[WKMouseGestureRecognizer createMouseEventWithType:]): Deleted.
+ We correctly say button=2 for ctrl-click, but not for secondary-button click.
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@254874 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2020-01-21 Tim Horton <[email protected]>
+
+ macCatalyst: Two-finger click is dispatched to DOM as left click
+ https://bugs.webkit.org/show_bug.cgi?id=206549
+
+ Reviewed by Simon Fraser.
+
+ * UIProcess/ios/WKMouseGestureRecognizer.mm:
+ (-[WKMouseGestureRecognizer createMouseEventWithType:forEvent:]):
+ (-[WKMouseGestureRecognizer touchesBegan:withEvent:]):
+ (-[WKMouseGestureRecognizer touchesMoved:withEvent:]):
+ (-[WKMouseGestureRecognizer touchesEnded:withEvent:]):
+ (-[WKMouseGestureRecognizer _hoverEntered:withEvent:]):
+ (-[WKMouseGestureRecognizer _hoverMoved:withEvent:]):
+ (-[WKMouseGestureRecognizer _hoverExited:withEvent:]):
+ (-[WKMouseGestureRecognizer createMouseEventWithType:]): Deleted.
+ We correctly say button=2 for ctrl-click, but not for secondary-button click.
+
2020-01-29 Russell Epstein <[email protected]>
Cherry-pick r254993. rdar://problem/58778970
Modified: branches/safari-610.1.1-branch/Source/WebKit/UIProcess/ios/WKMouseGestureRecognizer.mm (255431 => 255432)
--- branches/safari-610.1.1-branch/Source/WebKit/UIProcess/ios/WKMouseGestureRecognizer.mm 2020-01-30 17:35:20 UTC (rev 255431)
+++ branches/safari-610.1.1-branch/Source/WebKit/UIProcess/ios/WKMouseGestureRecognizer.mm 2020-01-30 17:48:49 UTC (rev 255432)
@@ -119,15 +119,15 @@
return NO;
}
-- (std::unique_ptr<WebKit::NativeWebMouseEvent>)createMouseEventWithType:(WebKit::WebEvent::Type)type
+- (std::unique_ptr<WebKit::NativeWebMouseEvent>)createMouseEventWithType:(WebKit::WebEvent::Type)type forEvent:(UIEvent *)uiEvent
{
auto modifiers = webEventModifiersForUIKeyModifierFlags(self.modifierFlags);
- BOOL hasControlModifier = modifiers.contains(WebKit::WebEvent::Modifier::ControlKey);
+ BOOL isRightButton = modifiers.contains(WebKit::WebEvent::Modifier::ControlKey) || ([uiEvent _buttonMask] & UIEventButtonMaskSecondary);
auto button = [&] {
if (!_touching || type == WebKit::WebEvent::Type::MouseUp)
return WebKit::WebMouseEvent::NoButton;
- if (hasControlModifier)
+ if (isRightButton)
return WebKit::WebMouseEvent::RightButton;
return WebKit::WebMouseEvent::LeftButton;
}();
@@ -135,7 +135,7 @@
auto buttons = [&] {
if (!_touching)
return 0;
- if (hasControlModifier)
+ if (isRightButton)
return 2;
return 1;
}();
@@ -151,7 +151,7 @@
{
_touching = YES;
- _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseDown];
+ _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseDown forEvent:event];
_lastLocation = [self locationInView:self.view];
self.state = UIGestureRecognizerStateChanged;
@@ -159,7 +159,7 @@
- (void)touchesMoved:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
- _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseMove];
+ _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseMove forEvent:event];
_lastLocation = [self locationInView:self.view];
self.state = UIGestureRecognizerStateChanged;
@@ -169,7 +169,7 @@
{
_touching = NO;
- _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseUp];
+ _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseUp forEvent:event];
_lastLocation = [self locationInView:self.view];
self.state = UIGestureRecognizerStateChanged;
@@ -182,7 +182,7 @@
- (void)_hoverEntered:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
- _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseMove];
+ _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseMove forEvent:event];
if (_currentHoverEvent == nil && touches.count == 1 && [event isKindOfClass:NSClassFromString(@"UIHoverEvent")]) {
_currentHoverEvent = (UIHoverEvent *)event;
@@ -201,7 +201,7 @@
return;
}
- _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseMove];
+ _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseMove forEvent:event];
_lastLocation = [self locationInView:self.view];
if (_currentHoverEvent == event && [touches containsObject:_currentTouch.get()])
@@ -212,7 +212,7 @@
- (void)_hoverExited:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
- _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseMove];
+ _lastEvent = [self createMouseEventWithType:WebKit::WebEvent::MouseMove forEvent:event];
_lastLocation = [self locationInView:self.view];
if (_currentHoverEvent == event) {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes