Title: [193573] branches/safari-601.1.46-branch
Revision
193573
Author
[email protected]
Date
2015-12-06 00:09:14 -0800 (Sun, 06 Dec 2015)

Log Message

Merged r191644.  rdar://problem/23766315

Modified Paths

Added Paths

Diff

Modified: branches/safari-601.1.46-branch/LayoutTests/ChangeLog (193572 => 193573)


--- branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/LayoutTests/ChangeLog	2015-12-06 08:09:14 UTC (rev 193573)
@@ -1,3 +1,30 @@
+2015-12-06  Babak Shafiei  <[email protected]>
+
+        Merge r191644.
+
+    2015-10-27  Wenson Hsieh  <[email protected]>
+
+            Implement viewport-width-based fast-click heuristic
+            https://bugs.webkit.org/show_bug.cgi?id=150604
+            <rdar://problem/23267308>
+
+            Reviewed by Simon Fraser.
+
+            Implement a new fast-click heuristic that applies to viewports with width = device-width. Adds
+            new tests to check various fast-clicking behaviors. These three tests check (for pages with width=
+            device-width) that:
+
+            - Double-tapping to zoom still works when the scale is not the initial scale.
+            - If the page is at initial scale, we fire fast-clicks instead of zooming.
+            - When zooming out from element scale, we end up at initial scale instead of minimum scale.
+
+            * fast/events/ios/viewport-device-width-allows-double-tap-zoom-out-expected.txt: Added.
+            * fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html: Added.
+            * fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks-expected.txt: Added.
+            * fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html: Added.
+            * fast/events/ios/viewport-zooms-from-element-to-initial-scale-expected.txt: Added.
+            * fast/events/ios/viewport-zooms-from-element-to-initial-scale.html: Added.
+
 2015-12-05  Babak Shafiei  <[email protected]>
 
         Merge r192953.

Copied: branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out-expected.txt (from rev 191644, trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out-expected.txt) (0 => 193573)


--- branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out-expected.txt	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out-expected.txt	2015-12-06 08:09:14 UTC (rev 193573)
@@ -0,0 +1,2 @@
+The viewport zoomed to scale: 1.6
+

Copied: branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html (from rev 191644, trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html) (0 => 193573)


--- branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html	2015-12-06 08:09:14 UTC (rev 193573)
@@ -0,0 +1,57 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<meta name="viewport" content="initial-scale=1.0, width=device-width">
+<head>
+    <script id="ui-script" type="text/plain">
+        (function() {
+            uiController.didEndZoomingCallback = function() {
+                uiController.uiScriptComplete(uiController.zoomScale);
+            };
+            uiController.doubleTapAtPoint(15, 15, function() {});
+        })();
+    </script>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        function getUIScript()
+        {
+            return document.getElementById("ui-script").text;
+        }
+
+        function runTest()
+        {
+            if (!window.eventSender || !testRunner.runUIScript)
+                return;
+
+            eventSender.scalePageBy(3, 3);
+            testRunner.runUIScript(getUIScript(), function(result) {
+                document.getElementById("target").innerText = "The viewport zoomed to scale: " + result;
+                testRunner.notifyDone();
+            });
+        }
+
+        function handleClick()
+        {
+            document.getElementById("target").innerText = "FAIL: Click fired when we should only be zooming.";
+            testRunner.notifyDone();
+        }
+    </script>
+    <style>
+        body {
+            margin: 0;
+        }
+        #target {
+            height: 100px;
+            width: 100px;
+            background-color: silver;
+        }
+    </style>
+</head>
+<body _onload_="runTest()">
+<div id="target"></div>
+</body>
+</html>

Copied: branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks-expected.txt (from rev 191644, trunk/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks-expected.txt) (0 => 193573)


--- branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks-expected.txt	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks-expected.txt	2015-12-06 08:09:14 UTC (rev 193573)
@@ -0,0 +1,12 @@
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+Repeatedly tapping on the button should fire click events.
+
+This test is best run in WebKitTestRunner. If you are running this test manually, verify that tapping the button causes a "Click!" message to appear below, and that click occurred without the regular 350ms delay for double tapping.
+
+Click!
+Click!
+Click!
+

Copied: branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html (from rev 191644, trunk/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html) (0 => 193573)


--- branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html	2015-12-06 08:09:14 UTC (rev 193573)
@@ -0,0 +1,62 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<meta name="viewport" content="initial-scale=1.0, width=device-width">
+
+<head>
+    <script src=""
+    <script id="ui-script" type="text/plain">
+        (function() {
+            uiController.didEndZoomingCallback = function() {
+                uiController.uiScriptComplete("FAIL: Zoomed to scale " + uiController.zoomScale + " when we should only be firing fast clicks.");
+            };
+
+            function fireSuccessiveSingleTaps() {
+                uiController.singleTapAtPoint(200, 200, fireSuccessiveSingleTaps);
+            }
+            fireSuccessiveSingleTaps();
+        })();
+    </script>
+
+    <script>
+    var clickCount = 0;
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+
+    function getUIScript() {
+        return document.getElementById("ui-script").text;
+    }
+
+    function runTest() {
+        if (testRunner.runUIScript)
+            testRunner.runUIScript(getUIScript(), function(result) { });
+    }
+    function handleClicked() {
+        clickCount++;
+        document.body.appendChild(document.createTextNode("Click!"));
+        document.body.appendChild(document.createElement("br"));
+        if (clickCount == 3)
+            testRunner.notifyDone();
+    }
+    </script>
+
+    <style>
+    body {
+        margin: 0;
+    }
+
+    #target {
+        width: 400px;
+        height: 400px;
+    }
+    </style>
+</head>
+
+<body _onload_="runTest()">
+    <button id="target" _onclick_="handleClicked()"></button>
+    <p>Repeatedly tapping on the button should fire click events.</p>
+    <p>This test is best run in WebKitTestRunner. If you are running this test manually, verify that tapping the button causes a "Click!" message to appear below, and that click occurred without the regular 350ms delay for double tapping.</p>
+    <script src=""
+</body>
+
+</html>

