Title: [219189] tags/Safari-604.1.29/Source/WebKit2
Revision
219189
Author
jmarc...@apple.com
Date
2017-07-05 22:33:22 -0700 (Wed, 05 Jul 2017)

Log Message

Cherry-pick r219157. rdar://problem/32956929

Modified Paths

Diff

Modified: tags/Safari-604.1.29/Source/WebKit2/ChangeLog (219188 => 219189)


--- tags/Safari-604.1.29/Source/WebKit2/ChangeLog	2017-07-06 05:33:19 UTC (rev 219188)
+++ tags/Safari-604.1.29/Source/WebKit2/ChangeLog	2017-07-06 05:33:22 UTC (rev 219189)
@@ -1,5 +1,27 @@
 2017-07-05  Jason Marcell  <jmarc...@apple.com>
 
+        Cherry-pick r219157. rdar://problem/32956929
+
+    2017-07-05  Wenson Hsieh  <wenson_hs...@apple.com>
+
+            [iOS DnD] [WK2] 3D touch fails to recognize when UIDragInteraction is enabled on phone
+            https://bugs.webkit.org/show_bug.cgi?id=174171
+            <rdar://problem/32956929>
+
+            Reviewed by Tim Horton.
+
+            By default, UIKit defers all competing long press gesture recognizers if dragging is enabled. However, this
+            would cause 3D touch to be prevented, due to UIKit asking us whether or not we can proceed with the 3D touch
+            gesture in -_interactionShouldBeginFromPreviewItemController:forPosition:, while the highlight long press
+            gesture recognizer is being deferred. To address this, we use SPI on UIDragInteraction to allow the highlight
+            long press gesture recognizer to recognize alongside the drag lift gesture. We then (already) manually cancel
+            the highlight long press gesture in _dragInteraction:prepareForSession:completion:.
+
+            * UIProcess/ios/WKContentViewInteraction.mm:
+            (-[WKContentView _dragInteraction:shouldDelayCompetingGestureRecognizer:]):
+
+2017-07-05  Jason Marcell  <jmarc...@apple.com>
+
         Cherry-pick r219144. rdar://problem/33086744
 
     2017-07-05  Brent Fulgham  <bfulg...@apple.com>

Modified: tags/Safari-604.1.29/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (219188 => 219189)


--- tags/Safari-604.1.29/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2017-07-06 05:33:19 UTC (rev 219188)
+++ tags/Safari-604.1.29/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2017-07-06 05:33:22 UTC (rev 219189)
@@ -4520,6 +4520,18 @@
 
 #pragma mark - UIDragInteractionDelegate
 
+- (BOOL)_dragInteraction:(UIDragInteraction *)interaction shouldDelayCompetingGestureRecognizer:(UIGestureRecognizer *)competingGestureRecognizer
+{
+    if (_highlightLongPressGestureRecognizer == competingGestureRecognizer) {
+        // Since 3D touch still recognizes alongside the drag lift, and also requires the highlight long press
+        // gesture to be active to support cancelling when `touchstart` is prevented, we should also allow the
+        // highlight long press to recognize simultaneously, and manually cancel it when the drag lift is
+        // recognized (see _dragInteraction:prepareForSession:completion:).
+        return NO;
+    }
+    return [competingGestureRecognizer isKindOfClass:[UILongPressGestureRecognizer class]];
+}
+
 - (void)_dragInteraction:(UIDragInteraction *)interaction prepareForSession:(id <UIDragSession>)session completion:(dispatch_block_t)completion
 {
     [self _cancelLongPressGestureRecognizer];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to