<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[191644] trunk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/191644">191644</a></dd>
<dt>Author</dt> <dd>wenson_hsieh@apple.com</dd>
<dt>Date</dt> <dd>2015-10-27 16:34:54 -0700 (Tue, 27 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Implement viewport-width-based fast-click heuristic
https://bugs.webkit.org/show_bug.cgi?id=150604
&lt;rdar://problem/23267308&gt;

Reviewed by Simon Fraser.

Source/WebKit2:

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.

LayoutTests:

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.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionh">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h</a></li>
<li><a href="#trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm">trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh">trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessPageClienth">trunk/Source/WebKit2/UIProcess/PageClient.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSh">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosPageClientImplIOSmm">trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosSmartMagnificationControllerh">trunk/Source/WebKit2/UIProcess/ios/SmartMagnificationController.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosSmartMagnificationControllermm">trunk/Source/WebKit2/UIProcess/ios/SmartMagnificationController.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewh">trunk/Source/WebKit2/UIProcess/ios/WKContentView.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewmm">trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionh">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm">trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm">trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageViewGestureGeometryCollectorh">trunk/Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.h</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm">trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasteventsiosviewportdevicewidthallowsdoubletapzoomoutexpectedtxt">trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsiosviewportdevicewidthallowsdoubletapzoomouthtml">trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html</a></li>
<li><a href="#trunkLayoutTestsfasteventsiosviewportdevicewidthatinitialscalefastclicksexpectedtxt">trunk/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsiosviewportdevicewidthatinitialscalefastclickshtml">trunk/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html</a></li>
<li><a href="#trunkLayoutTestsfasteventsiosviewportzoomsfromelementtoinitialscaleexpectedtxt">trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsiosviewportzoomsfromelementtoinitialscalehtml">trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/LayoutTests/ChangeLog        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2015-10-27  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        Implement viewport-width-based fast-click heuristic
+        https://bugs.webkit.org/show_bug.cgi?id=150604
+        &lt;rdar://problem/23267308&gt;
+
+        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.
+
</ins><span class="cx"> 2015-10-27  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Cleaning up formatting on recent additions win TestExpectations file
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsiosviewportdevicewidthallowsdoubletapzoomoutexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out-expected.txt (0 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out-expected.txt        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -0,0 +1,2 @@
</span><ins>+The viewport zoomed to scale: 1.6
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsiosviewportdevicewidthallowsdoubletapzoomouthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html (0 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/viewport-device-width-allows-double-tap-zoom-out.html        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+&lt;!DOCTYPE html&gt; &lt;!-- webkit-test-runner [ useFlexibleViewport=true ] --&gt;
+
+&lt;html&gt;
+&lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1.0, width=device-width&quot;&gt;
+&lt;head&gt;
+    &lt;script id=&quot;ui-script&quot; type=&quot;text/plain&quot;&gt;
+        (function() {
+            uiController.didEndZoomingCallback = function() {
+                uiController.uiScriptComplete(uiController.zoomScale);
+            };
+            uiController.doubleTapAtPoint(15, 15, function() {});
+        })();
+    &lt;/script&gt;
+    &lt;script&gt;
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        function getUIScript()
+        {
+            return document.getElementById(&quot;ui-script&quot;).text;
+        }
+
+        function runTest()
+        {
+            if (!window.eventSender || !testRunner.runUIScript)
+                return;
+
+            eventSender.scalePageBy(3, 3);
+            testRunner.runUIScript(getUIScript(), function(result) {
+                document.getElementById(&quot;target&quot;).innerText = &quot;The viewport zoomed to scale: &quot; + result;
+                testRunner.notifyDone();
+            });
+        }
+
+        function handleClick()
+        {
+            document.getElementById(&quot;target&quot;).innerText = &quot;FAIL: Click fired when we should only be zooming.&quot;;
+            testRunner.notifyDone();
+        }
+    &lt;/script&gt;
+    &lt;style&gt;
+        body {
+            margin: 0;
+        }
+        #target {
+            height: 100px;
+            width: 100px;
+            background-color: silver;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+&lt;div id=&quot;target&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsiosviewportdevicewidthatinitialscalefastclicksexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks-expected.txt (0 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks-expected.txt        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+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 &quot;Click!&quot; message to appear below, and that click occurred without the regular 350ms delay for double tapping.
+
+Click!
+Click!
+Click!
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsiosviewportdevicewidthatinitialscalefastclickshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html (0 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -0,0 +1,62 @@
</span><ins>+&lt;!DOCTYPE html&gt; &lt;!-- webkit-test-runner [ useFlexibleViewport=true ] --&gt;
+
+&lt;html&gt;
+&lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1.0, width=device-width&quot;&gt;
+
+&lt;head&gt;
+    &lt;script src=&quot;../../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+    &lt;script id=&quot;ui-script&quot; type=&quot;text/plain&quot;&gt;
+        (function() {
+            uiController.didEndZoomingCallback = function() {
+                uiController.uiScriptComplete(&quot;FAIL: Zoomed to scale &quot; + uiController.zoomScale + &quot; when we should only be firing fast clicks.&quot;);
+            };
+
+            function fireSuccessiveSingleTaps() {
+                uiController.singleTapAtPoint(200, 200, fireSuccessiveSingleTaps);
+            }
+            fireSuccessiveSingleTaps();
+        })();
+    &lt;/script&gt;
+
+    &lt;script&gt;
+    var clickCount = 0;
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+
+    function getUIScript() {
+        return document.getElementById(&quot;ui-script&quot;).text;
+    }
+
+    function runTest() {
+        if (testRunner.runUIScript)
+            testRunner.runUIScript(getUIScript(), function(result) { });
+    }
+    function handleClicked() {
+        clickCount++;
+        document.body.appendChild(document.createTextNode(&quot;Click!&quot;));
+        document.body.appendChild(document.createElement(&quot;br&quot;));
+        if (clickCount == 3)
+            testRunner.notifyDone();
+    }
+    &lt;/script&gt;
+
+    &lt;style&gt;
+    body {
+        margin: 0;
+    }
+
+    #target {
+        width: 400px;
+        height: 400px;
+    }
+    &lt;/style&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;button id=&quot;target&quot; onclick=&quot;handleClicked()&quot;&gt;&lt;/button&gt;
+    &lt;p&gt;Repeatedly tapping on the button should fire click events.&lt;/p&gt;
+    &lt;p&gt;This test is best run in WebKitTestRunner. If you are running this test manually, verify that tapping the button causes a &quot;Click!&quot; message to appear below, and that click occurred without the regular 350ms delay for double tapping.&lt;/p&gt;
+    &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsiosviewportzoomsfromelementtoinitialscaleexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale-expected.txt (0 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale-expected.txt        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -0,0 +1 @@
</span><ins>+The viewport zoomed to scale: 5
</ins></span></pre></div>
<a id="trunkLayoutTestsfasteventsiosviewportzoomsfromelementtoinitialscalehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale.html (0 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale.html                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/viewport-zooms-from-element-to-initial-scale.html        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+&lt;!DOCTYPE html&gt; &lt;!-- webkit-test-runner [ useFlexibleViewport=true ] --&gt;
+
+&lt;html&gt;
+&lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=5, width=device-width&quot;&gt;
+&lt;head&gt;
+    &lt;script id=&quot;ui-script&quot; type=&quot;text/plain&quot;&gt;
+        (function() {
+            uiController.didEndZoomingCallback = function() {
+                uiController.uiScriptComplete(uiController.zoomScale);
+            };
+            uiController.doubleTapAtPoint(15, 15, function() {});
+        })();
+    &lt;/script&gt;
+    &lt;script&gt;
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        function getUIScript()
+        {
+            return document.getElementById(&quot;ui-script&quot;).text;
+        }
+
+        function runTest()
+        {
+            if (!window.eventSender || !testRunner.runUIScript)
+                return;
+
+            eventSender.scalePageBy(1.6, 1.6);
+            testRunner.runUIScript(getUIScript(), function(result) {
+                document.getElementById(&quot;target&quot;).innerText = &quot;The viewport zoomed to scale: &quot; + Number(result);
+                testRunner.notifyDone();
+            });
+        }
+
+        function handleClick()
+        {
+            document.getElementById(&quot;target&quot;).innerText = &quot;FAIL: Click fired when we should only be zooming.&quot;;
+            testRunner.notifyDone();
+        }
+    &lt;/script&gt;
+    &lt;style&gt;
+        body {
+            margin: 0;
+        }
+        #target {
+            height: 100px;
+            width: 100px;
+            background-color: silver;
+        }
+    &lt;/style&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;runTest()&quot;&gt;
+&lt;div id=&quot;target&quot;&gt;&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -1,3 +1,85 @@
</span><ins>+2015-10-27  Wenson Hsieh  &lt;wenson_hsieh@apple.com&gt;
+
+        Implement viewport-width-based fast-click heuristic
+        https://bugs.webkit.org/show_bug.cgi?id=150604
+        &lt;rdar://problem/23267308&gt;
+
+        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.
+
</ins><span class="cx"> 2015-10-27  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WKView being inside WKWebView leads to weird API issues
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -224,6 +224,12 @@
</span><span class="cx">     double maximumScaleFactor() const { return m_maximumScaleFactor; }
</span><span class="cx">     void setMaximumScaleFactor(double scale) { m_maximumScaleFactor = scale; }
</span><span class="cx"> 
</span><ins>+    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; }
+
</ins><span class="cx">     bool allowsUserScaling() const { return m_allowsUserScaling; }
</span><span class="cx">     void setAllowsUserScaling(bool allowsUserScaling) { m_allowsUserScaling = allowsUserScaling; }
</span><span class="cx"> 
</span><span class="lines">@@ -258,6 +264,8 @@
</span><span class="cx">     double m_pageScaleFactor { 1 };
</span><span class="cx">     double m_minimumScaleFactor { 1 };
</span><span class="cx">     double m_maximumScaleFactor { 1 };
</span><ins>+    double m_initialScaleFactor { 1 };
+    double m_viewportMetaTagWidth { -1 };
</ins><span class="cx">     uint64_t m_renderTreeSize { 0 };
</span><span class="cx">     uint64_t m_transactionID { 0 };
</span><span class="cx">     WebCore::LayoutMilestones m_newlyReachedLayoutMilestones { 0 };
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -517,6 +517,8 @@
</span><span class="cx">     encoder &lt;&lt; m_pageScaleFactor;
</span><span class="cx">     encoder &lt;&lt; m_minimumScaleFactor;
</span><span class="cx">     encoder &lt;&lt; m_maximumScaleFactor;
</span><ins>+    encoder &lt;&lt; m_initialScaleFactor;
+    encoder &lt;&lt; m_viewportMetaTagWidth;
</ins><span class="cx"> 
</span><span class="cx">     encoder &lt;&lt; m_renderTreeSize;
</span><span class="cx">     encoder &lt;&lt; m_transactionID;
</span><span class="lines">@@ -597,6 +599,12 @@
</span><span class="cx">     if (!decoder.decode(result.m_maximumScaleFactor))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (!decoder.decode(result.m_initialScaleFactor))
+        return false;
+
+    if (!decoder.decode(result.m_viewportMetaTagWidth))
+        return false;
+
</ins><span class="cx">     if (!decoder.decode(result.m_renderTreeSize))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -174,6 +174,9 @@
</span><span class="cx">     CGSize _maximumUnobscuredSizeOverride;
</span><span class="cx">     CGRect _inputViewBounds;
</span><span class="cx">     CGFloat _viewportMetaTagWidth;
</span><ins>+    CGFloat _initialScaleFactor;
+    BOOL _fastClickingIsDisabled;
+
</ins><span class="cx">     BOOL _allowsLinkPreview;
</span><span class="cx"> 
</span><span class="cx">     UIEdgeInsets _obscuredInsets;
</span><span class="lines">@@ -353,7 +356,9 @@
</span><span class="cx">     [_scrollView addSubview:[_contentView unscaledView]];
</span><span class="cx">     [self _updateScrollViewBackground];
</span><span class="cx"> 
</span><del>-    _viewportMetaTagWidth = -1;
</del><ins>+    _viewportMetaTagWidth = WebCore::ViewportArguments::ValueAuto;
+    _initialScaleFactor = 1;
+    _fastClickingIsDisabled = [[NSUserDefaults standardUserDefaults] boolForKey:@&quot;WebKitFastClickingDisabled&quot;];
</ins><span class="cx"> 
</span><span class="cx">     [self _frameOrBoundsChanged];
</span><span class="cx"> 
</span><span class="lines">@@ -814,11 +819,6 @@
</span><span class="cx">     _page-&gt;didLayoutForCustomContentProvider();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (void)_setViewportMetaTagWidth:(float)newWidth
-{
-    _viewportMetaTagWidth = newWidth;
-}
-
</del><span class="cx"> - (void)_willInvokeUIScrollViewDelegateCallback
</span><span class="cx"> {
</span><span class="cx">     _delayUpdateVisibleContentRects = YES;
</span><span class="lines">@@ -931,7 +931,8 @@
</span><span class="cx">     [_scrollView setContentOffset:[self _adjustedContentOffset:CGPointZero]];
</span><span class="cx">     [_scrollView setZoomScale:1];
</span><span class="cx"> 
</span><del>-    _viewportMetaTagWidth = -1;
</del><ins>+    _viewportMetaTagWidth = WebCore::ViewportArguments::ValueAuto;
+    _initialScaleFactor = 1;
</ins><span class="cx">     _hasCommittedLoadForMainFrame = NO;
</span><span class="cx">     _needsResetViewStateAfterCommitLoadForMainFrame = NO;
</span><span class="cx">     _dynamicViewportUpdateMode = DynamicViewportUpdateMode::NotResizing;
</span><span class="lines">@@ -1013,7 +1014,10 @@
</span><span class="cx">     if (!layerTreeTransaction.scaleWasSetByUIProcess() &amp;&amp; ![_scrollView isZooming] &amp;&amp; ![_scrollView isZoomBouncing] &amp;&amp; ![_scrollView _isAnimatingZoom])
</span><span class="cx">         [_scrollView setZoomScale:layerTreeTransaction.pageScaleFactor()];
</span><span class="cx"> 
</span><del>-    [_contentView _setDoubleTapGesturesEnabled:self._viewportIsUserScalable];
</del><ins>+    _viewportMetaTagWidth = layerTreeTransaction.viewportMetaTagWidth();
+    _initialScaleFactor = layerTreeTransaction.initialScaleFactor();
+    if (![_contentView _mayDisableDoubleTapGesturesDuringSingleTap])
+        [_contentView _setDoubleTapGesturesEnabled:self._allowsDoubleTapGestures];
</ins><span class="cx"> 
</span><span class="cx">     [self _updateScrollViewBackground];
</span><span class="cx"> 
</span><span class="lines">@@ -1292,6 +1296,12 @@
</span><span class="cx">     [self _zoomToPoint:origin atScale:[_scrollView minimumZoomScale] animated:animated];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_zoomToInitialScaleWithOrigin:(WebCore::FloatPoint)origin animated:(BOOL)animated
+{
+    ASSERT(_initialScaleFactor &gt; 0);
+    [self _zoomToPoint:origin atScale:_initialScaleFactor animated:animated];
+}
+
</ins><span class="cx"> // focusedElementRect and selectionRect are both in document coordinates.
</span><span class="cx"> - (void)_zoomToFocusRect:(WebCore::FloatRect)focusedElementRectInDocumentCoordinates selectionRect:(WebCore::FloatRect)selectionRectInDocumentCoordinates fontSize:(float)fontSize minimumScale:(double)minimumScale maximumScale:(double)maximumScale allowScaling:(BOOL)allowScaling forceScroll:(BOOL)forceScroll
</span><span class="cx"> {
</span><span class="lines">@@ -1411,11 +1421,6 @@
</span><span class="cx">                         force:YES];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (CGFloat)_contentZoomScale
-{
-    return contentZoomScale(self);
-}
-
</del><span class="cx"> - (CGFloat)_targetContentZoomScaleForRect:(const WebCore::FloatRect&amp;)targetRect currentScale:(double)currentScale fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale
</span><span class="cx"> {
</span><span class="cx">     WebCore::FloatSize unobscuredContentSize([self _contentRectForUserInteraction].size);
</span><span class="lines">@@ -3096,14 +3101,20 @@
</span><span class="cx">     return [(WKPDFView *)_customContentView.get() suggestedFilename];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (CGFloat)_viewportMetaTagWidth
</del><ins>+- (BOOL)_allowsDoubleTapGestures
</ins><span class="cx"> {
</span><del>-    return _viewportMetaTagWidth;
-}
</del><ins>+    if (_fastClickingIsDisabled)
+        return YES;
</ins><span class="cx"> 
</span><del>-- (BOOL)_viewportIsUserScalable
-{
-    return [_scrollView isZoomEnabled] &amp;&amp; [_scrollView minimumZoomScale] &lt; [_scrollView maximumZoomScale];
</del><ins>+    // If the page is not user scalable, we don't allow double tap gestures.
+    if (![_scrollView isZoomEnabled] || [_scrollView minimumZoomScale] &gt;= [_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);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (_WKWebViewPrintFormatter *)_webViewPrintFormatter
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewInternal.h        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -87,10 +87,10 @@
</span><span class="cx"> - (void)_zoomToFocusRect:(WebCore::FloatRect)focusedElementRect selectionRect:(WebCore::FloatRect)selectionRectInDocumentCoordinates fontSize:(float)fontSize minimumScale:(double)minimumScale maximumScale:(double)maximumScale allowScaling:(BOOL)allowScaling forceScroll:(BOOL)forceScroll;
</span><span class="cx"> - (BOOL)_zoomToRect:(WebCore::FloatRect)targetRect withOrigin:(WebCore::FloatPoint)origin fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale minimumScrollDistance:(float)minimumScrollDistance;
</span><span class="cx"> - (void)_zoomOutWithOrigin:(WebCore::FloatPoint)origin animated:(BOOL)animated;
</span><ins>+- (void)_zoomToInitialScaleWithOrigin:(WebCore::FloatPoint)origin animated:(BOOL)animated;
</ins><span class="cx"> 
</span><span class="cx"> - (void)_setHasCustomContentView:(BOOL)hasCustomContentView loadedMIMEType:(const WTF::String&amp;)mimeType;
</span><span class="cx"> - (void)_didFinishLoadingDataForCustomContentProviderWithSuggestedFilename:(const WTF::String&amp;)suggestedFilename data:(NSData *)data;
</span><del>-- (void)_setViewportMetaTagWidth:(float)newWidth;
</del><span class="cx"> 
</span><span class="cx"> - (void)_willInvokeUIScrollViewDelegateCallback;
</span><span class="cx"> - (void)_didInvokeUIScrollViewDelegateCallback;
</span><span class="lines">@@ -109,9 +109,7 @@
</span><span class="cx"> - (void)_navigationGestureDidBegin;
</span><span class="cx"> - (void)_navigationGestureDidEnd;
</span><span class="cx"> 
</span><del>-- (CGFloat)_contentZoomScale;
-- (CGFloat)_targetContentZoomScaleForRect:(const WebCore::FloatRect&amp;)targetRect currentScale:(double)currentScale fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale;
-
</del><ins>+@property (nonatomic, readonly) BOOL _allowsDoubleTapGestures;
</ins><span class="cx"> @property (nonatomic, readonly) UIEdgeInsets _computedContentInset;
</span><span class="cx"> #else
</span><span class="cx"> @property (nonatomic, setter=_setIgnoresNonWheelEvents:) BOOL _ignoresNonWheelEvents;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewPrivateh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebViewPrivate.h        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -134,10 +134,6 @@
</span><span class="cx"> // FIXME: This can be removed once WKNavigation's response property is implemented.
</span><span class="cx"> @property (nonatomic, readonly) NSString *_suggestedFilenameForDisplayedPDF;
</span><span class="cx"> 
</span><del>-// The viewport meta tag width is negative if the value is not defined.
-@property (nonatomic, readonly) CGFloat _viewportMetaTagWidth;
-@property (nonatomic, readonly) BOOL _viewportIsUserScalable;
-
</del><span class="cx"> @property (nonatomic, readonly) _WKWebViewPrintFormatter *_webViewPrintFormatter;
</span><span class="cx"> 
</span><span class="cx"> - (void)_beginInteractiveObscuredInsetsChange;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessPageClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/PageClient.h (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/PageClient.h        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/PageClient.h        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -294,8 +294,7 @@
</span><span class="cx">     virtual void didUpdateBlockSelectionWithTouch(uint32_t touch, uint32_t flags, float growThreshold, float shrinkThreshold) = 0;
</span><span class="cx">     virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect&amp; elementRect) = 0;
</span><span class="cx">     virtual void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale) = 0;
</span><del>-    virtual void didChangeViewportMetaTagWidth(float) = 0;
-    virtual void disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, const WebCore::FloatRect&amp; targetRect, bool isReplacedElement, double minimumScale, double maximumScale) = 0;
</del><ins>+    virtual void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) = 0;
</ins><span class="cx">     virtual double minimumZoomScale() const = 0;
</span><span class="cx">     virtual WebCore::FloatRect documentRect() const = 0;
</span><span class="cx">     virtual void overflowScrollViewWillStartPanGesture() = 0;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -510,8 +510,7 @@
</span><span class="cx">     void zoomToRect(WebCore::FloatRect, double minimumScale, double maximumScale);
</span><span class="cx">     void commitPotentialTapFailed();
</span><span class="cx">     void didNotHandleTapAsClick(const WebCore::IntPoint&amp;);
</span><del>-    void viewportMetaTagWidthDidChange(float width);
-    void disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, const WebCore::FloatRect&amp; targetRect, bool isReplacedElement, double minimumScale, double maximumScale);
</del><ins>+    void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID);
</ins><span class="cx">     void didFinishDrawingPagesToPDF(const IPC::DataReference&amp;);
</span><span class="cx">     void contentSizeCategoryDidChange(const String&amp; contentSizeCategory);
</span><span class="cx">     void getLookupContextAtPoint(const WebCore::IntPoint&amp;, std::function&lt;void(const String&amp;, CallbackBase::Error)&gt;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -183,8 +183,7 @@
</span><span class="cx">     ZoomToRect(WebCore::FloatRect rect, double minimumScale, double maximumScale)
</span><span class="cx">     CommitPotentialTapFailed()
</span><span class="cx">     DidNotHandleTapAsClick(WebCore::IntPoint point)
</span><del>-    ViewportMetaTagWidthDidChange(float width)
-    DisableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, WebCore::FloatRect targetRect, bool isReplacedElement, double minimumScale, double maximumScale)
</del><ins>+    DisableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID)
</ins><span class="cx">     DidFinishDrawingPagesToPDF(IPC::DataReference pdfData)
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(GTK)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.h        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -134,8 +134,7 @@
</span><span class="cx">     virtual void showPlaybackTargetPicker(bool hasVideo, const WebCore::IntRect&amp; elementRect) override;
</span><span class="cx"> 
</span><span class="cx">     virtual bool handleRunOpenPanel(WebPageProxy*, WebFrameProxy*, WebOpenPanelParameters*, WebOpenPanelResultListenerProxy*) override;
</span><del>-    virtual void didChangeViewportMetaTagWidth(float) override;
-    virtual void disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, const WebCore::FloatRect&amp; targetRect, bool isReplacedElement, double minimumScale, double maximumScale) override;
</del><ins>+    virtual void disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID) override;
</ins><span class="cx">     virtual double minimumZoomScale() const override;
</span><span class="cx">     virtual WebCore::FloatRect documentRect() const override;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosPageClientImplIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -254,17 +254,12 @@
</span><span class="cx">     notImplemented();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void PageClientImpl::didChangeViewportMetaTagWidth(float newWidth)
</del><ins>+void PageClientImpl::disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID)
</ins><span class="cx"> {
</span><del>-    [m_webView _setViewportMetaTagWidth:newWidth];
-}
-
-void PageClientImpl::disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, const WebCore::FloatRect&amp; targetRect, bool isReplacedElement, double minimumScale, double maximumScale)
-{
-    if (!m_webView._viewportIsUserScalable)
</del><ins>+    if (!m_webView._allowsDoubleTapGestures)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    [m_contentView _disableDoubleTapGesturesUntilTapIsFinishedIfNecessary:requestID allowsDoubleTapZoom:allowsDoubleTapZoom targetRect:targetRect isReplaced:isReplacedElement minimumScale:minimumScale maximumScale:maximumScale];
</del><ins>+    [m_contentView _disableDoubleTapGesturesDuringTapIfNecessary:requestID];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> double PageClientImpl::minimumZoomScale() const
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosSmartMagnificationControllerh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/SmartMagnificationController.h (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/SmartMagnificationController.h        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/ios/SmartMagnificationController.h        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -48,7 +48,6 @@
</span><span class="cx"> 
</span><span class="cx">     void handleSmartMagnificationGesture(WebCore::FloatPoint origin);
</span><span class="cx">     void handleResetMagnificationGesture(WebCore::FloatPoint origin);
</span><del>-    void adjustSmartMagnificationTargetRectAndZoomScales(bool addMagnificationPadding, WebCore::FloatRect&amp; targetRect, double&amp; minimumScale, double&amp; maximumScale);
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // IPC::MessageReceiver.
</span><span class="lines">@@ -56,6 +55,7 @@
</span><span class="cx"> 
</span><span class="cx">     void didCollectGeometryForSmartMagnificationGesture(WebCore::FloatPoint origin, WebCore::FloatRect renderRect, WebCore::FloatRect visibleContentBounds, bool isReplacedElement, double viewportMinimumScale, double viewportMaximumScale);
</span><span class="cx">     void magnify(WebCore::FloatPoint origin, WebCore::FloatRect targetRect, WebCore::FloatRect visibleContentRect, double viewportMinimumScale, double viewportMaximumScale);
</span><ins>+    void adjustSmartMagnificationTargetRectAndZoomScales(bool addMagnificationPadding, WebCore::FloatRect&amp; targetRect, double&amp; minimumScale, double&amp; maximumScale);
</ins><span class="cx"> 
</span><span class="cx">     WebPageProxy&amp; m_webPageProxy;
</span><span class="cx">     WKContentView *m_contentView;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosSmartMagnificationControllermm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/SmartMagnificationController.mm (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/SmartMagnificationController.mm        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/ios/SmartMagnificationController.mm        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -93,7 +93,7 @@
</span><span class="cx"> {
</span><span class="cx">     if (targetRect.isEmpty()) {
</span><span class="cx">         // FIXME: If we don't zoom, send the tap along to text selection (see &lt;rdar://problem/6810344&gt;).
</span><del>-        [m_contentView _zoomOutWithOrigin:origin];
</del><ins>+        [m_contentView _zoomToInitialScaleWithOrigin:origin];
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx">     double minimumScale = viewportMinimumScale;
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     // FIXME: If we still don't zoom, send the tap along to text selection (see &lt;rdar://problem/6810344&gt;).
</span><del>-    [m_contentView _zoomOutWithOrigin:origin];
</del><ins>+    [m_contentView _zoomToInitialScaleWithOrigin:origin];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void SmartMagnificationController::magnify(FloatPoint origin, FloatRect targetRect, FloatRect visibleContentRect, double viewportMinimumScale, double viewportMaximumScale)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.h (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.h        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.h        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -92,5 +92,6 @@
</span><span class="cx"> - (void)_zoomToFocusRect:(CGRect)rectToFocus selectionRect:(CGRect)selectionRect fontSize:(float)fontSize minimumScale:(double)minimumScale maximumScale:(double)maximumScale allowScaling:(BOOL)allowScaling forceScroll:(BOOL)forceScroll;
</span><span class="cx"> - (BOOL)_zoomToRect:(CGRect)targetRect withOrigin:(CGPoint)origin fitEntireRect:(BOOL)fitEntireRect minimumScale:(double)minimumScale maximumScale:(double)maximumScale minimumScrollDistance:(CGFloat)minimumScrollDistance;
</span><span class="cx"> - (void)_zoomOutWithOrigin:(CGPoint)origin;
</span><ins>+- (void)_zoomToInitialScaleWithOrigin:(CGPoint)origin;
</ins><span class="cx"> 
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentView.mm        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -540,6 +540,11 @@
</span><span class="cx">     return [_webView _zoomOutWithOrigin:origin animated:YES];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (void)_zoomToInitialScaleWithOrigin:(CGPoint)origin
+{
+    return [_webView _zoomToInitialScaleWithOrigin:origin animated:YES];
+}
+
</ins><span class="cx"> - (void)_applicationWillResignActive:(NSNotification*)notification
</span><span class="cx"> {
</span><span class="cx">     _page-&gt;applicationWillResignActive();
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -159,6 +159,7 @@
</span><span class="cx">     BOOL _inspectorNodeSearchEnabled;
</span><span class="cx">     BOOL _didAccessoryTabInitiateFocus;
</span><span class="cx">     BOOL _isExpectingFastSingleTapCommit;
</span><ins>+    BOOL _showDebugTapHighlightsForFastClicking;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> @end
</span><span class="lines">@@ -183,7 +184,8 @@
</span><span class="cx"> - (void)_commitPotentialTapFailed;
</span><span class="cx"> - (void)_didGetTapHighlightForRequest:(uint64_t)requestID color:(const WebCore::Color&amp;)color quads:(const Vector&lt;WebCore::FloatQuad&gt;&amp;)highlightedQuads topLeftRadius:(const WebCore::IntSize&amp;)topLeftRadius topRightRadius:(const WebCore::IntSize&amp;)topRightRadius bottomLeftRadius:(const WebCore::IntSize&amp;)bottomLeftRadius bottomRightRadius:(const WebCore::IntSize&amp;)bottomRightRadius;
</span><span class="cx"> 
</span><del>-- (void)_disableDoubleTapGesturesUntilTapIsFinishedIfNecessary:(uint64_t)requestID allowsDoubleTapZoom:(bool)allowsDoubleTapZoom targetRect:(WebCore::FloatRect)targetRect isReplaced:(BOOL)isReplacedElement minimumScale:(double)minimumScale maximumScale:(double)maximumScale;
</del><ins>+- (BOOL)_mayDisableDoubleTapGesturesDuringSingleTap;
+- (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID;
</ins><span class="cx"> - (void)_startAssistingNode:(const WebKit::AssistedNodeInformation&amp;)information userIsInteracting:(BOOL)userIsInteracting blurPreviousNode:(BOOL)blurPreviousNode userObject:(NSObject &lt;NSSecureCoding&gt; *)userObject;
</span><span class="cx"> - (void)_stopAssistingNode;
</span><span class="cx"> - (void)_selectionChanged;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWKContentViewInteractionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -476,6 +476,7 @@
</span><span class="cx">     [_actionSheetAssistant setDelegate:self];
</span><span class="cx">     _smartMagnificationController = std::make_unique&lt;SmartMagnificationController&gt;(self);
</span><span class="cx">     _isExpectingFastSingleTapCommit = NO;
</span><ins>+    _showDebugTapHighlightsForFastClicking = [[NSUserDefaults standardUserDefaults] boolForKey:@&quot;WebKitShowFastClickDebugTapHighlights&quot;];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> - (void)cleanupInteraction
</span><span class="lines">@@ -840,7 +841,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_showTapHighlight
</span><span class="cx"> {
</span><del>-    if (!highlightedQuadsAreSmallerThanRect(_tapHighlightInformation.quads, _page-&gt;unobscuredContentRect()))
</del><ins>+    if (!highlightedQuadsAreSmallerThanRect(_tapHighlightInformation.quads, _page-&gt;unobscuredContentRect()) &amp;&amp; !_showDebugTapHighlightsForFastClicking)
</ins><span class="cx">         return;
</span><span class="cx"> 
</span><span class="cx">     if (!_highlightView) {
</span><span class="lines">@@ -860,12 +861,15 @@
</span><span class="cx"> 
</span><span class="cx">     _isTapHighlightIDValid = NO;
</span><span class="cx"> 
</span><del>-    _tapHighlightInformation.color = color;
</del><span class="cx">     _tapHighlightInformation.quads = highlightedQuads;
</span><span class="cx">     _tapHighlightInformation.topLeftRadius = topLeftRadius;
</span><span class="cx">     _tapHighlightInformation.topRightRadius = topRightRadius;
</span><span class="cx">     _tapHighlightInformation.bottomLeftRadius = bottomLeftRadius;
</span><span class="cx">     _tapHighlightInformation.bottomRightRadius = bottomRightRadius;
</span><ins>+    if (_showDebugTapHighlightsForFastClicking)
+        _tapHighlightInformation.color = [self _tapHighlightColorForFastClick:![_doubleTapGestureRecognizer isEnabled]];
+    else
+        _tapHighlightInformation.color = color;
</ins><span class="cx"> 
</span><span class="cx">     if (_potentialTapInProgress) {
</span><span class="cx">         _hasTapHighlightForPotentialTap = YES;
</span><span class="lines">@@ -880,41 +884,16 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (CGFloat)_fastClickZoomThreshold
</del><ins>+- (BOOL)_mayDisableDoubleTapGesturesDuringSingleTap
</ins><span class="cx"> {
</span><del>-    NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-    if (![defaults boolForKey:@&quot;WebKitFastClickingEnabled&quot;])
-        return 0;
-
-    return [defaults floatForKey:@&quot;WebKitFastClickZoomThreshold&quot;];
</del><ins>+    return _potentialTapInProgress;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-- (BOOL)_allowDoubleTapToZoomForCurrentZoomScale:(CGFloat)currentZoomScale andTargetZoomScale:(CGFloat)targetZoomScale
</del><ins>+- (void)_disableDoubleTapGesturesDuringTapIfNecessary:(uint64_t)requestID
</ins><span class="cx"> {
</span><del>-    CGFloat zoomThreshold = [self _fastClickZoomThreshold];
-    if (!zoomThreshold)
-        return YES;
-
-    CGFloat minimumZoomRatioForDoubleTapToZoomIn = 1 + zoomThreshold;
-    CGFloat maximumZoomRatioForDoubleTapToZoomOut = 1 / minimumZoomRatioForDoubleTapToZoomIn;
-    CGFloat zoomRatio = targetZoomScale / currentZoomScale;
-    return zoomRatio &lt; maximumZoomRatioForDoubleTapToZoomOut || zoomRatio &gt; minimumZoomRatioForDoubleTapToZoomIn;
-}
-
-- (void)_disableDoubleTapGesturesUntilTapIsFinishedIfNecessary:(uint64_t)requestID allowsDoubleTapZoom:(bool)allowsDoubleTapZoom targetRect:(WebCore::FloatRect)targetRect isReplaced:(BOOL)isReplacedElement minimumScale:(double)minimumScale maximumScale:(double)maximumScale
-{
</del><span class="cx">     if (!_potentialTapInProgress || _latestTapID != requestID)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    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-&gt;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;
-    }
-
</del><span class="cx">     [self _setDoubleTapGesturesEnabled:NO];
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -1153,7 +1132,8 @@
</span><span class="cx"> - (void)_finishInteraction
</span><span class="cx"> {
</span><span class="cx">     _isTapHighlightIDValid = NO;
</span><del>-    [UIView animateWithDuration:0.1
</del><ins>+    CGFloat tapHighlightFadeDuration = _showDebugTapHighlightsForFastClicking ? 0.25 : 0.1;
+    [UIView animateWithDuration:tapHighlightFadeDuration
</ins><span class="cx">                      animations:^{
</span><span class="cx">                          [_highlightView layer].opacity = 0;
</span><span class="cx">                      }
</span><span class="lines">@@ -1259,7 +1239,7 @@
</span><span class="cx"> 
</span><span class="cx"> - (void)_endPotentialTapAndEnableDoubleTapGesturesIfNecessary
</span><span class="cx"> {
</span><del>-    if (_webView._viewportIsUserScalable)
</del><ins>+    if (_webView._allowsDoubleTapGestures)
</ins><span class="cx">         [self _setDoubleTapGesturesEnabled:YES];
</span><span class="cx"> 
</span><span class="cx">     _potentialTapInProgress = NO;
</span><span class="lines">@@ -2414,6 +2394,12 @@
</span><span class="cx">     });
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+- (WebCore::Color)_tapHighlightColorForFastClick:(BOOL)forFastClick
+{
+    ASSERT(_showDebugTapHighlightsForFastClicking);
+    return forFastClick ? WebCore::Color(0, 225, 0, 127) : WebCore::Color(225, 0, 0, 127);
+}
+
</ins><span class="cx"> - (void)_setDoubleTapGesturesEnabled:(BOOL)enabled
</span><span class="cx"> {
</span><span class="cx">     if (enabled &amp;&amp; ![_doubleTapGestureRecognizer isEnabled]) {
</span><span class="lines">@@ -2423,6 +2409,10 @@
</span><span class="cx">         [_doubleTapGestureRecognizer setDelegate:nil];
</span><span class="cx">         [self _createAndConfigureDoubleTapGestureRecognizer];
</span><span class="cx">     }
</span><ins>+
+    if (_showDebugTapHighlightsForFastClicking &amp;&amp; !enabled)
+        _tapHighlightInformation.color = [self _tapHighlightColorForFastClick:YES];
+
</ins><span class="cx">     [_doubleTapGestureRecognizer setEnabled:enabled];
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessiosWebPageProxyIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -932,16 +932,11 @@
</span><span class="cx">     m_uiClient-&gt;didNotHandleTapAsClick(point);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::viewportMetaTagWidthDidChange(float width)
</del><ins>+void WebPageProxy::disableDoubleTapGesturesDuringTapIfNecessary(uint64_t requestID)
</ins><span class="cx"> {
</span><del>-    m_pageClient.didChangeViewportMetaTagWidth(width);
</del><ins>+    m_pageClient.disableDoubleTapGesturesDuringTapIfNecessary(requestID);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(uint64_t requestID, bool allowsDoubleTapZoom, const WebCore::FloatRect&amp; targetRect, bool isReplacedElement, double minimumScale, double maximumScale)
-{
-    m_pageClient.disableDoubleTapGesturesUntilTapIsFinishedIfNecessary(requestID, allowsDoubleTapZoom, targetRect, isReplacedElement, minimumScale, maximumScale);
-}
-
</del><span class="cx"> void WebPageProxy::didFinishDrawingPagesToPDF(const IPC::DataReference&amp; pdfData)
</span><span class="cx"> {
</span><span class="cx">     m_pageClient.didFinishDrawingPagesToPDF(pdfData);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageViewGestureGeometryCollectorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.h (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.h        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ViewGestureGeometryCollector.h        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -45,7 +45,6 @@
</span><span class="cx">     ~ViewGestureGeometryCollector();
</span><span class="cx"> 
</span><span class="cx">     void mainFrameDidLayout();
</span><del>-    void computeZoomInformationForNode(WebCore::Node&amp;, WebCore::FloatPoint&amp; origin, WebCore::FloatRect&amp; renderRect, bool&amp; isReplaced, double&amp; viewportMinimumScale, double&amp; viewportMaximumScale);
</del><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     // IPC::MessageReceiver.
</span><span class="lines">@@ -62,6 +61,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void dispatchDidCollectGeometryForSmartMagnificationGesture(WebCore::FloatPoint origin, WebCore::FloatRect targetRect, WebCore::FloatRect visibleContentRect, bool isReplacedElement, double viewportMinimumScale, double viewportMaximumScale);
</span><ins>+    void computeZoomInformationForNode(WebCore::Node&amp;, WebCore::FloatPoint&amp; origin, WebCore::FloatRect&amp; renderRect, bool&amp; isReplaced, double&amp; viewportMinimumScale, double&amp; viewportMaximumScale);
</ins><span class="cx"> 
</span><span class="cx">     WebPage&amp; m_webPage;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -2943,6 +2943,8 @@
</span><span class="cx">     layerTransaction.setScaleWasSetByUIProcess(scaleWasSetByUIProcess());
</span><span class="cx">     layerTransaction.setMinimumScaleFactor(m_viewportConfiguration.minimumScale());
</span><span class="cx">     layerTransaction.setMaximumScaleFactor(m_viewportConfiguration.maximumScale());
</span><ins>+    layerTransaction.setInitialScaleFactor(m_viewportConfiguration.initialScale());
+    layerTransaction.setViewportMetaTagWidth(m_viewportConfiguration.viewportArguments().width);
</ins><span class="cx">     layerTransaction.setAllowsUserScaling(allowsUserScaling());
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(MAC)
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageiosWebPageIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm (191643 => 191644)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2015-10-27 22:08:03 UTC (rev 191643)
+++ trunk/Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm        2015-10-27 23:34:54 UTC (rev 191644)
</span><span class="lines">@@ -233,13 +233,8 @@
</span><span class="cx">     if (m_viewportConfiguration.viewportArguments() == viewportArguments)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    float oldWidth = m_viewportConfiguration.viewportArguments().width;
-
</del><span class="cx">     m_viewportConfiguration.setViewportArguments(viewportArguments);
</span><span class="cx">     viewportConfigurationChanged();
</span><del>-
-    if (oldWidth != viewportArguments.width)
-        send(Messages::WebPageProxy::ViewportMetaTagWidthDidChange(viewportArguments.width));
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::didReceiveMobileDocType(bool isMobileDoctype)
</span><span class="lines">@@ -664,22 +659,10 @@
</span><span class="cx"> {
</span><span class="cx">     m_potentialTapNode = m_page-&gt;mainFrame().nodeRespondingToClickEvents(position, m_potentialTapLocation);
</span><span class="cx">     sendTapHighlightForNodeIfNecessary(requestID, m_potentialTapNode.get());
</span><del>-    if (m_potentialTapNode) {
</del><span class="cx"> #if ENABLE(TOUCH_EVENTS)
</span><del>-        if (!m_potentialTapNode-&gt;allowsDoubleTapGesture()) {
-            send(Messages::WebPageProxy::DisableDoubleTapGesturesUntilTapIsFinishedIfNecessary(requestID, false, FloatRect(), false, 0, 0));
-            return;
-        }
</del><ins>+    if (m_potentialTapNode &amp;&amp; !m_potentialTapNode-&gt;allowsDoubleTapGesture())
+        send(Messages::WebPageProxy::DisableDoubleTapGesturesDuringTapIfNecessary(requestID));
</ins><span class="cx"> #endif
</span><del>-        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));
-    }
</del><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::commitPotentialTap(uint64_t lastLayerTreeTransactionId)
</span></span></pre>
</div>
</div>

</body>
</html>