<!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>[195607] 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/195607">195607</a></dd>
<dt>Author</dt> <dd>dino@apple.com</dd>
<dt>Date</dt> <dd>2016-01-26 12:09:27 -0800 (Tue, 26 Jan 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[iOS] Documents without an explicit width should not get fast tapping
https://bugs.webkit.org/show_bug.cgi?id=153465
Source/WebCore:

&lt;rdar://problem/23962529&gt;

Reviewed by Simon Fraser (and Wenson Hseih).

As the title says, documents that do not set a viewport should
not get the fast click behaviour. There were complaints that we broke
double-tap to scroll in ImageDocuments where the image was narrow and long.

The fix is to just keep a flag that tells the UI process if the
width was explicit. However, it turns out that those ImageDocuments
are given an explicit device-width, which is fine for scaling but
really should behave as auto for fast tapping. So we also need
to tell the UIProcess if the viewport arguments came from an
ImageDocument.

Test: fast/events/ios/viewport-no-width-value-allows-double-tap.html

* dom/ViewportArguments.cpp:
(WebCore::findSizeValue): Add a parameter that toggles a flag
if the size was explicitly set.
(WebCore::setViewportFeature): Remember if the width was
explicit.
* dom/ViewportArguments.h: Add a widthWasExplicit flag.
(WebCore::ViewportArguments::operator==):

Source/WebKit2:

&lt;rdar://problem/23962529&gt;

Reviewed by Simon Fraser (and Wenson Hseih).

As the title says, documents that do not set a viewport should
not get the fast click behaviour. There were complaints that we broke
double-tap to scroll in ImageDocuments where the image was narrow and long.

The fix is to just keep a flag that tells the UI process if the
width was explicit. However, it turns out that those ImageDocuments
are given an explicit device-width, which is fine for scaling but
really should behave as auto for fast tapping. So we also need
to tell the UIProcess if the viewport arguments came from an
ImageDocument.

* Shared/mac/RemoteLayerTreeTransaction.h: Add two new flags into
the transaction.
(WebKit::RemoteLayerTreeTransaction::viewportMetaTagWidthWasExplicit):
(WebKit::RemoteLayerTreeTransaction::setViewportMetaTagWidthWasExplicit):
(WebKit::RemoteLayerTreeTransaction::viewportMetaTagCameFromImageDocument):
(WebKit::RemoteLayerTreeTransaction::setViewportMetaTagCameFromImageDocument):
* Shared/mac/RemoteLayerTreeTransaction.mm:
(WebKit::RemoteLayerTreeTransaction::encode):
(WebKit::RemoteLayerTreeTransaction::decode):
(WebKit::RemoteLayerTreeTransaction::description):

* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _didCommitLayerTree:]): Notice whether or not the viewport
width was explicit.
(-[WKWebView _allowsDoubleTapGestures]): Return yes if the width
was not explicit, or if the viewport came from an ImageDocument.
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::willCommitLayerTree):

LayoutTests:

Reviewed by Simon Fraser (and Wenson Hseih).

