Title: [247420] trunk
- Revision
- 247420
- Author
- [email protected]
- Date
- 2019-07-13 15:29:32 -0700 (Sat, 13 Jul 2019)
Log Message
Don't do async overflow scrolling for visibility:hidden scrollers
https://bugs.webkit.org/show_bug.cgi?id=199779
Reviewed by Dean Jackson.
Source/WebCore:
An overflow:scroll with visibility:hidden is not scrollable on macOS, even if it has visible
content. So disable async overflow:scroll when the scroller has non-visible visibility (this also
takes visibility on ancestors into account).
visibility:hidden overflow:scroll can be common because some JS libraries use it
(https://github.com/wnr/element-resize-detector).
Test: compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers.html
* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::canUseCompositedScrolling const): Don't use hasVisibleContent() because
that's affected by visible children.
LayoutTests:
* compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers.html: Added.
* platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt: Added.
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (247419 => 247420)
--- trunk/LayoutTests/ChangeLog 2019-07-13 17:43:41 UTC (rev 247419)
+++ trunk/LayoutTests/ChangeLog 2019-07-13 22:29:32 UTC (rev 247420)
@@ -1,3 +1,14 @@
+2019-07-13 Simon Fraser <[email protected]>
+
+ Don't do async overflow scrolling for visibility:hidden scrollers
+ https://bugs.webkit.org/show_bug.cgi?id=199779
+
+ Reviewed by Dean Jackson.
+
+ * compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt: Added.
+ * compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers.html: Added.
+ * platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt: Added.
+
2019-07-13 Zalan Bujtas <[email protected]>
Cannot bring up custom media controls at all on v.youku.com
Added: trunk/LayoutTests/compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt (0 => 247420)
--- trunk/LayoutTests/compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt (rev 0)
+++ trunk/LayoutTests/compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt 2019-07-13 22:29:32 UTC (rev 247420)
@@ -0,0 +1,36 @@
+s
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 785.00 742.00)
+ (clips 1)
+ (children 1
+ (GraphicsLayer
+ (bounds 785.00 742.00)
+ (contentsOpaque 1)
+ (children 1
+ (GraphicsLayer
+ (position 28.00 46.00)
+ (bounds 304.00 154.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (offsetFromRenderer width=2 height=2)
+ (position 2.00 2.00)
+ (bounds 285.00 135.00)
+ (clips 1)
+ (children 1
+ (GraphicsLayer
+ (offsetFromRenderer width=2 height=2)
+ (anchor 0.00 0.00)
+ (bounds 285.00 405.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+
Added: trunk/LayoutTests/compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers.html (0 => 247420)
--- trunk/LayoutTests/compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers.html (rev 0)
+++ trunk/LayoutTests/compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers.html 2019-07-13 22:29:32 UTC (rev 247420)
@@ -0,0 +1,68 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<head>
+ <title>visibility:hidden scrollers should not be composited for async scrolling</title>
+ <style>
+ .scroller {
+ margin: 20px;
+ width: 300px;
+ height: 150px;
+ border: 2px solid black;
+ overflow: scroll;
+ }
+
+ .contents {
+ height: 300%;
+ background-image: repeating-linear-gradient(white, silver 100px);
+ }
+
+ .hidden {
+ visibility: hidden;
+ }
+
+ .box {
+ margin: 40px;
+ width: 100px;
+ height: 100px;
+ background-color: blue;
+ }
+
+ .visible {
+ visibility: visible;
+ }
+ </style>
+ <script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ window.addEventListener('load', () => {
+ if (window.internals)
+ document.getElementById('layers').innerText = window.internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_CLIPPING);
+ }, false);
+ </script>
+s</head>
+<body>
+ <div class="scroller">
+ <div class="contents"></div>
+ </div>
+
+ <div class="hidden scroller">
+ <div class="contents"></div>
+ </div>
+
+ <div class="hidden scroller">
+ <div class="contents">
+ <div class="visible box"></div>
+ </div>
+ </div>
+
+ <div class="hidden">
+ <div class="scroller">
+ <div class="contents">
+ <div class="visible box"></div>
+ </div>
+ </div>
+ </div>
+<pre id="layers"></pre>
+</body>
+</html>
Added: trunk/LayoutTests/platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt (0 => 247420)
--- trunk/LayoutTests/platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers-expected.txt 2019-07-13 22:29:32 UTC (rev 247420)
@@ -0,0 +1,36 @@
+s
+(GraphicsLayer
+ (anchor 0.00 0.00)
+ (bounds 800.00 744.00)
+ (clips 1)
+ (children 1
+ (GraphicsLayer
+ (bounds 800.00 744.00)
+ (contentsOpaque 1)
+ (children 1
+ (GraphicsLayer
+ (position 28.00 48.00)
+ (bounds 304.00 154.00)
+ (drawsContent 1)
+ (children 1
+ (GraphicsLayer
+ (offsetFromRenderer width=2 height=2)
+ (position 2.00 2.00)
+ (bounds 300.00 150.00)
+ (clips 1)
+ (children 1
+ (GraphicsLayer
+ (offsetFromRenderer width=2 height=2)
+ (anchor 0.00 0.00)
+ (bounds 300.00 450.00)
+ (drawsContent 1)
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+ )
+)
+
Modified: trunk/Source/WebCore/ChangeLog (247419 => 247420)
--- trunk/Source/WebCore/ChangeLog 2019-07-13 17:43:41 UTC (rev 247419)
+++ trunk/Source/WebCore/ChangeLog 2019-07-13 22:29:32 UTC (rev 247420)
@@ -1,3 +1,23 @@
+2019-07-13 Simon Fraser <[email protected]>
+
+ Don't do async overflow scrolling for visibility:hidden scrollers
+ https://bugs.webkit.org/show_bug.cgi?id=199779
+
+ Reviewed by Dean Jackson.
+
+ An overflow:scroll with visibility:hidden is not scrollable on macOS, even if it has visible
+ content. So disable async overflow:scroll when the scroller has non-visible visibility (this also
+ takes visibility on ancestors into account).
+
+ visibility:hidden overflow:scroll can be common because some JS libraries use it
+ (https://github.com/wnr/element-resize-detector).
+
+ Test: compositing/scrolling/async-overflow-scrolling/visibility-hidden-scrollers.html
+
+ * rendering/RenderLayer.cpp:
+ (WebCore::RenderLayer::canUseCompositedScrolling const): Don't use hasVisibleContent() because
+ that's affected by visible children.
+
2019-07-13 Robin Morisset <[email protected]>
[WHLSL] Return statements don't need to keep track of the function they're in
Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (247419 => 247420)
--- trunk/Source/WebCore/rendering/RenderLayer.cpp 2019-07-13 17:43:41 UTC (rev 247419)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp 2019-07-13 22:29:32 UTC (rev 247420)
@@ -2271,11 +2271,12 @@
bool RenderLayer::canUseCompositedScrolling() const
{
+ bool isVisible = renderer().style().visibility() == Visibility::Visible;
if (renderer().settings().asyncOverflowScrollingEnabled())
- return scrollsOverflow();
+ return isVisible && scrollsOverflow();
#if PLATFORM(IOS_FAMILY) && ENABLE(OVERFLOW_SCROLLING_TOUCH)
- return scrollsOverflow() && (renderer().style().useTouchOverflowScrolling() || renderer().settings().alwaysUseAcceleratedOverflowScroll());
+ return isVisible && scrollsOverflow() && (renderer().style().useTouchOverflowScrolling() || renderer().settings().alwaysUseAcceleratedOverflowScroll());
#else
return false;
#endif
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes