WebKit Bugzilla
Attachment 369268 Details for
Bug 153852
: <body> with overflow:hidden CSS is scrollable on iOS
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
overflow-hidden-ios-8.patch (text/plain), 11.56 KB, created by
Antti Koivisto
on 2019-05-07 03:20:30 PDT
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Antti Koivisto
Created:
2019-05-07 03:20:30 PDT
Size:
11.56 KB
patch
obsolete
>Index: Source/WebCore/ChangeLog >=================================================================== >--- Source/WebCore/ChangeLog (revision 244962) >+++ Source/WebCore/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2019-05-07 Antti Koivisto <antti@apple.com> >+ >+ <body> with overflow:hidden CSS is scrollable on iOS >+ https://bugs.webkit.org/show_bug.cgi?id=153852 >+ <rdar://problem/38715356> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Tests: fast/scrolling/ios/body-overflow-hidden-frame.html >+ fast/scrolling/ios/body-overflow-hidden.html >+ >+ * page/scrolling/ScrollingTreeScrollingNode.h: >+ > 2019-05-06 Zan Dobersek <zdobersek@igalia.com> > > [GLib] WebCore::MainThreadSharedTimer should use the appropriate GSource priority, name >Index: Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h >=================================================================== >--- Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h (revision 244904) >+++ Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h (working copy) >@@ -67,6 +67,7 @@ public: > > bool horizontalScrollbarHiddenByStyle() const { return m_scrollableAreaParameters.horizontalScrollbarHiddenByStyle; } > bool verticalScrollbarHiddenByStyle() const { return m_scrollableAreaParameters.verticalScrollbarHiddenByStyle; } >+ bool canHaveScrollbars() const { return m_scrollableAreaParameters.horizontalScrollbarMode != ScrollbarAlwaysOff || m_scrollableAreaParameters.verticalScrollbarMode != ScrollbarAlwaysOff; } > > #if ENABLE(CSS_SCROLL_SNAP) > const Vector<float>& horizontalSnapOffsets() const { return m_snapOffsetsInfo.horizontalSnapOffsets; } >@@ -124,8 +125,6 @@ protected: > bool hasEnabledHorizontalScrollbar() const { return m_scrollableAreaParameters.hasEnabledHorizontalScrollbar; } > bool hasEnabledVerticalScrollbar() const { return m_scrollableAreaParameters.hasEnabledVerticalScrollbar; } > >- bool canHaveScrollbars() const { return m_scrollableAreaParameters.horizontalScrollbarMode != ScrollbarAlwaysOff || m_scrollableAreaParameters.verticalScrollbarMode != ScrollbarAlwaysOff; } >- > bool expectsWheelEventTestTrigger() const { return m_expectsWheelEventTestTrigger; } > > LayoutPoint parentToLocalPoint(LayoutPoint) const override; >Index: Source/WebKit/ChangeLog >=================================================================== >--- Source/WebKit/ChangeLog (revision 245004) >+++ Source/WebKit/ChangeLog (working copy) >@@ -1,3 +1,29 @@ >+2019-05-07 Antti Koivisto <antti@apple.com> >+ >+ <body> with overflow:hidden CSS is scrollable on iOS >+ https://bugs.webkit.org/show_bug.cgi?id=153852 >+ <rdar://problem/38715356> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Disable touch scrolling of the main scroll view when <body> has overflow:hidden. >+ >+ This already works for subframes where we don't create a scrollview in the first place. >+ The patch also adds a test for that. >+ >+ * UIProcess/API/Cocoa/WKWebView.mm: >+ (-[WKWebView _didCommitLayerTree:]): >+ >+ Update scrollability after scrolling tree commits. >+ >+ * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp: >+ (WebKit::RemoteScrollingCoordinatorProxy::hasScrollableMainFrame const): >+ >+ Base the decision on root ScrollingTreeScrollingNode::canHaveScrollbars() which is computed from overflow. >+ This matches Mac where wheel event dispatch is similarly blocked based on this property. >+ >+ * UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h: >+ > 2019-05-06 James Savage <james.savage@apple.com> > > Improve coordination for creating UIWindow instances. >Index: Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm >=================================================================== >--- Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (revision 244904) >+++ Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm (working copy) >@@ -1987,6 +1987,9 @@ - (void)_didCommitLayerTree:(const WebKi > [_scrollView setMinimumZoomScale:layerTreeTransaction.minimumScaleFactor()]; > [_scrollView setMaximumZoomScale:layerTreeTransaction.maximumScaleFactor()]; > [_scrollView setZoomEnabled:layerTreeTransaction.allowsUserScaling()]; >+#if ENABLE(ASYNC_SCROLLING) >+ [_scrollView setScrollEnabled:_page->scrollingCoordinatorProxy()->hasScrollableMainFrame()]; >+#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()); > [_scrollView setZoomScale:layerTreeTransaction.pageScaleFactor()]; >Index: Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp (revision 244904) >+++ Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.cpp (working copy) >@@ -240,6 +240,12 @@ String RemoteScrollingCoordinatorProxy:: > return emptyString(); > } > >+bool RemoteScrollingCoordinatorProxy::hasScrollableMainFrame() const >+{ >+ auto* rootNode = m_scrollingTree->rootNode(); >+ return rootNode && rootNode->canHaveScrollbars(); >+} >+ > #if ENABLE(POINTER_EVENTS) > Optional<TouchActionData> RemoteScrollingCoordinatorProxy::touchActionDataAtPoint(const IntPoint p) const > { >Index: Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h >=================================================================== >--- Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h (revision 244904) >+++ Source/WebKit/UIProcess/RemoteLayerTree/RemoteScrollingCoordinatorProxy.h (working copy) >@@ -84,6 +84,7 @@ public: > void setPropagatesMainFrameScrolls(bool propagatesMainFrameScrolls) { m_propagatesMainFrameScrolls = propagatesMainFrameScrolls; } > bool propagatesMainFrameScrolls() const { return m_propagatesMainFrameScrolls; } > bool hasFixedOrSticky() const { return m_scrollingTree->hasFixedOrSticky(); } >+ bool hasScrollableMainFrame() const; > > #if PLATFORM(IOS_FAMILY) > WebCore::FloatRect currentLayoutViewport() const; >Index: LayoutTests/ChangeLog >=================================================================== >--- LayoutTests/ChangeLog (revision 244904) >+++ LayoutTests/ChangeLog (working copy) >@@ -1,3 +1,16 @@ >+2019-05-07 Antti Koivisto <antti@apple.com> >+ >+ <body> with overflow:hidden CSS is scrollable on iOS >+ https://bugs.webkit.org/show_bug.cgi?id=153852 >+ <rdar://problem/38715356> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * fast/scrolling/ios/body-overflow-hidden-expected.html: Added. >+ * fast/scrolling/ios/body-overflow-hidden-frame-expected.html: Added. >+ * fast/scrolling/ios/body-overflow-hidden-frame.html: Added. >+ * fast/scrolling/ios/body-overflow-hidden.html: Added. >+ > 2019-05-02 Ryosuke Niwa <rniwa@webkit.org> > > Make focusing-element-with-tabindex-by-tap-or-click.html more robust on iOS >Index: LayoutTests/fast/scrolling/ios/body-overflow-hidden-expected.html >=================================================================== >--- LayoutTests/fast/scrolling/ios/body-overflow-hidden-expected.html (nonexistent) >+++ LayoutTests/fast/scrolling/ios/body-overflow-hidden-expected.html (working copy) >@@ -0,0 +1,13 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] --> >+<head> >+<meta name="viewport" content="width=device-width, initial-scale=1"> >+<style> >+body { overflow: hidden } >+.scroll-content { width: 500px; height: 5000px; border: 2px solid green; } >+</style> >+<body> >+<div class="scroll-content"> >+This document shouldn't be scrollable. >+</div> >+</body> >+</html> >Index: LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame-expected.html >=================================================================== >--- LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame-expected.html (nonexistent) >+++ LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame-expected.html (working copy) >@@ -0,0 +1,25 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] --> >+<html> >+<head> >+<meta name="viewport" content="width=device-width, initial-scale=1"> >+<style> >+body { overflow: hidden } >+.scroll-content { width: 500px; height: 5000px; border: 2px solid green; } >+</style> >+<body onload="runTest()"> >+<iframe srcdoc=" >+ <html> >+ <style> >+ body { overflow: hidden } >+ .scroll-content { width: 500px; height: 5000px; border: 2px solid green; } >+ </style> >+ <body> >+ <div class='scroll-content'> >+ This document shouldn't be scrollable. >+ </div> >+ </body> >+ </html> >+" width=500 height=500> >+</iframe> >+</body> >+</html> >Index: LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame.html >=================================================================== >--- LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame.html (nonexistent) >+++ LayoutTests/fast/scrolling/ios/body-overflow-hidden-frame.html (working copy) >@@ -0,0 +1,46 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] --> >+<html> >+<head> >+<meta name="viewport" content="width=device-width, initial-scale=1"> >+<script src="../../../resources/basic-gestures.js"></script> >+<style> >+body { overflow: hidden } >+.scroll-content { width: 500px; height: 5000px; border: 2px solid green; } >+</style> >+<script> >+if (window.testRunner) >+ testRunner.waitUntilDone(); >+ >+function waitPromise(delay) >+{ >+ return new Promise(resolve => setTimeout(resolve, delay)); >+} >+ >+async function runTest() { >+ if (!window.testRunner) >+ return; >+ >+ await touchAndDragFromPointToPoint(150, 300, 150, 150); >+ await liftUpAtPoint(150, 150); >+ await waitPromise(50); >+ >+ testRunner.notifyDone(); >+} >+</script> >+<body onload="runTest()"> >+<iframe srcdoc=" >+ <html> >+ <style> >+ body { overflow: hidden } >+ .scroll-content { width: 500px; height: 5000px; border: 2px solid green; } >+ </style> >+ <body> >+ <div class='scroll-content'> >+ This document shouldn't be scrollable. >+ </div> >+ </body> >+ </html> >+" width=500 height=500> >+</iframe> >+</body> >+</html> >Index: LayoutTests/fast/scrolling/ios/body-overflow-hidden.html >=================================================================== >--- LayoutTests/fast/scrolling/ios/body-overflow-hidden.html (nonexistent) >+++ LayoutTests/fast/scrolling/ios/body-overflow-hidden.html (working copy) >@@ -0,0 +1,34 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true internal:AsyncFrameScrollingEnabled=true ] --> >+<head> >+<meta name="viewport" content="width=device-width, initial-scale=1"> >+<script src="../../../resources/basic-gestures.js"></script> >+<style> >+body { overflow: hidden } >+.scroll-content { width: 500px; height: 5000px; border: 2px solid green; } >+</style> >+<script> >+if (window.testRunner) >+ testRunner.waitUntilDone(); >+ >+function waitPromise(delay) >+{ >+ return new Promise(resolve => setTimeout(resolve, delay)); >+} >+ >+async function runTest() { >+ if (!window.testRunner) >+ return; >+ >+ await touchAndDragFromPointToPoint(150, 300, 150, 150); >+ await liftUpAtPoint(150, 150); >+ await waitPromise(50); >+ >+ testRunner.notifyDone(); >+} >+</script> >+<body onload="runTest()"> >+<div class="scroll-content"> >+This document shouldn't be scrollable. >+</div> >+</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 153852
:
270621
|
270644
|
369132
|
369135
|
369263
|
369267
| 369268