* fast/events/ios/thin-gradient.jpg: Added.
* fast/events/ios/viewport-no-width-value-allows-double-tap-expected.txt: Added.
* fast/events/ios/viewport-no-width-value-allows-double-tap.html: Added.
* platform/ios-simulator/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomViewportArgumentscpp">trunk/Source/WebCore/dom/ViewportArguments.cpp</a></li>
<li><a href="#trunkSourceWebCoredomViewportArgumentsh">trunk/Source/WebCore/dom/ViewportArguments.h</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="#trunkSourceWebKit2WebProcessWebPageWebPagecpp">trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasteventsiosthingradientjpg">trunk/LayoutTests/fast/events/ios/thin-gradient.jpg</a></li>
<li><a href="#trunkLayoutTestsfasteventsiosviewportnowidthvalueallowsdoubletapexpectedtxt">trunk/LayoutTests/fast/events/ios/viewport-no-width-value-allows-double-tap-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasteventsiosviewportnowidthvalueallowsdoubletaphtml">trunk/LayoutTests/fast/events/ios/viewport-no-width-value-allows-double-tap.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (195606 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-01-26 20:07:07 UTC (rev 195606)
+++ trunk/LayoutTests/ChangeLog        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-01-26  Dean Jackson  &lt;dino@apple.com&gt;
+
+        [iOS] Documents without an explicit width should not get fast tapping
+        https://bugs.webkit.org/show_bug.cgi?id=153465
+
+        Reviewed by Simon Fraser (and Wenson Hseih).
+
+        * fast/events/ios/thin-gradient.jpg: Added.
+        * fast/events/ios/viewport-no-width-value-allows-double-tap-expected.txt: Added.
+        * fast/events/ios/viewport-no-width-value-allows-double-tap.html: Added.
+        * platform/ios-simulator/TestExpectations:
+
</ins><span class="cx"> 2016-01-26  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Skipping fast/events/drag-and-drop-link-fast-multiple-times-does-not-crash.html on ios-simulator
</span></span></pre></div>
<a id="trunkLayoutTestsfasteventsiosthingradientjpg"></a>
<div class="binary"><h4>Added: trunk/LayoutTests/fast/events/ios/thin-gradient.jpg</h4>
<pre class="diff"><span>
<span class="cx">(Binary files differ)
</span></span></pre></div>
<span class="cx">Property changes on: trunk/LayoutTests/fast/events/ios/thin-gradient.jpg
</span><span class="cx">___________________________________________________________________
</span><a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="trunkLayoutTestsfasteventsiosviewportnowidthvalueallowsdoubletapexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/viewport-no-width-value-allows-double-tap-expected.txt (0 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/viewport-no-width-value-allows-double-tap-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/viewport-no-width-value-allows-double-tap-expected.txt        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -0,0 +1,8 @@
</span><ins>+PASS successfullyParsed is true
+
+TEST COMPLETE
+Double tapping on the image should scroll.
+
+This test is best run in WebKitTestRunner. If you are running this test manually, verify that double tapping on the bottom of the viewport caused a scroll.
+
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/events/ios/viewport-no-width-value-allows-double-tap-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfasteventsiosviewportnowidthvalueallowsdoubletaphtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/events/ios/viewport-no-width-value-allows-double-tap.html (0 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/events/ios/viewport-no-width-value-allows-double-tap.html                                (rev 0)
+++ trunk/LayoutTests/fast/events/ios/viewport-no-width-value-allows-double-tap.html        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -0,0 +1,51 @@
</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&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.doubleTapAtPoint(15, 400, function() {
+                uiController.uiScriptComplete();
+            });
+        })();
+    &lt;/script&gt;
+
+    &lt;script&gt;
+    var scriptCompleted = false;
+    var clickCount = 0;
+    if (window.testRunner)
+        testRunner.waitUntilDone();
+
+    function getUIScript() {
+        return document.getElementById(&quot;ui-script&quot;).text;
+    }
+
+    function runTest() {
+        window.addEventListener(&quot;scroll&quot;, scrolled, false);
+        if (testRunner.runUIScript)
+            testRunner.runUIScript(getUIScript());
+    }
+    function scrolled() {
+        if (window.testRunner)
+            testRunner.notifyDone();
+    }
+    &lt;/script&gt;
+
+    &lt;style&gt;
+    body {
+        margin: 0;
+    }
+    &lt;/style&gt;
+&lt;/head&gt;
+
+&lt;body onload=&quot;runTest()&quot;&gt;
+    &lt;p&gt;Double tapping on the image should scroll.&lt;/p&gt;
+    &lt;p&gt;This test is best run in WebKitTestRunner. If you are running this test manually, verify that double tapping on the bottom of the viewport caused a scroll.&lt;/p&gt;
+    &lt;img src=&quot;thin-gradient.jpg&quot;&gt;
+    &lt;script src=&quot;../../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+
+&lt;/html&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/events/ios/viewport-no-width-value-allows-double-tap.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svnkeywords"></a>
<div class="addfile"><h4>Added: svn:keywords</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (195606 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-01-26 20:07:07 UTC (rev 195606)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -2839,6 +2839,7 @@
</span><span class="cx"> webkit.org/b/152134 fast/events/ios/single-tap-generates-click.html [ Pass Timeout ]
</span><span class="cx"> webkit.org/b/152134 fast/events/ios/unscalable-viewport-clicks-on-doubletap.html [ Pass Timeout ]
</span><span class="cx"> webkit.org/b/152134 fast/events/ios/viewport-device-width-at-initial-scale-fast-clicks.html  [ Pass Timeout ]
</span><ins>+webkit.org/b/152134 fast/events/ios/viewport-no-width-value-allows-double-tap.html  [ Pass Timeout ]
</ins><span class="cx"> 
</span><span class="cx"> # Failing tests related to picture element
</span><span class="cx"> webkit.org/b/152141 fast/picture/image-picture-1x.html [ Skip ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (195606 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-01-26 20:07:07 UTC (rev 195606)
+++ trunk/Source/WebCore/ChangeLog        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-01-26  Dean Jackson  &lt;dino@apple.com&gt;
+
+        [iOS] Documents without an explicit width should not get fast tapping
+        https://bugs.webkit.org/show_bug.cgi?id=153465
+        &lt;rdar://problem/23962529&gt;
+
+        Reviewed by Simon Fraser (and Wenson Hseih).
+
+        As the title says, documents that do not set a viewport should
+        not get the fast click behaviour. There were complaints that we broke
+        double-tap to scroll in ImageDocuments where the image was narrow and long.
+
+        The fix is to just keep a flag that tells the UI process if the
+        width was explicit. However, it turns out that those ImageDocuments
+        are given an explicit device-width, which is fine for scaling but
+        really should behave as auto for fast tapping. So we also need
+        to tell the UIProcess if the viewport arguments came from an
+        ImageDocument.
+
+        Test: fast/events/ios/viewport-no-width-value-allows-double-tap.html
+
+        * dom/ViewportArguments.cpp:
+        (WebCore::findSizeValue): Add a parameter that toggles a flag
+        if the size was explicitly set.
+        (WebCore::setViewportFeature): Remember if the width was
+        explicit.
+        * dom/ViewportArguments.h: Add a widthWasExplicit flag.
+        (WebCore::ViewportArguments::operator==):
+
</ins><span class="cx"> 2016-01-25  Dave Hyatt  &lt;hyatt@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Speculative fixes for crashing in viewportChangeAffectedPicture
</span></span></pre></div>
<a id="trunkSourceWebCoredomViewportArgumentscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ViewportArguments.cpp (195606 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ViewportArguments.cpp        2016-01-26 20:07:07 UTC (rev 195606)
+++ trunk/Source/WebCore/dom/ViewportArguments.cpp        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -307,24 +307,31 @@
</span><span class="cx">     return value;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static float findSizeValue(const String&amp; keyString, const String&amp; valueString, Document* document)
</del><ins>+static float findSizeValue(const String&amp; keyString, const String&amp; valueString, Document* document, bool* valueWasExplicit = nullptr)
</ins><span class="cx"> {
</span><span class="cx">     // 1) Non-negative number values are translated to px lengths.
</span><span class="cx">     // 2) Negative number values are translated to auto.
</span><span class="cx">     // 3) device-width and device-height are used as keywords.
</span><span class="cx">     // 4) Other keywords and unknown values translate to 0.0.
</span><span class="cx"> 
</span><ins>+    if (valueWasExplicit)
+        *valueWasExplicit = true;
+
</ins><span class="cx">     if (equalLettersIgnoringASCIICase(valueString, &quot;device-width&quot;))
</span><span class="cx">         return ViewportArguments::ValueDeviceWidth;
</span><ins>+
</ins><span class="cx">     if (equalLettersIgnoringASCIICase(valueString, &quot;device-height&quot;))
</span><span class="cx">         return ViewportArguments::ValueDeviceHeight;
</span><span class="cx"> 
</span><del>-    float value = numericPrefix(keyString, valueString, document);
</del><ins>+    float sizeValue = numericPrefix(keyString, valueString, document);
</ins><span class="cx"> 
</span><del>-    if (value &lt; 0)
</del><ins>+    if (sizeValue &lt; 0) {
+        if (valueWasExplicit)
+            *valueWasExplicit = false;
</ins><span class="cx">         return ViewportArguments::ValueAuto;
</span><ins>+    }
</ins><span class="cx"> 
</span><del>-    return value;
</del><ins>+    return sizeValue;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static float findScaleValue(const String&amp; keyString, const String&amp; valueString, Document* document)
</span><span class="lines">@@ -383,7 +390,7 @@
</span><span class="cx">     ViewportArguments* arguments = static_cast&lt;ViewportArguments*&gt;(data);
</span><span class="cx"> 
</span><span class="cx">     if (keyString == &quot;width&quot;)
</span><del>-        arguments-&gt;width = findSizeValue(keyString, valueString, document);
</del><ins>+        arguments-&gt;width = findSizeValue(keyString, valueString, document, &amp;arguments-&gt;widthWasExplicit);
</ins><span class="cx">     else if (keyString == &quot;height&quot;)
</span><span class="cx">         arguments-&gt;height = findSizeValue(keyString, valueString, document);
</span><span class="cx">     else if (keyString == &quot;initial-scale&quot;)
</span></span></pre></div>
<a id="trunkSourceWebCoredomViewportArgumentsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ViewportArguments.h (195606 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ViewportArguments.h        2016-01-26 20:07:07 UTC (rev 195606)
+++ trunk/Source/WebCore/dom/ViewportArguments.h        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -95,6 +95,7 @@
</span><span class="cx">     float userZoom { ValueAuto };
</span><span class="cx">     float orientation { ValueAuto };
</span><span class="cx">     float shrinkToFit { ValueAuto };
</span><ins>+    bool widthWasExplicit { false };
</ins><span class="cx"> 
</span><span class="cx">     bool operator==(const ViewportArguments&amp; other) const
</span><span class="cx">     {
</span><span class="lines">@@ -111,7 +112,8 @@
</span><span class="cx">             &amp;&amp; maxZoom == other.maxZoom
</span><span class="cx">             &amp;&amp; userZoom == other.userZoom
</span><span class="cx">             &amp;&amp; orientation == other.orientation
</span><del>-            &amp;&amp; shrinkToFit == other.shrinkToFit;
</del><ins>+            &amp;&amp; shrinkToFit == other.shrinkToFit
+            &amp;&amp; widthWasExplicit == other.widthWasExplicit;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     bool operator!=(const ViewportArguments&amp; other) const
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (195606 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2016-01-26 20:07:07 UTC (rev 195606)
+++ trunk/Source/WebKit2/ChangeLog        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -1,3 +1,41 @@
</span><ins>+2016-01-26  Dean Jackson  &lt;dino@apple.com&gt;
+
+        [iOS] Documents without an explicit width should not get fast tapping
+        https://bugs.webkit.org/show_bug.cgi?id=153465
+        &lt;rdar://problem/23962529&gt;
+
+        Reviewed by Simon Fraser (and Wenson Hseih).
+
+        As the title says, documents that do not set a viewport should
+        not get the fast click behaviour. There were complaints that we broke
+        double-tap to scroll in ImageDocuments where the image was narrow and long.
+
+        The fix is to just keep a flag that tells the UI process if the
+        width was explicit. However, it turns out that those ImageDocuments
+        are given an explicit device-width, which is fine for scaling but
+        really should behave as auto for fast tapping. So we also need
+        to tell the UIProcess if the viewport arguments came from an
+        ImageDocument.
+
+        * Shared/mac/RemoteLayerTreeTransaction.h: Add two new flags into
+        the transaction.
+        (WebKit::RemoteLayerTreeTransaction::viewportMetaTagWidthWasExplicit):
+        (WebKit::RemoteLayerTreeTransaction::setViewportMetaTagWidthWasExplicit):
+        (WebKit::RemoteLayerTreeTransaction::viewportMetaTagCameFromImageDocument):
+        (WebKit::RemoteLayerTreeTransaction::setViewportMetaTagCameFromImageDocument):
+        * Shared/mac/RemoteLayerTreeTransaction.mm:
+        (WebKit::RemoteLayerTreeTransaction::encode):
+        (WebKit::RemoteLayerTreeTransaction::decode):
+        (WebKit::RemoteLayerTreeTransaction::description):
+
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _didCommitLayerTree:]): Notice whether or not the viewport
+        width was explicit.
+        (-[WKWebView _allowsDoubleTapGestures]): Return yes if the width
+        was not explicit, or if the viewport came from an ImageDocument.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::willCommitLayerTree):
+
</ins><span class="cx"> 2016-01-26  Tim Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r194557): Keyboard shortcuts stop working after the WKWebView is unparented and reparented
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h (195606 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2016-01-26 20:07:07 UTC (rev 195606)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.h        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -230,6 +230,12 @@
</span><span class="cx">     double viewportMetaTagWidth() const { return m_viewportMetaTagWidth; }
</span><span class="cx">     void setViewportMetaTagWidth(double width) { m_viewportMetaTagWidth = width; }
</span><span class="cx"> 
</span><ins>+    bool viewportMetaTagWidthWasExplicit() const { return m_viewportMetaTagWidthWasExplicit; }
+    void setViewportMetaTagWidthWasExplicit(bool widthWasExplicit) { m_viewportMetaTagWidthWasExplicit = widthWasExplicit; }
+
+    bool viewportMetaTagCameFromImageDocument() const { return m_viewportMetaTagCameFromImageDocument; }
+    void setViewportMetaTagCameFromImageDocument(bool cameFromImageDocument) { m_viewportMetaTagCameFromImageDocument = cameFromImageDocument; }
+
</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">@@ -271,6 +277,8 @@
</span><span class="cx">     WebCore::LayoutMilestones m_newlyReachedLayoutMilestones { 0 };
</span><span class="cx">     bool m_scaleWasSetByUIProcess { false };
</span><span class="cx">     bool m_allowsUserScaling { false };
</span><ins>+    bool m_viewportMetaTagWidthWasExplicit { false };
+    bool m_viewportMetaTagCameFromImageDocument { false };
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedmacRemoteLayerTreeTransactionmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm (195606 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2016-01-26 20:07:07 UTC (rev 195606)
+++ trunk/Source/WebKit2/Shared/mac/RemoteLayerTreeTransaction.mm        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -528,6 +528,9 @@
</span><span class="cx">     encoder &lt;&lt; m_scaleWasSetByUIProcess;
</span><span class="cx">     encoder &lt;&lt; m_allowsUserScaling;
</span><span class="cx"> 
</span><ins>+    encoder &lt;&lt; m_viewportMetaTagWidthWasExplicit;
+    encoder &lt;&lt; m_viewportMetaTagCameFromImageDocument;
+
</ins><span class="cx">     encoder &lt;&lt; m_callbackIDs;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -620,6 +623,12 @@
</span><span class="cx">     if (!decoder.decode(result.m_allowsUserScaling))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><ins>+    if (!decoder.decode(result.m_viewportMetaTagWidthWasExplicit))
+        return false;
+
+    if (!decoder.decode(result.m_viewportMetaTagCameFromImageDocument))
+        return false;
+
</ins><span class="cx">     if (!decoder.decode(result.m_callbackIDs))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -819,6 +828,8 @@
</span><span class="cx">     ts.dumpProperty(&quot;maximumScaleFactor&quot;, m_maximumScaleFactor);
</span><span class="cx">     ts.dumpProperty(&quot;initialScaleFactor&quot;, m_initialScaleFactor);
</span><span class="cx">     ts.dumpProperty(&quot;viewportMetaTagWidth&quot;, m_viewportMetaTagWidth);
</span><ins>+    ts.dumpProperty(&quot;viewportMetaTagWidthWasExplicit&quot;, m_viewportMetaTagWidthWasExplicit);
+    ts.dumpProperty(&quot;viewportMetaTagCameFromImageDocument&quot;, m_viewportMetaTagCameFromImageDocument);
</ins><span class="cx">     ts.dumpProperty(&quot;renderTreeSize&quot;, m_renderTreeSize);
</span><span class="cx"> 
</span><span class="cx">     ts &lt;&lt; &quot;root-layer &quot; &lt;&lt; m_rootLayerID &lt;&lt; &quot;)&quot;;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm (195606 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-01-26 20:07:07 UTC (rev 195606)
+++ trunk/Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -201,6 +201,8 @@
</span><span class="cx">     CGSize _maximumUnobscuredSizeOverride;
</span><span class="cx">     CGRect _inputViewBounds;
</span><span class="cx">     CGFloat _viewportMetaTagWidth;
</span><ins>+    BOOL _viewportMetaTagWidthWasExplicit;
+    BOOL _viewportMetaTagCameFromImageDocument;
</ins><span class="cx">     CGFloat _initialScaleFactor;
</span><span class="cx">     BOOL _fastClickingIsDisabled;
</span><span class="cx"> 
</span><span class="lines">@@ -1118,6 +1120,8 @@
</span><span class="cx">         [_scrollView setZoomScale:layerTreeTransaction.pageScaleFactor()];
</span><span class="cx"> 
</span><span class="cx">     _viewportMetaTagWidth = layerTreeTransaction.viewportMetaTagWidth();
</span><ins>+    _viewportMetaTagWidthWasExplicit = layerTreeTransaction.viewportMetaTagWidthWasExplicit();
+    _viewportMetaTagCameFromImageDocument = layerTreeTransaction.viewportMetaTagCameFromImageDocument();
</ins><span class="cx">     _initialScaleFactor = layerTreeTransaction.initialScaleFactor();
</span><span class="cx">     if (![_contentView _mayDisableDoubleTapGesturesDuringSingleTap])
</span><span class="cx">         [_contentView _setDoubleTapGesturesEnabled:self._allowsDoubleTapGestures];
</span><span class="lines">@@ -1595,6 +1599,10 @@
</span><span class="cx">     if (![_scrollView isZoomEnabled] || [_scrollView minimumZoomScale] &gt;= [_scrollView maximumZoomScale])
</span><span class="cx">         return NO;
</span><span class="cx"> 
</span><ins>+    // If the viewport width was not explicit, we allow double tap gestures.
+    if (!_viewportMetaTagWidthWasExplicit || _viewportMetaTagCameFromImageDocument)
+        return YES;
+
</ins><span class="cx">     // For scalable viewports, only disable double tap gestures if the viewport width is device width.
</span><span class="cx">     if (_viewportMetaTagWidth != WebCore::ViewportArguments::ValueDeviceWidth)
</span><span class="cx">         return YES;
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPageWebPagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (195606 => 195607)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-01-26 20:07:07 UTC (rev 195606)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp        2016-01-26 20:09:27 UTC (rev 195607)
</span><span class="lines">@@ -2982,6 +2982,8 @@
</span><span class="cx">     layerTransaction.setMaximumScaleFactor(m_viewportConfiguration.maximumScale());
</span><span class="cx">     layerTransaction.setInitialScaleFactor(m_viewportConfiguration.initialScale());
</span><span class="cx">     layerTransaction.setViewportMetaTagWidth(m_viewportConfiguration.viewportArguments().width);
</span><ins>+    layerTransaction.setViewportMetaTagWidthWasExplicit(m_viewportConfiguration.viewportArguments().widthWasExplicit);
+    layerTransaction.setViewportMetaTagCameFromImageDocument(m_viewportConfiguration.viewportArguments().type == ViewportArguments::ImageDocument);
</ins><span class="cx">     layerTransaction.setAllowsUserScaling(allowsUserScaling());
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(MAC)
</span></span></pre>
</div>
</div>

</body>
</html>