Cancel Web Touches Properly so that long presses on YouTube links do not incorrectly...
authormegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2019 02:12:08 +0000 (02:12 +0000)
committermegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 23 Jan 2019 02:12:08 +0000 (02:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=193687
<rdar://problem/47056717>

Reviewed by Tim Horton.

Cancel web gestures when a long press is recognized.

* Platform/spi/ios/UIKitSPI.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _cancelWebGestureRecognizer]):
(-[WKContentView _longPressRecognized:]):

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

Source/WebKit/ChangeLog
Source/WebKit/Platform/spi/ios/UIKitSPI.h
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

index f884697..18568f7 100644 (file)
@@ -1,3 +1,18 @@
+2019-01-22  Megan Gardner  <megan_gardner@apple.com>
+
+        Cancel Web Touches Properly so that long presses on YouTube links do not incorrectly trigger a load
+        https://bugs.webkit.org/show_bug.cgi?id=193687
+        <rdar://problem/47056717>
+
+        Reviewed by Tim Horton.
+
+        Cancel web gestures when a long press is recognized.
+
+        * Platform/spi/ios/UIKitSPI.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView _cancelWebGestureRecognizer]):
+        (-[WKContentView _longPressRecognized:]):
+
 2019-01-22  Alex Christensen  <achristensen@webkit.org>
 
         Fix an internal build failure after r240292
index 7a8e870..b5c3e34 100644 (file)
@@ -758,6 +758,7 @@ struct _UIWebTouchEvent {
 
 @interface UIWebTouchEventsGestureRecognizer ()
 - (id)initWithTarget:(id)target action:(SEL)action touchDelegate:(id <UIWebTouchEventsGestureRecognizerDelegate>)delegate;
+- (void)cancel;
 @property (nonatomic, getter=isDefaultPrevented) BOOL defaultPrevented;
 @property (nonatomic, readonly) BOOL inJavaScriptGesture;
 @property (nonatomic, readonly) CGPoint locationInWindow;
index 66818c6..d3f9f12 100644 (file)
@@ -1348,6 +1348,13 @@ static NSValue *nsSizeForTapHighlightBorderRadius(WebCore::IntSize borderRadius,
     [_highlightLongPressGestureRecognizer cancel];
 }
 
+- (void)_cancelTouchEventGestureRecognizer
+{
+#if HAVE(CANCEL_WEB_TOUCH_EVENTS_GESTURE)
+    [_touchEventGestureRecognizer cancel];
+#endif
+}
+
 - (void)_didScroll
 {
     [self _cancelLongPressGestureRecognizer];
@@ -1979,6 +1986,7 @@ static inline bool isSamePair(UIGestureRecognizer *a, UIGestureRecognizer *b, UI
 {
     ASSERT(gestureRecognizer == _longPressGestureRecognizer);
     [self _resetIsDoubleTapPending];
+    [self _cancelTouchEventGestureRecognizer];
 
     _lastInteractionLocation = gestureRecognizer.startPoint;