Changeset 247265 in webkit
- Timestamp:
- Jul 9, 2019 11:43:57 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r247259 r247265 1 2019-07-09 Antoine Quint <graouts@apple.com> 2 3 [Pointer Events] Scroll indicators should not show for scrollable content with touch-action: none 4 https://bugs.webkit.org/show_bug.cgi?id=199618 5 6 Reviewed by Simon Fraser. 7 8 Add a new test that swipes "overflow: scroll" content which would show scroll indicators without scrolling 9 prior to this patch. 10 11 * pointerevents/ios/touch-action-none-no-scroll-indicators-expected.html: Added. 12 * pointerevents/ios/touch-action-none-no-scroll-indicators.html: Added. 13 1 14 2019-07-09 Charlie Turner <cturner@igalia.com> 2 15 -
trunk/Source/WebKit/ChangeLog
r247264 r247265 1 2019-07-09 Antoine Quint <graouts@apple.com> 2 3 [Pointer Events] Scroll indicators should not show for scrollable content with touch-action: none 4 https://bugs.webkit.org/show_bug.cgi?id=199618 5 6 Reviewed by Simon Fraser. 7 8 Even though we correctly didn't scroll when "touch-action: none" was specified on an element, we would only apply 9 scrolling constraints after the panning gesture was recognized and the backing UIScrollView would show its scroll 10 indicators. While this is correct when only "pan-x" or "pan-y" is specified, we should not show the scroll indicators 11 at all for "touch-action: none" since no scrolling should happen. 12 13 To do this, we add a new method to the WKTouchActionGestureRecognizerDelegate protocol to indicate whether a given 14 gesture recognizer may pan content in the WKWebView. If the gesture recognizer is the top-level scroll view or one 15 created within the page to back "overflow: scroll" content or an iframe, we correctly make that gesture recognizer 16 fail to recognize if neither "pan-x" nor "pan-y" is specified for this touch identifier. 17 18 * UIProcess/ios/WKContentViewInteraction.mm: 19 (-[WKContentView gestureRecognizerMayPanWebView:]): 20 * UIProcess/ios/WKTouchActionGestureRecognizer.h: 21 * UIProcess/ios/WKTouchActionGestureRecognizer.mm: 22 (-[WKTouchActionGestureRecognizer canPreventGestureRecognizer:]): 23 1 24 2019-07-09 Chris Dumez <cdumez@apple.com> 2 25 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r247233 r247265 1388 1388 #pragma mark - WKTouchActionGestureRecognizerDelegate implementation 1389 1389 1390 - (BOOL)gestureRecognizerMayPanWebView:(UIGestureRecognizer *)gestureRecognizer 1391 { 1392 // The gesture recognizer is the main UIScrollView's UIPanGestureRecognizer. 1393 if (gestureRecognizer == [_webView scrollView].panGestureRecognizer) 1394 return YES; 1395 1396 // The gesture recognizer is a child UIScrollView's UIPanGestureRecognizer created by WebKit. 1397 if (gestureRecognizer.view && [gestureRecognizer.view isKindOfClass:[WKChildScrollView class]]) 1398 return YES; 1399 1400 return NO; 1401 } 1402 1390 1403 - (BOOL)gestureRecognizerMayPinchToZoomWebView:(UIGestureRecognizer *)gestureRecognizer 1391 1404 { -
trunk/Source/WebKit/UIProcess/ios/WKTouchActionGestureRecognizer.h
r247212 r247265 39 39 40 40 @protocol WKTouchActionGestureRecognizerDelegate <NSObject> 41 - (BOOL)gestureRecognizerMayPanWebView:(UIGestureRecognizer *)gestureRecognizer; 41 42 - (BOOL)gestureRecognizerMayPinchToZoomWebView:(UIGestureRecognizer *)gestureRecognizer; 42 43 - (BOOL)gestureRecognizerMayDoubleTapToZoomWebView:(UIGestureRecognizer *)gestureRecognizer; -
trunk/Source/WebKit/UIProcess/ios/WKTouchActionGestureRecognizer.mm
r247212 r247265 92 92 return NO; 93 93 94 auto mayPan = [_touchActionDelegate gestureRecognizerMayPanWebView:preventedGestureRecognizer]; 94 95 auto mayPinchToZoom = [_touchActionDelegate gestureRecognizerMayPinchToZoomWebView:preventedGestureRecognizer]; 95 96 auto mayDoubleTapToZoom = [_touchActionDelegate gestureRecognizerMayDoubleTapToZoomWebView:preventedGestureRecognizer]; 96 97 97 if (!mayP inchToZoom && !mayDoubleTapToZoom)98 if (!mayPan && !mayPinchToZoom && !mayDoubleTapToZoom) 98 99 return NO; 99 100 … … 106 107 auto iterator = _touchActionsByTouchIdentifier.find([touchIdentifier unsignedIntegerValue]); 107 108 if (iterator != _touchActionsByTouchIdentifier.end() && [[activeTouches objectForKey:touchIdentifier].gestureRecognizers containsObject:preventedGestureRecognizer]) { 109 // Panning is only allowed if "pan-x", "pan-y" or "manipulation" is specified. Additional work is needed to respect individual values, but this takes 110 // care of the case where no panning is allowed. 111 if (mayPan && !iterator->value.containsAny({ WebCore::TouchAction::PanX, WebCore::TouchAction::PanY, WebCore::TouchAction::Manipulation })) 112 return YES; 108 113 // Pinch-to-zoom is only allowed if "pinch-zoom" or "manipulation" is specified. 109 114 if (mayPinchToZoom && !iterator->value.containsAny({ WebCore::TouchAction::PinchZoom, WebCore::TouchAction::Manipulation }))
Note: See TracChangeset
for help on using the changeset viewer.