Changeset 191072 in webkit
- Timestamp:
- Oct 14, 2015 2:20:50 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r191066 r191072 1 2015-10-14 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Web pages with unscalable viewports shouldn't have a single tap delay 4 https://bugs.webkit.org/show_bug.cgi?id=149968 5 <rdar://problem/23054453> 6 7 Reviewed by Simon Fraser. 8 9 Add a layout test to check that when a viewport is unscalable (specified through 10 the meta viewport tag) we do not add a delay to our single tap gesture recognizer. 11 12 * fast/events/ios/unscalable-viewport-clicks-on-doubletap-expected.txt: Added. 13 * fast/events/ios/unscalable-viewport-clicks-on-doubletap.html: Added. 14 1 15 2015-10-14 Jiewen Tan <jiewen_tan@apple.com> 2 16 -
trunk/Source/WebKit2/ChangeLog
r191065 r191072 1 2015-10-14 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Web pages with unscalable viewports shouldn't have a single tap delay 4 https://bugs.webkit.org/show_bug.cgi?id=149968 5 <rdar://problem/23054453> 6 7 Reviewed by Simon Fraser. 8 9 When a viewport is unscalable (specified through the meta viewport tag) we 10 do not add a delay to our single tap gesture recognizer. We do this by 11 disabling or reinitializing the WKContentView's double tap gesture recognizer 12 when the viewport becomes unscalable or scalable, respectively. A viewport is 13 deemed unscalable when it has user-scalable = no, or when the minimum scale is 14 greater than or equal to the maximum scale. 15 16 * UIProcess/API/Cocoa/WKWebView.mm: 17 (-[WKWebView _didCommitLayerTree:]): 18 * UIProcess/ios/WKContentViewInteraction.h: 19 * UIProcess/ios/WKContentViewInteraction.mm: 20 (-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]): Pulled logic 21 for initializing a double tap gesture recognizer out into a helper function. 22 (-[WKContentView setupInteraction]): 23 (-[WKContentView _setDoubleTapGesturesEnabled:]): Turns gesture recognition for double 24 taps on or off. 25 1 26 2015-10-14 Anders Carlsson <andersca@apple.com> 2 27 -
trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
r191063 r191072 1007 1007 [_scrollView setZoomScale:layerTreeTransaction.pageScaleFactor()]; 1008 1008 1009 [_contentView _setDoubleTapGesturesEnabled:[_scrollView isZoomEnabled] && [_scrollView minimumZoomScale] < [_scrollView maximumZoomScale]]; 1010 1009 1011 [self _updateScrollViewBackground]; 1010 1012 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
r190284 r191072 204 204 - (void)_disableInspectorNodeSearch; 205 205 - (void)_becomeFirstResponderWithSelectionMovingForward:(BOOL)selectingForward completionHandler:(void (^)(BOOL didBecomeFirstResponder))completionHandler; 206 - (void)_setDoubleTapGesturesEnabled:(BOOL)enabled; 206 207 @end 207 208 -
trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
r190841 r191072 297 297 } 298 298 299 - (void)_createAndConfigureDoubleTapGestureRecognizer 300 { 301 _doubleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_doubleTapRecognized:)]); 302 [_doubleTapGestureRecognizer setNumberOfTapsRequired:2]; 303 [_doubleTapGestureRecognizer setDelegate:self]; 304 [self addGestureRecognizer:_doubleTapGestureRecognizer.get()]; 305 [_singleTapGestureRecognizer requireOtherGestureToFail:_doubleTapGestureRecognizer.get()]; 306 } 307 299 308 - (void)setupInteraction 300 309 { … … 320 329 [self addGestureRecognizer:_singleTapGestureRecognizer.get()]; 321 330 322 _doubleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_doubleTapRecognized:)]); 323 [_doubleTapGestureRecognizer setNumberOfTapsRequired:2]; 324 [_doubleTapGestureRecognizer setDelegate:self]; 325 [self addGestureRecognizer:_doubleTapGestureRecognizer.get()]; 326 [_singleTapGestureRecognizer requireOtherGestureToFail:_doubleTapGestureRecognizer.get()]; 331 [self _createAndConfigureDoubleTapGestureRecognizer]; 327 332 328 333 _twoFingerDoubleTapGestureRecognizer = adoptNS([[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(_twoFingerDoubleTapRecognized:)]); … … 2240 2245 } 2241 2246 2247 - (void)_setDoubleTapGesturesEnabled:(BOOL)enabled 2248 { 2249 if (enabled && ![_doubleTapGestureRecognizer isEnabled]) { 2250 // The first tap recognized after re-enabling double tap gestures will not wait for the 2251 // second tap before committing. To fix this, we use a new double tap gesture recognizer. 2252 [self removeGestureRecognizer:_doubleTapGestureRecognizer.get()]; 2253 [_doubleTapGestureRecognizer setDelegate:nil]; 2254 [self _createAndConfigureDoubleTapGestureRecognizer]; 2255 } 2256 [_doubleTapGestureRecognizer setEnabled:enabled]; 2257 } 2258 2242 2259 - (void)accessoryAutoFill 2243 2260 {
Note: See TracChangeset
for help on using the changeset viewer.