Copied: branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale-expected.txt (from rev 191644, trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale-expected.txt) (0 => 193573)


--- branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale-expected.txt	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale-expected.txt	2015-12-06 08:09:14 UTC (rev 193573)
@@ -0,0 +1 @@
+The viewport zoomed to scale: 5

Copied: branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale.html (from rev 191644, trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale.html) (0 => 193573)


--- branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale.html	                        (rev 0)
+++ branches/safari-601.1.46-branch/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale.html	2015-12-06 08:09:14 UTC (rev 193573)
@@ -0,0 +1,57 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true ] -->
+
+<html>
+<meta name="viewport" content="initial-scale=5, width=device-width">
+<head>
+    <script id="ui-script" type="text/plain">
+        (function() {
+            uiController.didEndZoomingCallback = function() {
+                uiController.uiScriptComplete(uiController.zoomScale);
+            };
+            uiController.doubleTapAtPoint(15, 15, function() {});
+        })();
+    </script>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        function getUIScript()
+        {
+            return document.getElementById("ui-script").text;
+        }
+
+        function runTest()
+        {
+            if (!window.eventSender || !testRunner.runUIScript)
+                return;
+
+            eventSender.scalePageBy(1.6, 1.6);
+            testRunner.runUIScript(getUIScript(), function(result) {
+                document.getElementById("target").innerText = "The viewport zoomed to scale: " + Number(result);
+                testRunner.notifyDone();
+            });
+        }
+
+        function handleClick()
+        {
+            document.getElementById("target").innerText = "FAIL: Click fired when we should only be zooming.";
+            testRunner.notifyDone();
+        }
+    </script>
+    <style>
+        body {
+            margin: 0;
+        }
+        #target {
+            height: 100px;
+            width: 100px;
+            background-color: silver;
+        }
+    </style>
+</head>
+<body _onload_="runTest()">
+<div id="target"></div>
+</body>
+</html>

