Title: [211185] branches/safari-603-branch/Source/WebKit2

Diff

Modified: branches/safari-603-branch/Source/WebKit2/ChangeLog (211184 => 211185)


--- branches/safari-603-branch/Source/WebKit2/ChangeLog	2017-01-26 01:40:48 UTC (rev 211184)
+++ branches/safari-603-branch/Source/WebKit2/ChangeLog	2017-01-26 01:40:52 UTC (rev 211185)
@@ -1,3 +1,30 @@
+2017-01-25  Matthew Hanson  <matthew_han...@apple.com>
+
+        Merge r211121. rdar://problem/22938927
+
+    2017-01-24  Tim Horton  <timothy_hor...@apple.com>
+
+            Script gets touch events even after navigation swipe begins
+            https://bugs.webkit.org/show_bug.cgi?id=167383
+            <rdar://problem/22938927>
+
+            Reviewed by Simon Fraser.
+
+            * Platform/spi/ios/UIKitSPI.h:
+            * UIProcess/API/Cocoa/WKWebView.mm:
+            (-[WKWebView _isNavigationSwipeGestureRecognizer:]):
+            * UIProcess/API/Cocoa/WKWebViewInternal.h:
+            * UIProcess/Cocoa/ViewGestureController.h:
+            * UIProcess/ios/ViewGestureControllerIOS.mm:
+            (-[WKSwipeTransitionController isNavigationSwipeGestureRecognizer:]):
+            (WebKit::ViewGestureController::isNavigationSwipeGestureRecognizer):
+            * UIProcess/ios/WKContentViewInteraction.mm:
+            (-[WKContentView gestureRecognizer:shouldRequireFailureOfGestureRecognizer:]):
+            Require the navigation swipe gesture recognizer to fail before the
+            UIWebTouchEventsGestureRecognizer can recognize. This way, the page
+            doesn't get touch events during the swipe, which previously led to
+            e.g. carousels scrolling while swiping.
+
 2017-01-25  Dean Jackson  <d...@apple.com>
 
         Disable Variation fonts on this branch.

Modified: branches/safari-603-branch/Source/WebKit2/Platform/spi/ios/UIKitSPI.h (211184 => 211185)


--- branches/safari-603-branch/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2017-01-26 01:40:48 UTC (rev 211184)
+++ branches/safari-603-branch/Source/WebKit2/Platform/spi/ios/UIKitSPI.h	2017-01-26 01:40:52 UTC (rev 211185)
@@ -742,6 +742,7 @@
 
 @interface _UINavigationInteractiveTransitionBase ()
 - (id)initWithGestureRecognizerView:(UIView *)gestureRecognizerView animator:(id<UIViewControllerAnimatedTransitioning>)animator delegate:(id<_UINavigationInteractiveTransitionBaseDelegate>)delegate;
+@property (nonatomic, weak) UIPanGestureRecognizer *gestureRecognizer;
 @property (nonatomic, assign) BOOL shouldReverseTranslation;
 @property (nonatomic, retain) _UINavigationParallaxTransition *animationController;
 @end

Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (211184 => 211185)


--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-01-26 01:40:48 UTC (rev 211184)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2017-01-26 01:40:52 UTC (rev 211185)
@@ -2304,6 +2304,13 @@
     return _allowsBackForwardNavigationGestures;
 }
 
+- (BOOL)_isNavigationSwipeGestureRecognizer:(UIGestureRecognizer *)recognizer
+{
+    if (!_gestureController)
+        return NO;
+    return _gestureController->isNavigationSwipeGestureRecognizer(recognizer);
+}
+
 - (void)_navigationGestureDidBegin
 {
     // During a back/forward swipe, there's a view interposed between this view and the content view that has

Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (211184 => 211185)


--- branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2017-01-26 01:40:48 UTC (rev 211184)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2017-01-26 01:40:52 UTC (rev 211185)
@@ -114,6 +114,7 @@
 
 - (void)_navigationGestureDidBegin;
 - (void)_navigationGestureDidEnd;
+- (BOOL)_isNavigationSwipeGestureRecognizer:(UIGestureRecognizer *)recognizer;
 
 @property (nonatomic, readonly) BOOL _isBackground;
 

Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/Cocoa/ViewGestureController.h (211184 => 211185)


--- branches/safari-603-branch/Source/WebKit2/UIProcess/Cocoa/ViewGestureController.h	2017-01-26 01:40:48 UTC (rev 211184)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/Cocoa/ViewGestureController.h	2017-01-26 01:40:52 UTC (rev 211185)
@@ -39,6 +39,7 @@
 OBJC_CLASS CALayer;
 
 #if PLATFORM(IOS)
+OBJC_CLASS UIGestureRecognizer;
 OBJC_CLASS UIView;
 OBJC_CLASS WKSwipeTransitionController;
 OBJC_CLASS _UINavigationInteractiveTransitionBase;
@@ -105,6 +106,7 @@
 
     bool isPhysicallySwipingLeft(SwipeDirection) const;
 #else
+    bool isNavigationSwipeGestureRecognizer(UIGestureRecognizer *) const;
     void installSwipeHandler(UIView *gestureRecognizerView, UIView *swipingView);
     void beginSwipeGesture(_UINavigationInteractiveTransitionBase *, SwipeDirection);
     void endSwipeGesture(WebBackForwardListItem* targetItem, _UIViewControllerTransitionContext *, bool cancelled);

Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm (211184 => 211185)


--- branches/safari-603-branch/Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm	2017-01-26 01:40:48 UTC (rev 211184)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/ios/ViewGestureControllerIOS.mm	2017-01-26 01:40:52 UTC (rev 211185)
@@ -129,6 +129,11 @@
     return [recognizer autorelease];
 }
 
+- (BOOL)isNavigationSwipeGestureRecognizer:(UIGestureRecognizer *)recognizer
+{
+    return recognizer == [_backTransitionController gestureRecognizer] || recognizer == [_forwardTransitionController gestureRecognizer];
+}
+
 @end
 
 namespace WebKit {
@@ -141,6 +146,11 @@
     [m_swipeInteractiveTransitionDelegate invalidate];
 }
 
+bool ViewGestureController::isNavigationSwipeGestureRecognizer(UIGestureRecognizer *recognizer) const
+{
+    return [m_swipeInteractiveTransitionDelegate isNavigationSwipeGestureRecognizer:recognizer];
+}
+
 void ViewGestureController::installSwipeHandler(UIView *gestureRecognizerView, UIView *swipingView)
 {
     ASSERT(!m_swipeInteractiveTransitionDelegate);

Modified: branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (211184 => 211185)


--- branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2017-01-26 01:40:48 UTC (rev 211184)
+++ branches/safari-603-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2017-01-26 01:40:52 UTC (rev 211185)
@@ -1193,6 +1193,14 @@
     return NO;
 }
 
+- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRequireFailureOfGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer
+{
+    if (gestureRecognizer == _touchEventGestureRecognizer && [_webView _isNavigationSwipeGestureRecognizer:otherGestureRecognizer])
+        return YES;
+
+    return NO;
+}
+
 - (void)_showImageSheet
 {
     [_actionSheetAssistant showImageSheet];
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to