Turn off two finger gestures for editable non-scaled content
authormegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Jul 2019 01:50:25 +0000 (01:50 +0000)
committermegan_gardner@apple.com <megan_gardner@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Jul 2019 01:50:25 +0000 (01:50 +0000)
https://bugs.webkit.org/show_bug.cgi?id=199739
<rdar://problem/52107190>

Reviewed by Tim Horton.

This gesture is blocking a selection gesture. Turn it off as it is not
even being used in editable content.

* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView setupInteraction]):
(-[WKContentView _didChangeWebViewEditability]):

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

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

index 4959945..6111514 100644 (file)
@@ -1,3 +1,18 @@
+2019-07-12  Megan Gardner  <megan_gardner@apple.com>
+
+        Turn off two finger gestures for editable non-scaled content
+        https://bugs.webkit.org/show_bug.cgi?id=199739
+        <rdar://problem/52107190>
+
+        Reviewed by Tim Horton.
+
+        This gesture is blocking a selection gesture. Turn it off as it is not
+        even being used in editable content.
+
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView setupInteraction]):
+        (-[WKContentView _didChangeWebViewEditability]):
+
 2019-07-12  Jiewen Tan  <jiewen_tan@apple.com>
 
         SOAuthorizationSession::presentViewController should check WebPageProxy::isClosed()
index 224ed41..fb641a6 100644 (file)
@@ -788,6 +788,7 @@ static inline bool hasFocusedElement(WebKit::FocusedElementInformation focusedEl
     [_twoFingerSingleTapGestureRecognizer setNumberOfTouchesRequired:2];
     [_twoFingerSingleTapGestureRecognizer setDelaysTouchesEnded:NO];
     [_twoFingerSingleTapGestureRecognizer setDelegate:self];
+    [_twoFingerSingleTapGestureRecognizer setEnabled:!_webView._editable];
     [self addGestureRecognizer:_twoFingerSingleTapGestureRecognizer.get()];
 
     _stylusSingleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_stylusSingleTapRecognized:)]);
@@ -4106,6 +4107,8 @@ static void selectionChangedWithTouch(WKContentView *view, const WebCore::IntPoi
 {
     if ([_formAccessoryView respondsToSelector:@selector(setNextPreviousItemsVisible:)])
         [_formAccessoryView setNextPreviousItemsVisible:!_webView._editable];
+    
+    [_twoFingerSingleTapGestureRecognizer setEnabled:!_webView._editable];
 }
 
 - (void)insertTextSuggestion:(UITextSuggestion *)textSuggestion