WebKit Bugzilla
Attachment 371024 Details for
Bug 198244
: iOS: Main frame should be scrollable when pinch zoomed or software keyboard is up
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Fixed a bug
bug-198244-20190530200358.patch (text/plain), 12.77 KB, created by
Ryosuke Niwa
on 2019-05-30 20:03:59 PDT
(
hide
)
Description:
Fixed a bug
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2019-05-30 20:03:59 PDT
Size:
12.77 KB
patch
obsolete
>Subversion Revision: 245847 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index 900bbe8f18da4eb8056c2e0bac6d50800c85a7c6..2345a6eaf7d40a4ae529f4b3611bef2f8236e98a 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,19 @@ >+2019-05-30 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 NOBODY (OOPS!). >+ >+ 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:]): >+ > 2019-05-28 Fujii Hironori <Hironori.Fujii@sony.com> > > [WinCairo] REGRESSION(r245186) Crash in NetworkCache::IOChannel::read in http/tests/IndexedDB some tests >diff --git a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >index d873d1481a70bad53222e6ee98f9e8476924740e..fa3f1e2db5f65ac4ac81e2235958f7d53427439d 100644 >--- a/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >+++ b/Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >@@ -1988,7 +1988,9 @@ - (void)_didCommitLayerTree:(const WebKit::RemoteLayerTreeTransaction&)layerTree > [_scrollView setMaximumZoomScale:layerTreeTransaction.maximumScaleFactor()]; > [_scrollView setZoomEnabled:layerTreeTransaction.allowsUserScaling()]; > #if ENABLE(ASYNC_SCROLLING) >- [_scrollView setScrollEnabled:_page->scrollingCoordinatorProxy()->hasScrollableMainFrame()]; >+ bool hasDockedInputView = !CGRectIsEmpty(_inputViewBounds); >+ bool isZoomed = layerTreeTransaction.pageScaleFactor() > layerTreeTransaction.initialScaleFactor(); >+ [_scrollView setScrollEnabled:_page->scrollingCoordinatorProxy()->hasScrollableMainFrame() || hasDockedInputView || isZoomed]; > #endif > if (!layerTreeTransaction.scaleWasSetByUIProcess() && ![_scrollView isZooming] && ![_scrollView isZoomBouncing] && ![_scrollView _isAnimatingZoom] && [_scrollView zoomScale] != layerTreeTransaction.pageScaleFactor()) { > LOG_WITH_STREAM(VisibleRects, stream << " updating scroll view with pageScaleFactor " << layerTreeTransaction.pageScaleFactor()); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e24fbeaf0957d7e56acc8aa3004e4f22bdadcc4e..ccfb420b82bdae40374d0a451bbf4c229f0a9a5d 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,19 @@ >+2019-05-30 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 NOBODY (OOPS!). >+ >+ 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. >+ > 2019-05-28 Saam Barati <sbarati@apple.com> > > [WHLSL] Type of dereference is the type of the thing we point to, not a pointer to that type >diff --git a/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard-expected.txt b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..0fa6179283c1978dc0a8a4f974b05d4106afb754 >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard-expected.txt >@@ -0,0 +1,4 @@ >+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 >diff --git a/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard.html b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard.html >new file mode 100644 >index 0000000000000000000000000000000000000000..7f405e4deaa6fbcc5e2b2b2425e5c218d58e9ffb >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-keyboard.html >@@ -0,0 +1,50 @@ >+<!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: Work around the bug that scrolling down after the software keyborad is brought up for the very first time does not work. >+ 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 new Promise((resolve) => setTimeout(resolve, 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> >diff --git a/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1-expected.txt b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..6e72a6a7f1c0c7ca3ec5ca1c63ee7a0f7b6381ab >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1-expected.txt >@@ -0,0 +1,5 @@ >+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 >+ >diff --git a/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1.html b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1.html >new file mode 100644 >index 0000000000000000000000000000000000000000..8952e8eea7dd37fbd5f9a1d2603410249d2facaf >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-1.html >@@ -0,0 +1,48 @@ >+<!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 new Promise((resolve) => setTimeout(resolve, 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> >diff --git a/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2-expected.txt b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..6e72a6a7f1c0c7ca3ec5ca1c63ee7a0f7b6381ab >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2-expected.txt >@@ -0,0 +1,5 @@ >+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 >+ >diff --git a/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2.html b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2.html >new file mode 100644 >index 0000000000000000000000000000000000000000..2358bae897f671895bbd36f92cb5f1461e7972fd >--- /dev/null >+++ b/LayoutTests/fast/scrolling/ios/body-overflow-hidden-height-100-percent-zoomed-2.html >@@ -0,0 +1,53 @@ >+<!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 new Promise((resolve) => setTimeout(resolve, 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>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 198244
:
370624
|
370625
|
370628
|
370629
|
370631
|
370632
|
370825
|
370826
|
371000
|
371024
|
371032