<!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>[246029] branches/safari-608.1.27-branch</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/246029">246029</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2019-06-02 22:29:47 -0700 (Sun, 02 Jun 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>Cherry-pick <a href="http://trac.webkit.org/projects/webkit/changeset/245989">r245989</a>. rdar://problem/51283532

    iOS: Main frame should be scrollable when pinch zoomed or software keyboard is up
    https://bugs.webkit.org/show_bug.cgi?id=198244

    Reviewed by Simon Fraser.

    Source/WebKit:

    This is a follow up to <a href="http://trac.webkit.org/projects/webkit/changeset/245006">r245006</a>. Even when overflow: hidden is specified on the document body,
    we still need to make it scrollable when the page is pinch zoomed or there is a content inset
    e.g. for software keyboard. Otherwise, the user won't be able to get to the content that is
    outside the visual viewport when pinch zoomed or the parts of the page that is not outside
    the visual viewport due to the scrolling caused by the software keyboard being brought up.

    * UIProcess/API/Cocoa/WKWebView.mm:
    (-[WKWebView _didCommitLayerTree:]):

    LayoutTests:

    Added regression tests.

    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard-expected.txt: Added.
    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard.html: Added.
    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1-expected.txt: Added.
    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1.html: Added.
    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2-expected.txt: Added.
    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2.html: Added.

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245989 268f45cc-cd09-0410-ab3c-d52691b4dbfc</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari608127branchLayoutTestsChangeLog">branches/safari-608.1.27-branch/LayoutTests/ChangeLog</a></li>
<li><a href="#branchessafari608127branchSourceWebKitChangeLog">branches/safari-608.1.27-branch/Source/WebKit/ChangeLog</a></li>
<li><a href="#branchessafari608127branchSourceWebKitUIProcessAPICocoaWKWebViewmm">branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentkeyboardexpectedtxt">branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard-expected.txt</a></li>
<li><a href="#branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentkeyboardhtml">branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard.html</a></li>
<li><a href="#branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentzoomed1expectedtxt">branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1-expected.txt</a></li>
<li><a href="#branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentzoomed1html">branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1.html</a></li>
<li><a href="#branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentzoomed2expectedtxt">branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2-expected.txt</a></li>
<li><a href="#branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentzoomed2html">branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari608127branchLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-608.1.27-branch/LayoutTests/ChangeLog (246028 => 246029)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608.1.27-branch/LayoutTests/ChangeLog    2019-06-03 05:28:58 UTC (rev 246028)
+++ branches/safari-608.1.27-branch/LayoutTests/ChangeLog       2019-06-03 05:29:47 UTC (rev 246029)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2019-06-02  Babak Shafiei  <bshafiei@apple.com>
+
+        Cherry-pick r245989. rdar://problem/51283532
+
+    iOS: Main frame should be scrollable when pinch zoomed or software keyboard is up
+    https://bugs.webkit.org/show_bug.cgi?id=198244
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebKit:
+    
+    This is a follow up to r245006. Even when overflow: hidden is specified on the document body,
+    we still need to make it scrollable when the page is pinch zoomed or there is a content inset
+    e.g. for software keyboard. Otherwise, the user won't be able to get to the content that is
+    outside the visual viewport when pinch zoomed or the parts of the page that is not outside
+    the visual viewport due to the scrolling caused by the software keyboard being brought up.
+    
+    * UIProcess/API/Cocoa/WKWebView.mm:
+    (-[WKWebView _didCommitLayerTree:]):
+    
+    LayoutTests:
+    
+    Added regression tests.
+    
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard-expected.txt: Added.
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard.html: Added.
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1-expected.txt: Added.
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1.html: Added.
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2-expected.txt: Added.
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-05-31  Ryosuke Niwa  <rniwa@webkit.org>
+
+            iOS: Main frame should be scrollable when pinch zoomed or software keyboard is up
+            https://bugs.webkit.org/show_bug.cgi?id=198244
+
+            Reviewed by Simon Fraser.
+
+            Added regression tests.
+
+            * fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard-expected.txt: Added.
+            * fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard.html: Added.
+            * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1-expected.txt: Added.
+            * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1.html: Added.
+            * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2-expected.txt: Added.
+            * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2.html: Added.
+
</ins><span class="cx"> 2019-05-31  Kocsen Chung  <kocsen_chung@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Revert r245953. rdar://problem/51314019
</span></span></pre></div>
<a id="branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentkeyboardexpectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard-expected.txt (0 => 246029)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard-expected.txt                             (rev 0)
+++ branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard-expected.txt        2019-06-03 05:29:47 UTC (rev 246029)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+This document shouldn't be scrollable normally but should be scrollable when the software keyboard is shown.
+To manually test, tap on the text field below to bring up the docked software keyboard.
+The document should become scrollable.
+PASS - the document did scroll
</ins></span></pre></div>
<a id="branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentkeyboardhtml"></a>
<div class="addfile"><h4>Added: branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard.html (0 => 246029)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard.html                             (rev 0)
+++ branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard.html        2019-06-03 05:29:47 UTC (rev 246029)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] -->
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
+<script src="../../../resources/ui-helper.js"></script>
+<script src="../../../resources/basic-gestures.js"></script>
+<style>
+html, body { width: 100%; height: 100%; margin: 0px; padding: 0px; }
+body { overflow: hidden; }
+#content { width: 100%; height: 100%; box-sizing: border-box; padding: 20px; background: #ccc; }
+</style>
+<script>
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+async function runTest() {
+    if (!window.testRunner)
+        return;
+
+    await UIHelper.setHardwareKeyboardAttached(false);
+
+    // FIXME: <rdar://problem/51289800> Scrolling down by touch gestures does not work immediately after software keyboard is brought up for the first time
+    await UIHelper.activateElementAndWaitForInputSession(document.querySelector('input'));
+    document.activeElement.blur();
+    await UIHelper.waitForKeyboardToHide();
+
+    await UIHelper.activateElementAndWaitForInputSession(document.querySelector('input'));
+
+    const result = document.getElementById('result');
+    const y = result.getBoundingClientRect().top + 10;
+
+    await touchAndDragFromPointToPoint(200, y + 100, 200, y + 10);
+    await liftUpAtPoint(200, y + 10);
+    await UIHelper.delayFor(100);
+
+    result.textContent = document.documentElement.scrollTop >= 50 ? 'PASS - the document did scroll' : 'FAIL - the document did not scroll';
+
+    testRunner.notifyDone();
+}
+
+</script>
+<body onload="runTest()"><div id="content">
+This document shouldn't be scrollable normally but should be scrollable when the software keyboard is shown.<br>
+To manually test, tap on the text field below to bring up the docked software keyboard.<br>
+The document should become scrollable.<br>
+<div id="result"><input placeholder="Click here"></div>
+</div></body>
+</html>
</ins></span></pre></div>
<a id="branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentzoomed1expectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1-expected.txt (0 => 246029)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1-expected.txt                             (rev 0)
+++ branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1-expected.txt        2019-06-03 05:29:47 UTC (rev 246029)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+This document shouldn't be scrollable normally but should be scrollable when pinch zoomed.
+To manually test, pinch zoom on the page. The document should become scrollable.
+PASS - the document did scroll with zooming
+PASS - the document scrolled back to the top
+
</ins></span></pre></div>
<a id="branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentzoomed1html"></a>
<div class="addfile"><h4>Added: branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1.html (0 => 246029)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1.html                             (rev 0)
+++ branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1.html        2019-06-03 05:29:47 UTC (rev 246029)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] -->
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+<script src="../../../resources/ui-helper.js"></script>
+<script src="../../../resources/basic-gestures.js"></script>
+<style>
+html, body { width: 100%; height: 100%; margin: 0px; padding: 0px; }
+body { overflow: hidden; }
+#content { width: 100%; height: 100%; box-sizing: border-box; padding: 20px; background: #ccc; }
+</style>
+<script>
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+async function runTest() {
+    if (!window.testRunner)
+        return;
+
+    let result = '';
+    const log = (text) => result += text + '\n';
+
+    await UIHelper.zoomToScale(1.5);
+
+    log(visualViewport.pageTop > 50 ? 'PASS - the document did scroll with zooming' : `FAIL - the document did not scroll with zooming: ${visualViewport.pageTop}`);
+
+    await touchAndDragFromPointToPoint(200, 100, 200, 200);
+    await liftUpAtPoint(200, 200);
+    await UIHelper.delayFor(200);
+
+    log(visualViewport.pageTop <= 0 ? 'PASS - the document scrolled back to the top' : `FAIL - the document did not scroll back to the top: ${visualViewport.pageTop}`);
+
+    document.getElementById('log').textContent = result;
+
+    testRunner.notifyDone();
+}
+
+</script>
+<body onload="runTest()">
+<div id="content">
+This document shouldn't be scrollable normally but should be scrollable when pinch zoomed.<br>
+To manually test, pinch zoom on the page. The document should become scrollable.
+</div>
+<pre id="log"></pre>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentzoomed2expectedtxt"></a>
<div class="addfile"><h4>Added: branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2-expected.txt (0 => 246029)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2-expected.txt                             (rev 0)
+++ branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2-expected.txt        2019-06-03 05:29:47 UTC (rev 246029)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+This document shouldn't be scrollable normally but should be scrollable when pinch zoomed.
+To manually test, pinch zoom on the page. The document should become scrollable.
+PASS - the document did scroll with zooming
+PASS - the document scrolled back to the top
+
</ins></span></pre></div>
<a id="branchessafari608127branchLayoutTestsfastscrollingiosbodyoverflowhiddenheight100percentzoomed2html"></a>
<div class="addfile"><h4>Added: branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2.html (0 => 246029)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2.html                             (rev 0)
+++ branches/safari-608.1.27-branch/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2.html        2019-06-03 05:29:47 UTC (rev 246029)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] -->
+<html>
+<head>
+<script src="../../../resources/ui-helper.js"></script>
+<script src="../../../resources/basic-gestures.js"></script>
+<style>
+html, body { width: 100%; height: 100%; margin: 0px; padding: 0px; }
+body { overflow: hidden; }
+#content { width: 100%; height: 100%; box-sizing: border-box; padding: 20px; background: #ccc; }
+</style>
+<script>
+if (window.testRunner) {
+    testRunner.waitUntilDone();
+    testRunner.dumpAsText();
+}
+
+async function runTest() {
+    if (!window.testRunner)
+        return;
+
+    let result = '';
+    const log = (text) => result += text + '\n';
+
+    const initialScale = await UIHelper.zoomScale();
+    await UIHelper.zoomToScale(initialScale * 1.5);
+    const finalScale = await UIHelper.zoomScale();
+
+    log(visualViewport.pageTop > 100 ? 'PASS - the document did scroll with zooming' : `FAIL - the document did not scroll with zooming: ${visualViewport.pageTop}`);
+
+    const x = visualViewport.pageLeft;
+    const y = visualViewport.pageTop;
+
+    await touchAndDragFromPointToPoint(x + 100, y + 100, x + 100, y + 200);
+    await liftUpAtPoint(x + 100, y + 200);
+    await UIHelper.delayFor(200);
+
+    const expectedY = y - 80 * finalScale;
+    log(visualViewport.pageTop < expectedY ? 'PASS - the document scrolled back to the top' : `FAIL - the document did not scroll back to the top: expected ${visualViewport.pageTop} < ${expectedY}`);
+
+    document.getElementById('log').textContent = result;
+
+    testRunner.notifyDone();
+}
+
+</script>
+<body onload="runTest()">
+<div id="content">
+This document shouldn't be scrollable normally but should be scrollable when pinch zoomed.<br>
+To manually test, pinch zoom on the page. The document should become scrollable.
+</div>
+<pre id="log"></pre>
+</body>
+</html>
</ins></span></pre></div>
<a id="branchessafari608127branchSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-608.1.27-branch/Source/WebKit/ChangeLog (246028 => 246029)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608.1.27-branch/Source/WebKit/ChangeLog  2019-06-03 05:28:58 UTC (rev 246028)
+++ branches/safari-608.1.27-branch/Source/WebKit/ChangeLog     2019-06-03 05:29:47 UTC (rev 246029)
</span><span class="lines">@@ -1,3 +1,53 @@
</span><ins>+2019-06-02  Babak Shafiei  <bshafiei@apple.com>
+
+        Cherry-pick r245989. rdar://problem/51283532
+
+    iOS: Main frame should be scrollable when pinch zoomed or software keyboard is up
+    https://bugs.webkit.org/show_bug.cgi?id=198244
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebKit:
+    
+    This is a follow up to r245006. Even when overflow: hidden is specified on the document body,
+    we still need to make it scrollable when the page is pinch zoomed or there is a content inset
+    e.g. for software keyboard. Otherwise, the user won't be able to get to the content that is
+    outside the visual viewport when pinch zoomed or the parts of the page that is not outside
+    the visual viewport due to the scrolling caused by the software keyboard being brought up.
+    
+    * UIProcess/API/Cocoa/WKWebView.mm:
+    (-[WKWebView _didCommitLayerTree:]):
+    
+    LayoutTests:
+    
+    Added regression tests.
+    
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard-expected.txt: Added.
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard.html: Added.
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1-expected.txt: Added.
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1.html: Added.
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2-expected.txt: Added.
+    * fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245989 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-05-31  Ryosuke Niwa  <rniwa@webkit.org>
+
+            iOS: Main frame should be scrollable when pinch zoomed or software keyboard is up
+            https://bugs.webkit.org/show_bug.cgi?id=198244
+
+            Reviewed by Simon Fraser.
+
+            This is a follow up to r245006. Even when overflow: hidden is specified on the document body,
+            we still need to make it scrollable when the page is pinch zoomed or there is a content inset
+            e.g. for software keyboard. Otherwise, the user won't be able to get to the content that is
+            outside the visual viewport when pinch zoomed or the parts of the page that is not outside
+            the visual viewport due to the scrolling caused by the software keyboard being brought up.
+
+            * UIProcess/API/Cocoa/WKWebView.mm:
+            (-[WKWebView _didCommitLayerTree:]):
+
</ins><span class="cx"> 2019-05-31  Alan Coon  <alancoon@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Revert r245943. rdar://problem/51244662
</span></span></pre></div>
<a id="branchessafari608127branchSourceWebKitUIProcessAPICocoaWKWebViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (246028 => 246029)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm   2019-06-03 05:28:58 UTC (rev 246028)
+++ branches/safari-608.1.27-branch/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm      2019-06-03 05:29:47 UTC (rev 246029)
</span><span class="lines">@@ -1988,7 +1988,9 @@
</span><span class="cx">     [_scrollView setMaximumZoomScale:layerTreeTransaction.maximumScaleFactor()];
</span><span class="cx">     [_scrollView setZoomEnabled:layerTreeTransaction.allowsUserScaling()];
</span><span class="cx"> #if ENABLE(ASYNC_SCROLLING)
</span><del>-    [_scrollView setScrollEnabled:_page->scrollingCoordinatorProxy()->hasScrollableMainFrame()];
</del><ins>+    bool hasDockedInputView = !CGRectIsEmpty(_inputViewBounds);
+    bool isZoomed = layerTreeTransaction.pageScaleFactor() > layerTreeTransaction.initialScaleFactor();
+    [_scrollView setScrollEnabled:_page->scrollingCoordinatorProxy()->hasScrollableMainFrame() || hasDockedInputView || isZoomed];
</ins><span class="cx"> #endif
</span><span class="cx">     if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom] && [_scrollView zoomScale] != layerTreeTransaction.pageScaleFactor()) {
</span><span class="cx">         LOG_WITH_STREAM(VisibleRects, stream << " updating scroll view with pageScaleFactor " << layerTreeTransaction.pageScaleFactor());
</span></span></pre>
</div>
</div>

</body>
</html>