Modified: branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/ChangeLog	2015-12-06 08:09:14 UTC (rev 193573)
@@ -1,3 +1,89 @@
+2015-12-06  Babak Shafiei  <[email protected]>
+
+        Merge r191644.
+
+    2015-10-27  Wenson Hsieh  <[email protected]>
+
+            Implement viewport-width-based fast-click heuristic
+            https://bugs.webkit.org/show_bug.cgi?id=150604
+            <rdar://problem/23267308>
+
+            Reviewed by Simon Fraser.
+
+            Implement a new fast-click heuristic that applies to viewports with width = device-width. The basic rules are
+            as follows: when a page has viewport width = device-width and is at initial zoom scale, we disable double-tapping
+            in favor of fast-clicking. However, if the viewport scale is not the initial scale, we allow double tapping. For
+            fast-clicking to remain useful after the user pinch-zooms, we change our double-tap to zoom out behavior to zoom
+            to the initial scale rather than the minimum scale. For unscalable viewports, we default to fast-clicking behavior,
+            and for all other viewports not at device-width, we double-tap to zoom and scroll as normal.
+
+            This patch removes some logic previously used for our scroll- and zoom-based fast-clicking heuristic, and adds
+            information about the viewport width and initial scale to RemoteLayerTreeTransactions. This information is then
+            used by the UI process to determine whether double tapping should be disabled or enabled.
+
+            The fast-click heuristic can be turned off through user default preferences, and a tap highlight for debugging
+            fast-clicking can also be enabled through a user default preference. A red highlight indicates that a single-
+            tap was slow, whereas a green highlight indicates a fast single-tap.
+
+            * Shared/mac/RemoteLayerTreeTransaction.h:
+            (WebKit::RemoteLayerTreeTransaction::initialScaleFactor):
+            (WebKit::RemoteLayerTreeTransaction::setInitialScaleFactor):
+            (WebKit::RemoteLayerTreeTransaction::viewportMetaTagWidth):
+            (WebKit::RemoteLayerTreeTransaction::setViewportMetaTagWidth):
+            * Shared/mac/RemoteLayerTreeTransaction.mm:
+            (WebKit::RemoteLayerTreeTransaction::encode):
+            (WebKit::RemoteLayerTreeTransaction::decode):
+            * UIProcess/API/Cocoa/WKWebView.mm:
+            (-[WKWebView initWithFrame:configuration:]):
+            (-[WKWebView _processDidExit]):
+            (-[WKWebView _didCommitLayerTree:]):
+            (-[WKWebView _zoomToInitialScaleWithOrigin:animated:]):
+            (-[WKWebView _allowsDoubleTapGestures]):
+            (-[WKWebView _setViewportMetaTagWidth:]): Deleted.
+            (-[WKWebView _contentZoomScale]): Deleted.
+            (-[WKWebView _viewportMetaTagWidth]): Deleted.
+            (-[WKWebView _viewportIsUserScalable]): Deleted.
+            * UIProcess/API/Cocoa/WKWebViewInternal.h:
+            * UIProcess/API/Cocoa/WKWebViewPrivate.h:
+            * UIProcess/PageClient.h:
+            * UIProcess/WebPageProxy.h:
+            * UIProcess/WebPageProxy.messages.in:
+            * UIProcess/ios/PageClientImplIOS.h:
+            * UIProcess/ios/PageClientImplIOS.mm:
+            (WebKit::PageClientImpl::disableDoubleTapGesturesDuringTapIfNecessary):
+            (WebKit::PageClientImpl::didChangeViewportMetaTagWidth): Deleted.
+            (WebKit::PageClientImpl::disableDoubleTapGesturesUntilTapIsFinishedIfNecessary): Deleted.
+            * UIProcess/ios/SmartMagnificationController.h:
+            * UIProcess/ios/SmartMagnificationController.mm:
+            (WebKit::SmartMagnificationController::didCollectGeometryForSmartMagnificationGesture):
+            * UIProcess/ios/WKContentView.h:
+            * UIProcess/ios/WKContentView.mm:
+            (-[WKContentView _zoomToInitialScaleWithOrigin:]):
+            * UIProcess/ios/WKContentViewInteraction.h:
+            * UIProcess/ios/WKContentViewInteraction.mm:
+            (-[WKContentView setupInteraction]):
+            (-[WKContentView _showTapHighlight]):
+            (-[WKContentView _didGetTapHighlightForRequest:color:quads:topLeftRadius:topRightRadius:bottomLeftRadius:bottomRightRadius:]):
+            (-[WKContentView _mayDisableDoubleTapGesturesDuringSingleTap]):
+            (-[WKContentView _disableDoubleTapGesturesDuringTapIfNecessary:]):
+            (-[WKContentView _finishInteraction]):
+            (-[WKContentView _endPotentialTapAndEnableDoubleTapGesturesIfNecessary]):
+            (-[WKContentView _tapHighlightColorForFastClick:]):
+            (-[WKContentView _setDoubleTapGesturesEnabled:]):
+            (-[WKContentView _fastClickZoomThreshold]): Deleted.
+            (-[WKContentView _allowDoubleTapToZoomForCurrentZoomScale:andTargetZoomScale:]): Deleted.
+            (-[WKContentView _disableDoubleTapGesturesUntilTapIsFinishedIfNecessary:allowsDoubleTapZoom:targetRect:isReplaced:minimumScale:maximumScale:]): Deleted.
+            * UIProcess/ios/WebPageProxyIOS.mm:
+            (WebKit::WebPageProxy::disableDoubleTapGesturesDuringTapIfNecessary):
+            (WebKit::WebPageProxy::viewportMetaTagWidthDidChange): Deleted.
+            (WebKit::WebPageProxy::disableDoubleTapGesturesUntilTapIsFinishedIfNecessary): Deleted.
+            * WebProcess/WebPage/ViewGestureGeometryCollector.h:
+            * WebProcess/WebPage/WebPage.cpp:
+            (WebKit::WebPage::willCommitLayerTree):
+            * WebProcess/WebPage/ios/WebPageIOS.mm:
+            (WebKit::WebPage::potentialTapAtPosition):
+            (WebKit::WebPage::viewportPropertiesDidChange): Deleted.
+
 2015-12-05  Babak Shafiei  <[email protected]>
 
         Merge r191452.

Modified: branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h	2015-12-06 08:09:14 UTC (rev 193573)
@@ -222,6 +222,12 @@
     double maximumScaleFactor() const { return m_maximumScaleFactor; }
     void setMaximumScaleFactor(double scale) { m_maximumScaleFactor = scale; }
 
+    double initialScaleFactor() const { return m_initialScaleFactor; }
+    void setInitialScaleFactor(double scale) { m_initialScaleFactor = scale; }
+
+    double viewportMetaTagWidth() const { return m_viewportMetaTagWidth; }
+    void setViewportMetaTagWidth(double width) { m_viewportMetaTagWidth = width; }
+
     bool allowsUserScaling() const { return m_allowsUserScaling; }
     void setAllowsUserScaling(bool allowsUserScaling) { m_allowsUserScaling = allowsUserScaling; }
 
@@ -253,6 +259,8 @@
     double m_pageScaleFactor;
     double m_minimumScaleFactor;
     double m_maximumScaleFactor;
+    double m_initialScaleFactor { 1 };
+    double m_viewportMetaTagWidth { -1 };
     uint64_t m_renderTreeSize;
     uint64_t m_transactionID;
     bool m_scaleWasSetByUIProcess;

Modified: branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm	2015-12-06 08:09:14 UTC (rev 193573)
@@ -524,6 +524,8 @@
     encoder << m_pageScaleFactor;
     encoder << m_minimumScaleFactor;
     encoder << m_maximumScaleFactor;
+    encoder << m_initialScaleFactor;
+    encoder << m_viewportMetaTagWidth;
 
     encoder << m_renderTreeSize;
     encoder << m_transactionID;
@@ -602,6 +604,12 @@
     if (!decoder.decode(result.m_maximumScaleFactor))
         return false;
 
+    if (!decoder.decode(result.m_initialScaleFactor))
+        return false;
+
+    if (!decoder.decode(result.m_viewportMetaTagWidth))
+        return false;
+
     if (!decoder.decode(result.m_renderTreeSize))
         return false;
 

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm	2015-12-06 08:09:14 UTC (rev 193573)
@@ -171,6 +171,9 @@
     CGSize _maximumUnobscuredSizeOverride;
     CGRect _inputViewBounds;
     CGFloat _viewportMetaTagWidth;
+    CGFloat _initialScaleFactor;
+    BOOL _fastClickingIsDisabled;
+
     BOOL _allowsLinkPreview;
 
     UIEdgeInsets _obscuredInsets;
@@ -350,7 +353,9 @@
     [_scrollView addSubview:[_contentView unscaledView]];
     [self _updateScrollViewBackground];
 
-    _viewportMetaTagWidth = -1;
+    _viewportMetaTagWidth = WebCore::ViewportArguments::ValueAuto;
+    _initialScaleFactor = 1;
+    _fastClickingIsDisabled = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitFastClickingDisabled"];
 
     [self _frameOrBoundsChanged];
 
@@ -795,11 +800,6 @@
     _page->didLayoutForCustomContentProvider();
 }
 
-- (void)_setViewportMetaTagWidth:(float)newWidth
-{
-    _viewportMetaTagWidth = newWidth;
-}
-
 - (void)_willInvokeUIScrollViewDelegateCallback
 {
     _delayUpdateVisibleContentRects = YES;
@@ -912,7 +912,8 @@
     [_scrollView setContentOffset:[self _adjustedContentOffset:CGPointZero]];
     [_scrollView setZoomScale:1];
 
-    _viewportMetaTagWidth = -1;
+    _viewportMetaTagWidth = WebCore::ViewportArguments::ValueAuto;
+    _initialScaleFactor = 1;
     _hasCommittedLoadForMainFrame = NO;
     _needsResetViewStateAfterCommitLoadForMainFrame = NO;
     _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;
@@ -994,7 +995,10 @@
     if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom])
         [_scrollView setZoomScale:layerTreeTransaction.pageScaleFactor()];
 
-    [_contentView _setDoubleTapGesturesEnabled:self._viewportIsUserScalable];
+    _viewportMetaTagWidth = layerTreeTransaction.viewportMetaTagWidth();
+    _initialScaleFactor = layerTreeTransaction.initialScaleFactor();
+    if (![_contentView _mayDisableDoubleTapGesturesDuringSingleTap])
+        [_contentView _setDoubleTapGesturesEnabled:self._allowsDoubleTapGestures];
 
     [self _updateScrollViewBackground];
 
@@ -1276,6 +1280,12 @@
     [self _zoomToPoint:origin atScale:[_scrollView minimumZoomScale] animated:animated];
 }
 
+- (void)_zoomToInitialScaleWithOrigin:(WebCore::FloatPoint)origin animated:(BOOL)animated
+{
+    ASSERT(_initialScaleFactor > 0);
+    [self _zoomToPoint:origin atScale:_initialScaleFactor animated:animated];
+}
+
 // focusedElementRect and selectionRect are both in document coordinates.
 - (void)_zoomToFocusRect:(WebCore::FloatRect)focusedElementRectInDocumentCoordinates selectionRect:(WebCore::FloatRect)selectionRectInDocumentCoordinates fontSize:(float)fontSize minimumScale:(double)minimumScale maximumScale:(double)maximumScale allowScaling:(BOOL)allowScaling forceScroll:(BOOL)forceScroll
 {
@@ -1395,11 +1405,6 @@
                         force:YES];
 }
 
-- (CGFloat)_contentZoomScale
-{
-    return contentZoomScale(self);
-}
-
 - (CGFloat)_targetContentZoomScaleForRect:(const WebCore::FloatRect&)targetRect currentScale:(double)currentScale fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale
 {
     WebCore::FloatSize unobscuredContentSize([self _contentRectForUserInteraction].size);
@@ -3076,14 +3081,20 @@
     return [(WKPDFView *)_customContentView.get() suggestedFilename];
 }
 
-- (CGFloat)_viewportMetaTagWidth
+- (BOOL)_allowsDoubleTapGestures
 {
-    return _viewportMetaTagWidth;
-}
+    if (_fastClickingIsDisabled)
+        return YES;
 
-- (BOOL)_viewportIsUserScalable
-{
-    return [_scrollView isZoomEnabled] && [_scrollView minimumZoomScale] < [_scrollView maximumZoomScale];
+    // If the page is not user scalable, we don't allow double tap gestures.
+    if (![_scrollView isZoomEnabled] || [_scrollView minimumZoomScale] >= [_scrollView maximumZoomScale])
+        return NO;
+
+    // For scalable viewports, only disable double tap gestures if the viewport width is device width.
+    if (_viewportMetaTagWidth != WebCore::ViewportArguments::ValueDeviceWidth)
+        return YES;
+
+    return !areEssentiallyEqualAsFloat(contentZoomScale(self), _initialScaleFactor);
 }
 
 - (_WKWebViewPrintFormatter *)_webViewPrintFormatter

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h	2015-12-06 08:09:14 UTC (rev 193573)
@@ -87,10 +87,10 @@
 - (void)_zoomToFocusRect:(WebCore::FloatRect)focusedElementRect selectionRect:(WebCore::FloatRect)selectionRectInDocumentCoordinates fontSize:(float)fontSize minimumScale:(double)minimumScale maximumScale:(double)maximumScale allowScaling:(BOOL)allowScaling forceScroll:(BOOL)forceScroll;
 - (BOOL)_zoomToRect:(WebCore::FloatRect)targetRect withOrigin:(WebCore::FloatPoint)origin fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale minimumScrollDistance:(float)minimumScrollDistance;
 - (void)_zoomOutWithOrigin:(WebCore::FloatPoint)origin animated:(BOOL)animated;
+- (void)_zoomToInitialScaleWithOrigin:(WebCore::FloatPoint)origin animated:(BOOL)animated;
 
 - (void)_setHasCustomContentView:(BOOL)hasCustomContentView loadedMIMEType:(const WTF::String&)mimeType;
 - (void)_didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:(const WTF::String&)suggestedFilename data:(NSData *)data;
-- (void)_setViewportMetaTagWidth:(float)newWidth;
 
 - (void)_willInvokeUIScrollViewDelegateCallback;
 - (void)_didInvokeUIScrollViewDelegateCallback;
@@ -109,9 +109,7 @@
 - (void)_navigationGestureDidBegin;
 - (void)_navigationGestureDidEnd;
 
-- (CGFloat)_contentZoomScale;
-- (CGFloat)_targetContentZoomScaleForRect:(const WebCore::FloatRect&)targetRect currentScale:(double)currentScale fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale;
-
+@property (nonatomic, readonly) BOOL _allowsDoubleTapGestures;
 @property (nonatomic, readonly) UIEdgeInsets _computedContentInset;
 #else
 @property (nonatomic, setter=_setIgnoresNonWheelEvents:) BOOL _ignoresNonWheelEvents;

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h	2015-12-06 08:09:14 UTC (rev 193573)
@@ -126,10 +126,6 @@
 // FIXME: This can be removed once WKNavigation's response property is implemented.
 @property (nonatomic, readonly) NSString *_suggestedFilenameForDisplayedPDF;
 
-// The viewport meta tag width is negative if the value is not defined.
-@property (nonatomic, readonly) CGFloat _viewportMetaTagWidth;
-@property (nonatomic, readonly) BOOL _viewportIsUserScalable;
-
 @property (nonatomic, readonly) _WKWebViewPrintFormatter *_webViewPrintFormatter;
 
 - (void)_beginInteractiveObscuredInsetsChange;

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/PageClient.h (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/PageClient.h	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/PageClient.h	2015-12-06 08:09:14 UTC (rev 193573)
@@ -277,8 +277,7 @@
     virtual void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) = 0;
     virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) = 0;
     virtual void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale) = 0;
-    virtual void didChangeViewportMetaTagWidth(float) = 0;
-    virtual void disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, const WebCore::FloatRect& targetRect, bool isReplacedElement, double minimumScale, double maximumScale) = 0;
+    virtual void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) = 0;
     virtual double minimumZoomScale() const = 0;
     virtual WebCore::FloatRect documentRect() const = 0;
     virtual void overflowScrollViewWillStartPanGesture() = 0;

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/WebPageProxy.h (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/WebPageProxy.h	2015-12-06 08:09:14 UTC (rev 193573)
@@ -519,8 +519,7 @@
     void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
     void commitPotentialTapFailed();
     void didNotHandleTapAsClick(const WebCore::IntPoint&);
-    void viewportMetaTagWidthDidChange(float width);
-    void disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, const WebCore::FloatRect& targetRect, bool isReplacedElement, double minimumScale, double maximumScale);
+    void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
     void didFinishDrawingPagesToPDF(const IPC::DataReference&);
     void contentSizeCategoryDidChange(const String& contentSizeCategory);
     void getLookupContextAtPoint(const WebCore::IntPoint&, std::function<void(const String&, CallbackBase::Error)>);

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/WebPageProxy.messages.in	2015-12-06 08:09:14 UTC (rev 193573)
@@ -188,8 +188,7 @@
     ZoomToRect(WebCore::FloatRect rect, double minimumScale, double maximumScale)
     CommitPotentialTapFailed()
     DidNotHandleTapAsClick(WebCore::IntPoint point)
-    ViewportMetaTagWidthDidChange(float width)
-    DisableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, WebCore::FloatRect targetRect, bool isReplacedElement, double minimumScale, double maximumScale)
+    DisableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID)
     DidFinishDrawingPagesToPDF(IPC::DataReference pdfData)
 #endif
 #if PLATFORM(GTK)

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h	2015-12-06 08:09:14 UTC (rev 193573)
@@ -133,8 +133,7 @@
     virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect& elementRect) override;
 
     virtual bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;
-    virtual void didChangeViewportMetaTagWidth(float) override;
-    virtual void disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, const WebCore::FloatRect& targetRect, bool isReplacedElement, double minimumScale, double maximumScale) override;
+    virtual void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) override;
     virtual double minimumZoomScale() const override;
     virtual WebCore::FloatRect documentRect() const override;
 

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm	2015-12-06 08:09:14 UTC (rev 193573)
@@ -265,17 +265,12 @@
     notImplemented();
 }
 
