Title: [245651] trunk
Revision
245651
Author
simon.fra...@apple.com
Date
2019-05-22 15:08:25 -0700 (Wed, 22 May 2019)

Log Message

Inner scroller of nested overflow:scrolls jitters when scrolling
https://bugs.webkit.org/show_bug.cgi?id=198131

Reviewed by Antti Koivisto.

Source/WebCore:

enclosingCompositedScrollingLayer(layer) would return the layer itself, rather than
its scrolling ancestor, which meant that a composited scroller nested inside another
scroller would fail to get a "Moves" scrolling tree node, and therefore jitter
when scrolling.

Test: scrollingcoordinator/scrolling-tree/nested-overflow-scroll.html

* rendering/RenderLayerCompositor.cpp:
(WebCore::enclosingCompositedScrollingLayer):

LayoutTests:

* fast/scrolling/ios/overflow-scroll-overlap-6-expected.txt: Progression
* platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt: Added.
* scrollingcoordinator/scrolling-tree/nested-overflow-scroll.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (245650 => 245651)


--- trunk/LayoutTests/ChangeLog	2019-05-22 22:05:19 UTC (rev 245650)
+++ trunk/LayoutTests/ChangeLog	2019-05-22 22:08:25 UTC (rev 245651)
@@ -1,3 +1,15 @@
+2019-05-22  Simon Fraser  <simon.fra...@apple.com>
+
+        Inner scroller of nested overflow:scrolls jitters when scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=198131
+
+        Reviewed by Antti Koivisto.
+
+        * fast/scrolling/ios/overflow-scroll-overlap-6-expected.txt: Progression
+        * platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt: Added.
+        * scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt: Added.
+        * scrollingcoordinator/scrolling-tree/nested-overflow-scroll.html: Added.
+
 2019-05-22  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, rolling out r245598.

Modified: trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-6-expected.txt (245650 => 245651)


--- trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-6-expected.txt	2019-05-22 22:05:19 UTC (rev 245650)
+++ trunk/LayoutTests/fast/scrolling/ios/overflow-scroll-overlap-6-expected.txt	2019-05-22 22:08:25 UTC (rev 245651)
@@ -2,5 +2,5 @@
 
 case 1: 
 case 2: 
-case 3: 
+case 3: Scrollable 3 
 

Added: trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt (0 => 245651)


--- trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/ios-wk2/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt	2019-05-22 22:08:25 UTC (rev 245651)
@@ -0,0 +1,48 @@
+
+(Frame scrolling node
+  (scrollable area size 800 600)
+  (contents size 800 600)
+  (parent relative scrollable rect at (0,0) size 800x600)
+  (scrollable area parameters 
+    (horizontal scroll elasticity 1)
+    (vertical scroll elasticity 1)
+    (horizontal scrollbar mode 0)
+    (vertical scrollbar mode 0))
+  (layout viewport at (0,0) size 800x600)
+  (min layout viewport origin (0,0))
+  (max layout viewport origin (0,0))
+  (behavior for fixed 0)
+  (children 2
+    (Overflow scrolling node
+      (scrollable area size 300 300)
+      (contents size 300 464)
+      (parent relative scrollable rect at (30,22) size 300x300)
+      (scrollable area parameters 
+        (horizontal scroll elasticity 1)
+        (vertical scroll elasticity 1)
+        (horizontal scrollbar mode 0)
+        (vertical scrollbar mode 0)
+        (has enabled vertical scrollbar 1))
+    )
+    (Positioned node
+      (layout constraints 
+        (layer-position-at-last-layout (20,130))
+        (positioning-behavior moves))
+      (related overflow nodes 1)
+      (children 1
+        (Overflow scrolling node
+          (scrollable area size 200 200)
+          (contents size 200 520)
+          (parent relative scrollable rect at (2,2) size 200x200)
+          (scrollable area parameters 
+            (horizontal scroll elasticity 1)
+            (vertical scroll elasticity 1)
+            (horizontal scrollbar mode 0)
+            (vertical scrollbar mode 0)
+            (has enabled vertical scrollbar 1))
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt (0 => 245651)


--- trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-overflow-scroll-expected.txt	2019-05-22 22:08:25 UTC (rev 245651)
@@ -0,0 +1,48 @@
+
+(Frame scrolling node
+  (scrollable area size 800 600)
+  (contents size 800 600)
+  (parent relative scrollable rect at (0,0) size 800x600)
+  (scrollable area parameters 
+    (horizontal scroll elasticity 2)
+    (vertical scroll elasticity 2)
+    (horizontal scrollbar mode 0)
+    (vertical scrollbar mode 0))
+  (layout viewport at (0,0) size 800x600)
+  (min layout viewport origin (0,0))
+  (max layout viewport origin (0,0))
+  (behavior for fixed 0)
+  (children 2
+    (Overflow scrolling node
+      (scrollable area size 285 285)
+      (contents size 285 464)
+      (parent relative scrollable rect at (30,22) size 285x285)
+      (scrollable area parameters 
+        (horizontal scroll elasticity 0)
+        (vertical scroll elasticity 0)
+        (horizontal scrollbar mode 0)
+        (vertical scrollbar mode 0)
+        (has enabled vertical scrollbar 1))
+    )
+    (Positioned node
+      (layout constraints 
+        (layer-position-at-last-layout (20,130))
+        (positioning-behavior moves))
+      (related overflow nodes 1)
+      (children 1
+        (Overflow scrolling node
+          (scrollable area size 185 185)
+          (contents size 185 520)
+          (parent relative scrollable rect at (2,2) size 185x185)
+          (scrollable area parameters 
+            (horizontal scroll elasticity 0)
+            (vertical scroll elasticity 0)
+            (horizontal scrollbar mode 0)
+            (vertical scrollbar mode 0)
+            (has enabled vertical scrollbar 1))
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-overflow-scroll.html (0 => 245651)


--- trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-overflow-scroll.html	                        (rev 0)
+++ trunk/LayoutTests/scrollingcoordinator/scrolling-tree/nested-overflow-scroll.html	2019-05-22 22:08:25 UTC (rev 245651)
@@ -0,0 +1,57 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<head>
+    <title>Tests that we create a scrolling tree node for a nested overflow-scroll</title>
+    <style>
+        .scroller {
+            overflow: scroll;
+            margin: 20px;
+            height: 300px;
+            width: 300px;
+            border: 2px solid black;
+        }
+        
+        .scroller > .scroller {
+            height: 200px;
+            width: 200px;
+        }
+        
+        .composited {
+            transform: translateZ(0);
+        }
+    
+        .box {
+            margin: 10px;
+            width: 100px;
+            height: 100px;
+            background-color: green;
+        }
+        
+        .spacer {
+            margin: 10px;
+            height: 500px;
+            width: 10px;
+            background-color: silver;
+        }
+    </style>
+    <script>
+        if (window.testRunner)
+            testRunner.dumpAsText();
+
+        window.addEventListener('load', () => {
+            if (window.internals)
+                document.getElementById('tree').innerText = internals.scrollingStateTreeAsText();
+        }, false);
+    </script>
+</head>
+<body>
+    <div class="scroller">
+        <div class="box"></div>
+        <div class="composited scroller">
+            <div class="spacer"></div>
+        </div>
+        <div class="box"></div>
+    </div>
+<pre id="tree"></pre>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (245650 => 245651)


--- trunk/Source/WebCore/ChangeLog	2019-05-22 22:05:19 UTC (rev 245650)
+++ trunk/Source/WebCore/ChangeLog	2019-05-22 22:08:25 UTC (rev 245651)
@@ -1,3 +1,20 @@
+2019-05-22  Simon Fraser  <simon.fra...@apple.com>
+
+        Inner scroller of nested overflow:scrolls jitters when scrolling
+        https://bugs.webkit.org/show_bug.cgi?id=198131
+
+        Reviewed by Antti Koivisto.
+
+        enclosingCompositedScrollingLayer(layer) would return the layer itself, rather than
+        its scrolling ancestor, which meant that a composited scroller nested inside another
+        scroller would fail to get a "Moves" scrolling tree node, and therefore jitter
+        when scrolling.
+
+        Test: scrollingcoordinator/scrolling-tree/nested-overflow-scroll.html
+
+        * rendering/RenderLayerCompositor.cpp:
+        (WebCore::enclosingCompositedScrollingLayer):
+
 2019-05-22  Ryan Haddad  <ryanhad...@apple.com>
 
         Unreviewed, rolling out r245598.

Modified: trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp (245650 => 245651)


--- trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-05-22 22:05:19 UTC (rev 245650)
+++ trunk/Source/WebCore/rendering/RenderLayerCompositor.cpp	2019-05-22 22:08:25 UTC (rev 245651)
@@ -3026,7 +3026,7 @@
 
 static RenderLayer* enclosingCompositedScrollingLayer(const RenderLayer& layer, const RenderLayer& intermediateLayer, bool& sawIntermediateLayer)
 {
-    const auto* currLayer = &layer;
+    const auto* currLayer = layer.parent();
     while (currLayer) {
         if (currLayer == &intermediateLayer)
             sawIntermediateLayer = true;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to