Web pages with unscalable viewports shouldn't have a single tap delay
authorwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Oct 2015 21:20:50 +0000 (21:20 +0000)
committerwenson_hsieh@apple.com <wenson_hsieh@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 14 Oct 2015 21:20:50 +0000 (21:20 +0000)
commit8ce720d043329314ddf0bb66c677a73e77d7ad50
treeeae3dc79c81231839bba379defc3c7cd0fd57eba
parent21341ffc20d7db9dcc9ac8dfb46e77f94e18951b
Web pages with unscalable viewports shouldn't have a single tap delay
https://bugs.webkit.org/show_bug.cgi?id=149968
<rdar://problem/23054453>

Reviewed by Simon Fraser.

Source/WebKit2:

When a viewport is unscalable (specified through the meta viewport tag) we
do not add a delay to our single tap gesture recognizer. We do this by
disabling or reinitializing the WKContentView's double tap gesture recognizer
when the viewport becomes unscalable or scalable, respectively. A viewport is
deemed unscalable when it has user-scalable = no, or when the minimum scale is
greater than or equal to the maximum scale.

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _createAndConfigureDoubleTapGestureRecognizer]): Pulled logic
        for initializing a double tap gesture recognizer out into a helper function.
(-[WKContentView setupInteraction]):
(-[WKContentView _setDoubleTapGesturesEnabled:]): Turns gesture recognition for double
        taps on or off.

LayoutTests:

Add a layout test to check that when a viewport is unscalable (specified through
the meta viewport tag) we do not add a delay to our single tap gesture recognizer.

* fast/events/ios/unscalable-viewport-clicks-on-doubletap-expected.txt: Added.
* fast/events/ios/unscalable-viewport-clicks-on-doubletap.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@191072 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/ios/unscalable-viewport-clicks-on-doubletap-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/ios/unscalable-viewport-clicks-on-doubletap.html [new file with mode: 0644]
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm