Changeset 247206 in webkit


Ignore:
Timestamp:
Jul 8, 2019 4:26:24 AM (5 years ago)
Author:
graouts@webkit.org
Message:

[Pointer Events] touch-action should affect the behavior of pinch-to-zoom to show tabs in Safari
https://bugs.webkit.org/show_bug.cgi?id=199560
<rdar://problem/52742265>

Reviewed by Dean Jackson.

There are other UIPinchGestureRecognizer objects that may lead to pinch-to-zoom behavior, for instance pinching
out to show open tabs in Safari on iOS. We add a new WKUIDelegatePrivate method that will allow Safari to indicate
that a UIPinchGestureRecognizer considered for prevention would lead to pinch-to-zoom behavior.

  • UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView gestureRecognizerMayPinchToZoomWebView:]):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r247205 r247206  
     12019-07-07  Antoine Quint  <graouts@apple.com>
     2
     3        [Pointer Events] touch-action should affect the behavior of pinch-to-zoom to show tabs in Safari
     4        https://bugs.webkit.org/show_bug.cgi?id=199560
     5        <rdar://problem/52742265>
     6
     7        Reviewed by Dean Jackson.
     8
     9        There are other UIPinchGestureRecognizer objects that may lead to pinch-to-zoom behavior, for instance pinching
     10        out to show open tabs in Safari on iOS. We add a new WKUIDelegatePrivate method that will allow Safari to indicate
     11        that a UIPinchGestureRecognizer considered for prevention would lead to pinch-to-zoom behavior.
     12
     13        * UIProcess/API/Cocoa/WKUIDelegatePrivate.h:
     14        * UIProcess/ios/WKContentViewInteraction.mm:
     15        (-[WKContentView gestureRecognizerMayPinchToZoomWebView:]):
     16
    1172019-07-08  Antoine Quint  <graouts@apple.com>
    218
  • trunk/Source/WebKit/UIProcess/API/Cocoa/WKUIDelegatePrivate.h

    r247022 r247206  
    187187- (void)_webView:(WKWebView *)webView didPresentFocusedElementViewController:(UIViewController *)controller WK_API_AVAILABLE(ios(12.0));
    188188- (void)_webView:(WKWebView *)webView didDismissFocusedElementViewController:(UIViewController *)controller WK_API_AVAILABLE(ios(12.0));
     189- (BOOL)_webView:(WKWebView *)webView gestureRecognizerCouldPinch:(UIGestureRecognizer *)gestureRecognizer WK_API_AVAILABLE(ios(13.0));
    189190
    190191/*! @abstract Allows your app to determine whether or not the given security origin should have access to the device's orientation and motion.
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r247205 r247206  
    13911391{
    13921392    // The gesture recognizer is the main UIScrollView's UIPinchGestureRecognizer.
    1393     return gestureRecognizer == [_webView scrollView].pinchGestureRecognizer;
     1393    if (gestureRecognizer == [_webView scrollView].pinchGestureRecognizer)
     1394        return YES;
     1395
     1396    // The gesture recognizer is another UIPichGestureRecognizer known to lead to pinch-to-zoom.
     1397    if ([gestureRecognizer isKindOfClass:[UIPinchGestureRecognizer class]]) {
     1398        if (auto uiDelegate = static_cast<id<WKUIDelegatePrivate>>(_webView.UIDelegate)) {
     1399            if ([uiDelegate respondsToSelector:@selector(_webView:gestureRecognizerCouldPinch:)])
     1400                return [uiDelegate _webView:_webView gestureRecognizerCouldPinch:gestureRecognizer];
     1401        }
     1402    }
     1403    return NO;
    13941404}
    13951405
Note: See TracChangeset for help on using the changeset viewer.