Overflow scroll that becomes non-scrollable should stop being composited
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 May 2019 23:17:17 +0000 (23:17 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 11 May 2019 23:17:17 +0000 (23:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197817
<rdar://problem/50697290>

Reviewed by Antti Koivisto.

Source/WebCore:

Remove the iOS-specific #ifdef around code that triggers a compositing re-evaluation
when scrolling state changes.

Test: compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html

* rendering/RenderLayer.cpp:
(WebCore::RenderLayer::updateScrollInfoAfterLayout):

LayoutTests:

Put in a compositing/scrolling/async-overflow-scrolling dir so we can enable it only
for platforms that have async overflow scrolling.

* TestExpectations:
* compositing/scrolling/async-overflow-scrolling/become-non-scrollable-expected.txt: Added.
* compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html: Added.
* platform/ios-wk2/TestExpectations:
* platform/mac-wk2/TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245212 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/TestExpectations
LayoutTests/compositing/scrolling/async-overflow-scrolling/become-non-scrollable-expected.txt [new file with mode: 0644]
LayoutTests/compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html [new file with mode: 0644]
LayoutTests/platform/ios-wk2/TestExpectations
LayoutTests/platform/mac-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/RenderLayer.cpp

index 5888a1f..1885fbe 100644 (file)
@@ -1,3 +1,20 @@
+2019-05-11  Simon Fraser  <simon.fraser@apple.com>
+
+        Overflow scroll that becomes non-scrollable should stop being composited
+        https://bugs.webkit.org/show_bug.cgi?id=197817
+        <rdar://problem/50697290>
+
+        Reviewed by Antti Koivisto.
+
+        Put in a compositing/scrolling/async-overflow-scrolling dir so we can enable it only
+        for platforms that have async overflow scrolling.
+
+        * TestExpectations:
+        * compositing/scrolling/async-overflow-scrolling/become-non-scrollable-expected.txt: Added.
+        * compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html: Added.
+        * platform/ios-wk2/TestExpectations:
+        * platform/mac-wk2/TestExpectations:
+
 2019-05-11  Alexey Proskuryakov  <ap@apple.com>
 
         Cleaning up results for legacy-animation-engine tests
index 5650727..18521e1 100644 (file)
@@ -61,6 +61,7 @@ fast/media/ios [ Skip ]
 
 # Requires async overflow scrolling
 compositing/shared-backing/overflow-scroll [ Skip ]
+compositing/scrolling/async-overflow-scrolling [ Skip ]
 
 # WebKit2 only.
 printing/printing-events.html [ Skip ]
diff --git a/LayoutTests/compositing/scrolling/async-overflow-scrolling/become-non-scrollable-expected.txt b/LayoutTests/compositing/scrolling/async-overflow-scrolling/become-non-scrollable-expected.txt
new file mode 100644 (file)
index 0000000..cf04ad6
--- /dev/null
@@ -0,0 +1,3 @@
+There should be no layers.
+
+
diff --git a/LayoutTests/compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html b/LayoutTests/compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html
new file mode 100644 (file)
index 0000000..a5ab81e
--- /dev/null
@@ -0,0 +1,51 @@
+<!DOCTYPE html> <!-- webkit-test-runner [ internal:AsyncOverflowScrollingEnabled=true ] -->
+<html>
+<head>
+    <title>Tests an overflow scroll stops compositing if its content shrinks</title>
+    <style>
+        .scrollable {
+            overflow-y: scroll;
+            height: 300px;
+            width: 300px;
+            margin: 10px;
+            border: 1px solid black;
+        }
+    
+        .contents {
+            height: 500px;
+            width: 20px;
+            background-color: silver;
+        }
+        
+        .contents.changed {
+            height: 100px;
+        }
+    </style>
+    <script>
+        if (window.testRunner) {
+            testRunner.dumpAsText();
+            testRunner.waitUntilDone();
+        }
+
+        window.addEventListener('load', () => {
+            setTimeout(() => {
+                document.querySelector('.contents').classList.add('changed');
+
+                if (window.internals)
+                    document.getElementById('layers').innerText = window.internals.layerTreeAsText(document);
+
+                if (window.testRunner)
+                    testRunner.notifyDone();
+            }, 0);
+        }, false);
+    </script>
+</head>
+<body>
+    <div class="scrollable">
+        <div class="contents"></div>
+    </div>
+<p>There should be no layers.</p>
+<pre id="layers"></pre>
+</body>
+</html>
+
index b5383e1..a0f1cb5 100644 (file)
@@ -8,6 +8,7 @@
 
 compositing/ios [ Pass ]
 compositing/shared-backing/overflow-scroll [ Pass ]
+compositing/scrolling/async-overflow-scrolling [ Pass ]
 fast/device-orientation [ Pass ]
 fast/history/ios [ Pass ]
 fast/scrolling/ios [ Pass ]
index 450afa4..392053d 100644 (file)
@@ -6,6 +6,7 @@
 #//////////////////////////////////////////////////////////////////////////////////////////
 
 compositing/shared-backing/overflow-scroll [ Pass ]
+compositing/scrolling/async-overflow-scrolling [ Pass ]
 editing/find [ Pass ]
 editing/undo-manager [ Pass ]
 fast/forms/select/mac-wk2 [ Pass ]
index c7c8dca..626c55f 100644 (file)
@@ -1,5 +1,21 @@
 2019-05-11  Simon Fraser  <simon.fraser@apple.com>
 
+        Overflow scroll that becomes non-scrollable should stop being composited
+        https://bugs.webkit.org/show_bug.cgi?id=197817
+        <rdar://problem/50697290>
+
+        Reviewed by Antti Koivisto.
+
+        Remove the iOS-specific #ifdef around code that triggers a compositing re-evaluation
+        when scrolling state changes.
+
+        Test: compositing/scrolling/async-overflow-scrolling/become-non-scrollable.html
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::RenderLayer::updateScrollInfoAfterLayout):
+
+2019-05-11  Simon Fraser  <simon.fraser@apple.com>
+
         Layer bounds are incorrect for sharing layers that paint with transforms
         https://bugs.webkit.org/show_bug.cgi?id=197768
         <rdar://problem/50695493>
index 185a875..7aa11aa 100644 (file)
@@ -3709,10 +3709,8 @@ void RenderLayer::updateScrollInfoAfterLayout()
         setNeedsCompositingConfigurationUpdate();
     }
 
-#if PLATFORM(IOS_FAMILY)
     if (canUseCompositedScrolling())
         setNeedsPostLayoutCompositingUpdate();
-#endif
 
     updateScrollSnapState();
 }