-void PageClientImpl::didChangeViewportMetaTagWidth(float newWidth)
+void PageClientImpl::disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID)
 {
-    [m_webView _setViewportMetaTagWidth:newWidth];
-}
-
-void PageClientImpl::disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, const WebCore::FloatRect& targetRect, bool isReplacedElement, double minimumScale, double maximumScale)
-{
-    if (!m_webView._viewportIsUserScalable)
+    if (!m_webView._allowsDoubleTapGestures)
         return;
 
-    [m_contentView _disableDoubleTapGesturesUntilTapIsFinishedIfNecessary:requestID allowsDoubleTapZoom:allowsDoubleTapZoom targetRect:targetRect isReplaced:isReplacedElement minimumScale:minimumScale maximumScale:maximumScale];
+    [m_contentView _disableDoubleTapGesturesDuringTapIfNecessary:requestID];
 }
 
 double PageClientImpl::minimumZoomScale() const

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/SmartMagnificationController.h (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/SmartMagnificationController.h	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/SmartMagnificationController.h	2015-12-06 08:09:14 UTC (rev 193573)
@@ -48,7 +48,6 @@
 
     void handleSmartMagnificationGesture(WebCore::FloatPoint origin);
     void handleResetMagnificationGesture(WebCore::FloatPoint origin);
-    void adjustSmartMagnificationTargetRectAndZoomScales(bool addMagnificationPadding, WebCore::FloatRect& targetRect, double& minimumScale, double& maximumScale);
 
 private:
     // IPC::MessageReceiver.
@@ -56,6 +55,7 @@
 
     void didCollectGeometryForSmartMagnificationGesture(WebCore::FloatPoint origin, WebCore::FloatRect renderRect, WebCore::FloatRect visibleContentBounds, bool isReplacedElement, double viewportMinimumScale, double viewportMaximumScale);
     void magnify(WebCore::FloatPoint origin, WebCore::FloatRect targetRect, WebCore::FloatRect visibleContentRect, double viewportMinimumScale, double viewportMaximumScale);
+    void adjustSmartMagnificationTargetRectAndZoomScales(bool addMagnificationPadding, WebCore::FloatRect& targetRect, double& minimumScale, double& maximumScale);
 
     WebPageProxy& m_webPageProxy;
     WKContentView *m_contentView;

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/SmartMagnificationController.mm (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/SmartMagnificationController.mm	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/SmartMagnificationController.mm	2015-12-06 08:09:14 UTC (rev 193573)
@@ -93,7 +93,7 @@
 {
     if (targetRect.isEmpty()) {
         // FIXME: If we don't zoom, send the tap along to text selection (see <rdar://problem/6810344>).
-        [m_contentView _zoomOutWithOrigin:origin];
+        [m_contentView _zoomToInitialScaleWithOrigin:origin];
         return;
     }
     double minimumScale = viewportMinimumScale;
@@ -119,7 +119,7 @@
         return;
 
     // FIXME: If we still don't zoom, send the tap along to text selection (see <rdar://problem/6810344>).
-    [m_contentView _zoomOutWithOrigin:origin];
+    [m_contentView _zoomToInitialScaleWithOrigin:origin];
 }
 
 void SmartMagnificationController::magnify(FloatPoint origin, FloatRect targetRect, FloatRect visibleContentRect, double viewportMinimumScale, double viewportMaximumScale)

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentView.h (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentView.h	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentView.h	2015-12-06 08:09:14 UTC (rev 193573)
@@ -91,5 +91,6 @@
 - (void)_zoomToFocusRect:(CGRect)rectToFocus selectionRect:(CGRect)selectionRect fontSize:(float)fontSize minimumScale:(double)minimumScale maximumScale:(double)maximumScale allowScaling:(BOOL)allowScaling forceScroll:(BOOL)forceScroll;
 - (BOOL)_zoomToRect:(CGRect)targetRect withOrigin:(CGPoint)origin fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale minimumScrollDistance:(CGFloat)minimumScrollDistance;
 - (void)_zoomOutWithOrigin:(CGPoint)origin;
+- (void)_zoomToInitialScaleWithOrigin:(CGPoint)origin;
 
 @end

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentView.mm	2015-12-06 08:09:14 UTC (rev 193573)
@@ -551,6 +551,11 @@
     return [_webView _zoomOutWithOrigin:origin animated:YES];
 }
 
+- (void)_zoomToInitialScaleWithOrigin:(CGPoint)origin
+{
+    return [_webView _zoomToInitialScaleWithOrigin:origin animated:YES];
+}
+
 - (void)_applicationWillResignActive:(NSNotification*)notification
 {
     _page->applicationWillResignActive();

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h	2015-12-06 08:09:14 UTC (rev 193573)
@@ -164,6 +164,7 @@
     BOOL _inspectorNodeSearchEnabled;
     BOOL _didAccessoryTabInitiateFocus;
     BOOL _isExpectingFastSingleTapCommit;
+    BOOL _showDebugTapHighlightsForFastClicking;
 }
 
 @end
@@ -188,7 +189,8 @@
 - (void)_commitPotentialTapFailed;
 - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&)color quads:(const Vector<WebCore::FloatQuad>&)highlightedQuads topLeftRadius:(const WebCore::IntSize&)topLeftRadius topRightRadius:(const WebCore::IntSize&)topRightRadius bottomLeftRadius:(const WebCore::IntSize&)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&)bottomRightRadius;
 
-- (void)_disableDoubleTapGesturesUntilTapIsFinishedIfNecessary:(uint64_t)requestID allowsDoubleTapZoom:(bool)allowsDoubleTapZoom targetRect:(WebCore::FloatRect)targetRect isReplaced:(BOOL)isReplacedElement minimumScale:(double)minimumScale maximumScale:(double)maximumScale;
+- (BOOL)_mayDisableDoubleTapGesturesDuringSingleTap;
+- (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID;
 - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode userObject:(NSObject <NSSecureCoding> *)userObject;
 - (void)_stopAssistingNode;
 - (void)_selectionChanged;

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm	2015-12-06 08:09:14 UTC (rev 193573)
@@ -388,6 +388,7 @@
     [_actionSheetAssistant setDelegate:self];
     _smartMagnificationController = std::make_unique<SmartMagnificationController>(self);
     _isExpectingFastSingleTapCommit = NO;
+    _showDebugTapHighlightsForFastClicking = [[NSUserDefaults standardUserDefaults] boolForKey:@"WebKitShowFastClickDebugTapHighlights"];
 }
 
 - (void)cleanupInteraction
