Title: [244296] trunk/Source/WebKit
Revision
244296
Author
[email protected]
Date
2019-04-15 14:58:08 -0700 (Mon, 15 Apr 2019)

Log Message

Provide option to not create a longpress gesture recognizer
https://bugs.webkit.org/show_bug.cgi?id=196937
<rdar://problem/49918278>

Reviewed by Antoine Quint.

A WebKitAdditions file has changed name to WKContentViewInteractionWKInteraction.mm.

Add a property to toggle if we should add a long press gesture
recognizer.

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

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (244295 => 244296)


--- trunk/Source/WebKit/ChangeLog	2019-04-15 21:55:33 UTC (rev 244295)
+++ trunk/Source/WebKit/ChangeLog	2019-04-15 21:58:08 UTC (rev 244296)
@@ -1,3 +1,22 @@
+2019-04-15  Dean Jackson  <[email protected]>
+
+        Provide option to not create a longpress gesture recognizer
+        https://bugs.webkit.org/show_bug.cgi?id=196937
+        <rdar://problem/49918278>
+
+        Reviewed by Antoine Quint.
+
+        A WebKitAdditions file has changed name to WKContentViewInteractionWKInteraction.mm.
+
+        Add a property to toggle if we should add a long press gesture
+        recognizer.
+
+        * UIProcess/ios/WKContentViewInteraction.h:
+        * UIProcess/ios/WKContentViewInteraction.mm:
+        (-[WKContentView setupInteraction]):
+        (shouldUsePreviewForLongPress):
+        (-[WKContentView shouldUsePreviewForLongPress]):
+
 2019-04-15  Don Olmstead  <[email protected]>
 
         [CMake] WebCore derived sources should only be referenced inside WebCore

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h (244295 => 244296)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2019-04-15 21:55:33 UTC (rev 244295)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h	2019-04-15 21:58:08 UTC (rev 244296)
@@ -502,8 +502,11 @@
 #if HAVE(LINK_PREVIEW)
 @interface WKContentView (WKInteractionPreview) <UIPreviewItemDelegate>
 
+@property (nonatomic, readonly) BOOL shouldUsePreviewForLongPress;
+
 - (void)_registerPreview;
 - (void)_unregisterPreview;
+
 @end
 #endif
 

Modified: trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm (244295 => 244296)


--- trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-04-15 21:55:33 UTC (rev 244295)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm	2019-04-15 21:58:08 UTC (rev 244296)
@@ -742,7 +742,8 @@
     [_highlightLongPressGestureRecognizer setDelegate:self];
     [self addGestureRecognizer:_highlightLongPressGestureRecognizer.get()];
 
-    [self _createAndConfigureLongPressGestureRecognizer];
+    if (!self.shouldUsePreviewForLongPress)
+        [self _createAndConfigureLongPressGestureRecognizer];
 
 #if ENABLE(DATA_INTERACTION)
     [self setupDragAndDropInteractions];
@@ -1699,8 +1700,8 @@
     return _page->editorState().postLayoutData().focusedElementRect;
 }
 
-#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKContentViewInteraction.mm>)
-#include <WebKitAdditions/WKContentViewInteraction.mm>
+#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKContentViewInteractionWKInteraction.mm>)
+#include <WebKitAdditions/WKContentViewInteractionWKInteraction.mm>
 #else
 
 - (BOOL)gestureRecognizer:(UIGestureRecognizer *)preventingGestureRecognizer canPreventGestureRecognizer:(UIGestureRecognizer *)preventedGestureRecognizer
@@ -7129,6 +7130,20 @@
 
 @implementation WKContentView (WKInteractionPreview)
 
+#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKInteractionPreviewAdditions.mm>)
+#include <WebKitAdditions/WKInteractionPreviewAdditions.mm>
+#else
+static BOOL shouldUsePreviewForLongPress()
+{
+    return NO;
+}
+#endif
+
+- (BOOL)shouldUsePreviewForLongPress
+{
+    return shouldUsePreviewForLongPress();
+}
+
 - (void)_registerPreview
 {
     if (!_webView.allowsLinkPreview)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to