Changeset 247212 in webkit
- Timestamp:
- Jul 8, 2019 11:00:33 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r247207 r247212 1 2019-07-08 Antoine Quint <graouts@apple.com> 2 3 [Pointer Events] "touch-action: none" does not prevent double-tap-to-zoom 4 https://bugs.webkit.org/show_bug.cgi?id=199571 5 <rdar://problem/51715002> 6 7 Reviewed by Wenson Hsieh. 8 9 Add two new tests that check that setting "touch-action: none" on an element does not allow double-tap-to-zoom 10 and that "touch-action: manipulation" allows it. 11 12 * pointerevents/ios/touch-action-manipulation-double-tap-to-zoom-expected.txt: Added. 13 * pointerevents/ios/touch-action-manipulation-double-tap-to-zoom.html: Added. 14 * pointerevents/ios/touch-action-none-double-tap-to-zoom-expected.txt: Added. 15 * pointerevents/ios/touch-action-none-double-tap-to-zoom.html: Added. 16 * pointerevents/utils.js: 17 (const.ui.new.UIController.prototype.doubleTapToZoom): 18 1 19 2019-07-08 Charlie Turner <cturner@igalia.com> 2 20 -
trunk/LayoutTests/pointerevents/utils.js
r246445 r247212 122 122 { 123 123 return this._run(`uiController.singleTapAtPoint(${options.x}, ${options.y})`); 124 } 125 126 doubleTapToZoom(options) 127 { 128 const durationInSeconds = 0.35; 129 return new Promise(resolve => this._run(`uiController.doubleTapAtPoint(${options.x}, ${options.y})`).then(() => 130 setTimeout(resolve, durationInSeconds * 1000) 131 )); 132 return this._run(); 124 133 } 125 134 -
trunk/Source/WebKit/ChangeLog
r247210 r247212 1 2019-07-08 Antoine Quint <graouts@apple.com> 2 3 [Pointer Events] "touch-action: none" does not prevent double-tap-to-zoom 4 https://bugs.webkit.org/show_bug.cgi?id=199571 5 <rdar://problem/51715002> 6 7 Reviewed by Wenson Hsieh. 8 9 We add a new WKTouchActionGestureRecognizerDelegate method to check whether a gesture recognizer may lead to 10 zooming the page as a result of double-tapping, which can be caused by two different gesture recognizers 11 managed by WKContentViewInteraction. If that delegate method returns true and we have "touch-action: none" 12 set for this touch, we cause those gesture recognizers to fail and prevent double-tap-to-zoom behavior. 13 14 * UIProcess/ios/WKContentViewInteraction.mm: 15 (-[WKContentView gestureRecognizerMayDoubleTapToZoomWebView:]): 16 * UIProcess/ios/WKTouchActionGestureRecognizer.h: 17 * UIProcess/ios/WKTouchActionGestureRecognizer.mm: 18 (-[WKTouchActionGestureRecognizer canPreventGestureRecognizer:]): 19 1 20 2019-07-08 Per Arne Vollan <pvollan@apple.com> 2 21 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r247206 r247212 1404 1404 } 1405 1405 1406 - (BOOL)gestureRecognizerMayDoubleTapToZoomWebView:(UIGestureRecognizer *)gestureRecognizer 1407 { 1408 return gestureRecognizer == _doubleTapGestureRecognizer || gestureRecognizer == _twoFingerDoubleTapGestureRecognizer; 1409 } 1410 1406 1411 - (NSMapTable<NSNumber *, UITouch *> *)touchActionActiveTouches 1407 1412 { -
trunk/Source/WebKit/UIProcess/ios/WKTouchActionGestureRecognizer.h
r247205 r247212 40 40 @protocol WKTouchActionGestureRecognizerDelegate <NSObject> 41 41 - (BOOL)gestureRecognizerMayPinchToZoomWebView:(UIGestureRecognizer *)gestureRecognizer; 42 - (BOOL)gestureRecognizerMayDoubleTapToZoomWebView:(UIGestureRecognizer *)gestureRecognizer; 42 43 - (NSMapTable<NSNumber *, UITouch *> *)touchActionActiveTouches; 43 44 @end -
trunk/Source/WebKit/UIProcess/ios/WKTouchActionGestureRecognizer.mm
r247205 r247212 92 92 return NO; 93 93 94 if (![_touchActionDelegate gestureRecognizerMayPinchToZoomWebView:preventedGestureRecognizer]) 94 auto mayPinchToZoom = [_touchActionDelegate gestureRecognizerMayPinchToZoomWebView:preventedGestureRecognizer]; 95 auto mayDoubleTapToZoom = [_touchActionDelegate gestureRecognizerMayDoubleTapToZoomWebView:preventedGestureRecognizer]; 96 97 if (!mayPinchToZoom && !mayDoubleTapToZoom) 95 98 return NO; 96 99 … … 104 107 if (iterator != _touchActionsByTouchIdentifier.end() && [[activeTouches objectForKey:touchIdentifier].gestureRecognizers containsObject:preventedGestureRecognizer]) { 105 108 // Pinch-to-zoom is only allowed if "pinch-zoom" or "manipulation" is specified. 106 if (!iterator->value.containsAny({ WebCore::TouchAction::PinchZoom, WebCore::TouchAction::Manipulation })) 109 if (mayPinchToZoom && !iterator->value.containsAny({ WebCore::TouchAction::PinchZoom, WebCore::TouchAction::Manipulation })) 110 return YES; 111 // Double-tap-to-zoom is only disallowed if "none" is specified. 112 if (mayDoubleTapToZoom && iterator->value.contains(WebCore::TouchAction::None)) 107 113 return YES; 108 114 }
Note: See TracChangeset
for help on using the changeset viewer.