@@ -752,7 +753,7 @@
 
 - (void)_showTapHighlight
 {
-    if (!highlightedQuadsAreSmallerThanRect(_tapHighlightInformation.quads, _page->unobscuredContentRect()))
+    if (!highlightedQuadsAreSmallerThanRect(_tapHighlightInformation.quads, _page->unobscuredContentRect()) && !_showDebugTapHighlightsForFastClicking)
         return;
 
     if (!_highlightView) {
@@ -772,12 +773,15 @@
 
     _isTapHighlightIDValid = NO;
 
-    _tapHighlightInformation.color = color;
     _tapHighlightInformation.quads = highlightedQuads;
     _tapHighlightInformation.topLeftRadius = topLeftRadius;
     _tapHighlightInformation.topRightRadius = topRightRadius;
     _tapHighlightInformation.bottomLeftRadius = bottomLeftRadius;
     _tapHighlightInformation.bottomRightRadius = bottomRightRadius;
+    if (_showDebugTapHighlightsForFastClicking)
+        _tapHighlightInformation.color = [self _tapHighlightColorForFastClick:![_doubleTapGestureRecognizer isEnabled]];
+    else
+        _tapHighlightInformation.color = color;
 
     if (_potentialTapInProgress) {
         _hasTapHighlightForPotentialTap = YES;
@@ -792,41 +796,16 @@
     }
 }
 
-- (CGFloat)_fastClickZoomThreshold
+- (BOOL)_mayDisableDoubleTapGesturesDuringSingleTap
 {
-    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-    if (![defaults boolForKey:@"WebKitFastClickingEnabled"])
-        return 0;
-
-    return [defaults floatForKey:@"WebKitFastClickZoomThreshold"];
+    return _potentialTapInProgress;
 }
 
-- (BOOL)_allowDoubleTapToZoomForCurrentZoomScale:(CGFloat)currentZoomScale andTargetZoomScale:(CGFloat)targetZoomScale
+- (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID
 {
-    CGFloat zoomThreshold = [self _fastClickZoomThreshold];
-    if (!zoomThreshold)
-        return YES;
-
-    CGFloat minimumZoomRatioForDoubleTapToZoomIn = 1 + zoomThreshold;
-    CGFloat maximumZoomRatioForDoubleTapToZoomOut = 1 / minimumZoomRatioForDoubleTapToZoomIn;
-    CGFloat zoomRatio = targetZoomScale / currentZoomScale;
-    return zoomRatio < maximumZoomRatioForDoubleTapToZoomOut || zoomRatio > minimumZoomRatioForDoubleTapToZoomIn;
-}
-
-- (void)_disableDoubleTapGesturesUntilTapIsFinishedIfNecessary:(uint64_t)requestID allowsDoubleTapZoom:(bool)allowsDoubleTapZoom targetRect:(WebCore::FloatRect)targetRect isReplaced:(BOOL)isReplacedElement minimumScale:(double)minimumScale maximumScale:(double)maximumScale
-{
     if (!_potentialTapInProgress || _latestTapID != requestID)
         return;
 
-    if (allowsDoubleTapZoom) {
-        // Though the element allows us to zoom in on double tap, we avoid this behavior in favor of fast clicking if the difference in scale is insignificant.
-        _smartMagnificationController->adjustSmartMagnificationTargetRectAndZoomScales(!isReplacedElement, targetRect, minimumScale, maximumScale);
-        CGFloat currentZoomScale = [_webView _contentZoomScale];
-        CGFloat targetZoomScale = [_webView _targetContentZoomScaleForRect:targetRect currentScale:currentZoomScale fitEntireRect:isReplacedElement minimumScale:minimumScale maximumScale:maximumScale];
-        if ([self _allowDoubleTapToZoomForCurrentZoomScale:currentZoomScale andTargetZoomScale:targetZoomScale])
-            return;
-    }
-
     [self _setDoubleTapGesturesEnabled:NO];
 }
 
@@ -1064,7 +1043,8 @@
 - (void)_finishInteraction
 {
     _isTapHighlightIDValid = NO;
-    [UIView animateWithDuration:0.1
+    CGFloat tapHighlightFadeDuration = _showDebugTapHighlightsForFastClicking ? 0.25 : 0.1;
+    [UIView animateWithDuration:tapHighlightFadeDuration
                      animations:^{
                          [_highlightView layer].opacity = 0;
                      }
@@ -1170,7 +1150,7 @@
 
 - (void)_endPotentialTapAndEnableDoubleTapGesturesIfNecessary
 {
-    if (_webView._viewportIsUserScalable)
+    if (_webView._allowsDoubleTapGestures)
         [self _setDoubleTapGesturesEnabled:YES];
 
     _potentialTapInProgress = NO;
@@ -2326,6 +2306,12 @@
     });
 }
 
+- (WebCore::Color)_tapHighlightColorForFastClick:(BOOL)forFastClick
+{
+    ASSERT(_showDebugTapHighlightsForFastClicking);
+    return forFastClick ? WebCore::Color(0, 225, 0, 127) : WebCore::Color(225, 0, 0, 127);
+}
+
 - (void)_setDoubleTapGesturesEnabled:(BOOL)enabled
 {
     if (enabled && ![_doubleTapGestureRecognizer isEnabled]) {
@@ -2335,6 +2321,10 @@
         [_doubleTapGestureRecognizer setDelegate:nil];
         [self _createAndConfigureDoubleTapGestureRecognizer];
     }
+
+    if (_showDebugTapHighlightsForFastClicking && !enabled)
+        _tapHighlightInformation.color = [self _tapHighlightColorForFastClick:YES];
+
     [_doubleTapGestureRecognizer setEnabled:enabled];
 }
 

Modified: branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm	2015-12-06 08:09:14 UTC (rev 193573)
@@ -914,16 +914,11 @@
     m_uiClient->didNotHandleTapAsClick(point);
 }
 
-void WebPageProxy::viewportMetaTagWidthDidChange(float width)
+void WebPageProxy::disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID)
 {
-    m_pageClient.didChangeViewportMetaTagWidth(width);
+    m_pageClient.disableDoubleTapGesturesDuringTapIfNecessary(requestID);
 }
 
-void WebPageProxy::disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, const WebCore::FloatRect& targetRect, bool isReplacedElement, double minimumScale, double maximumScale)
-{
-    m_pageClient.disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(requestID, allowsDoubleTapZoom, targetRect, isReplacedElement, minimumScale, maximumScale);
-}
-
 void WebPageProxy::didFinishDrawingPagesToPDF(const IPC::DataReference& pdfData)
 {
     m_pageClient.didFinishDrawingPagesToPDF(pdfData);

Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.h (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.h	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.h	2015-12-06 08:09:14 UTC (rev 193573)
@@ -45,7 +45,6 @@
     ~ViewGestureGeometryCollector();
 
     void mainFrameDidLayout();
-    void computeZoomInformationForNode(WebCore::Node&, WebCore::FloatPoint& origin, WebCore::FloatRect& renderRect, bool& isReplaced, double& viewportMinimumScale, double& viewportMaximumScale);
 
 private:
     // IPC::MessageReceiver.
@@ -62,6 +61,7 @@
 #endif
 
     void dispatchDidCollectGeometryForSmartMagnificationGesture(WebCore::FloatPoint origin, WebCore::FloatRect targetRect, WebCore::FloatRect visibleContentRect, bool isReplacedElement, double viewportMinimumScale, double viewportMaximumScale);
+    void computeZoomInformationForNode(WebCore::Node&, WebCore::FloatPoint& origin, WebCore::FloatRect& renderRect, bool& isReplaced, double& viewportMinimumScale, double& viewportMaximumScale);
 
     WebPage& m_webPage;
 

Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2015-12-06 08:09:14 UTC (rev 193573)
@@ -2951,6 +2951,8 @@
     layerTransaction.setScaleWasSetByUIProcess(scaleWasSetByUIProcess());
     layerTransaction.setMinimumScaleFactor(m_viewportConfiguration.minimumScale());
     layerTransaction.setMaximumScaleFactor(m_viewportConfiguration.maximumScale());
+    layerTransaction.setInitialScaleFactor(m_viewportConfiguration.initialScale());
+    layerTransaction.setViewportMetaTagWidth(m_viewportConfiguration.viewportArguments().width);
     layerTransaction.setAllowsUserScaling(allowsUserScaling());
 #endif
 #if PLATFORM(MAC)

Modified: branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (193572 => 193573)


--- branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-12-06 07:58:39 UTC (rev 193572)
+++ branches/safari-601.1.46-branch/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm	2015-12-06 08:09:14 UTC (rev 193573)
@@ -233,13 +233,8 @@
     if (m_viewportConfiguration.viewportArguments() == viewportArguments)
         return;
 
-    float oldWidth = m_viewportConfiguration.viewportArguments().width;
-
     m_viewportConfiguration.setViewportArguments(viewportArguments);
     viewportConfigurationChanged();
-
-    if (oldWidth != viewportArguments.width)
-        send(Messages::WebPageProxy::ViewportMetaTagWidthDidChange(viewportArguments.width));
 }
 
 void WebPage::didReceiveMobileDocType(bool isMobileDoctype)
@@ -662,22 +657,10 @@
 {
     m_potentialTapNode = m_page->mainFrame().nodeRespondingToClickEvents(position, m_potentialTapLocation);
     sendTapHighlightForNodeIfNecessary(requestID, m_potentialTapNode.get());
-    if (m_potentialTapNode) {
 #if ENABLE(TOUCH_EVENTS)
-        if (!m_potentialTapNode->allowsDoubleTapGesture()) {
-            send(Messages::WebPageProxy::DisableDoubleTapGesturesUntilTapIsFinishedIfNecessary(requestID, false, FloatRect(), false, 0, 0));
-            return;
-        }
+    if (m_potentialTapNode && !m_potentialTapNode->allowsDoubleTapGesture())
+        send(Messages::WebPageProxy::DisableDoubleTapGesturesDuringTapIfNecessary(requestID));
 #endif
-        FloatPoint origin = position;
-        FloatRect renderRect;
-        bool isReplaced;
-        double viewportMinimumScale;
-        double viewportMaximumScale;
-
-        m_viewGestureGeometryCollector.computeZoomInformationForNode(*m_potentialTapNode.get(), origin, renderRect, isReplaced, viewportMinimumScale, viewportMaximumScale);
-        send(Messages::WebPageProxy::DisableDoubleTapGesturesUntilTapIsFinishedIfNecessary(requestID, true, renderRect, isReplaced, viewportMinimumScale, viewportMaximumScale));
-    }
 }
 
 void WebPage::commitPotentialTap(uint64_t lastLayerTreeTransactionId)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to