Title: [289443] trunk
Revision
289443
Author
[email protected]
Date
2022-02-08 15:49:27 -0800 (Tue, 08 Feb 2022)

Log Message

REGRESSION (15.4): Angular virtual scrollers no longer work (because of contain:strict)
https://bugs.webkit.org/show_bug.cgi?id=236260

Patch by Rob Buis <[email protected]> on 2022-02-08
Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

* web-platform-tests/css/css-contain/contain-paint-049-expected.txt: Added.
* web-platform-tests/css/css-contain/contain-paint-049.html: Added.

Source/WebCore:

Paint containment did not allow collecting scrollable overflow, breaking scrolling
of the container contents, this patch fixes that.

Test: imported/w3c/web-platform-tests/css/css-contain/contain-paint-049.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::addOverflowFromChild):

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/imported/w3c/ChangeLog (289442 => 289443)


--- trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-08 23:30:05 UTC (rev 289442)
+++ trunk/LayoutTests/imported/w3c/ChangeLog	2022-02-08 23:49:27 UTC (rev 289443)
@@ -1,3 +1,13 @@
+2022-02-08  Rob Buis  <[email protected]>
+
+        REGRESSION (15.4): Angular virtual scrollers no longer work (because of contain:strict)
+        https://bugs.webkit.org/show_bug.cgi?id=236260
+
+        Reviewed by Simon Fraser.
+
+        * web-platform-tests/css/css-contain/contain-paint-049-expected.txt: Added.
+        * web-platform-tests/css/css-contain/contain-paint-049.html: Added.
+
 2022-02-08  Antoine Quint  <[email protected]>
 
         [css-logical] [css-animations] changing "direction" or "writing-mode" should recompute keyframes

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-paint-049-expected.txt (0 => 289443)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-paint-049-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-paint-049-expected.txt	2022-02-08 23:49:27 UTC (rev 289443)
@@ -0,0 +1,3 @@
+
+PASS Scrolling overflow works when paint is contained
+

Added: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-paint-049.html (0 => 289443)


--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-paint-049.html	                        (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-contain/contain-paint-049.html	2022-02-08 23:49:27 UTC (rev 289443)
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<meta charset="utf8">
+<title>CSS Containment Test: Scrolling overflow works when paint is contained"</title>
+<link rel="help" href=""
+<meta name="assert" content="Scrolling overflow works when paint is contained.">
+
+<script src=""
+<script src=""
+
+<style>
+#container {
+  width: 100px;
+  height: 100px;
+  overflow: auto;
+  contain: paint;
+}
+.content {
+  position: absolute;
+  height: 500%;
+  width: 100%;
+}
+</style>
+
+<div id="container">
+  <div class="content">
+  </div>
+</div>
+
+<script>
+  test(() => {
+    container.scrollTo(0, 100);
+    assert_equals(container.scrollTop, 100);
+  }, "Scrolling overflow works when paint is contained");
+</script>

Modified: trunk/Source/WebCore/ChangeLog (289442 => 289443)


--- trunk/Source/WebCore/ChangeLog	2022-02-08 23:30:05 UTC (rev 289442)
+++ trunk/Source/WebCore/ChangeLog	2022-02-08 23:49:27 UTC (rev 289443)
@@ -1,3 +1,18 @@
+2022-02-08  Rob Buis  <[email protected]>
+
+        REGRESSION (15.4): Angular virtual scrollers no longer work (because of contain:strict)
+        https://bugs.webkit.org/show_bug.cgi?id=236260
+
+        Reviewed by Simon Fraser.
+
+        Paint containment did not allow collecting scrollable overflow, breaking scrolling
+        of the container contents, this patch fixes that.
+
+        Test: imported/w3c/web-platform-tests/css/css-contain/contain-paint-049.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::addOverflowFromChild):
+
 2022-02-08  Brandon Stewart  <[email protected]>
 
         Grid may be empty in certain scenarios

Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (289442 => 289443)


--- trunk/Source/WebCore/rendering/RenderBox.cpp	2022-02-08 23:30:05 UTC (rev 289442)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp	2022-02-08 23:49:27 UTC (rev 289443)
@@ -4986,8 +4986,6 @@
 
 void RenderBox::addOverflowFromChild(const RenderBox* child, const LayoutSize& delta)
 {
-    if (paintContainmentApplies())
-        return;
     // Never allow flow threads to propagate overflow up to a parent.
     if (child->isRenderFragmentedFlow())
         return;
@@ -5003,6 +5001,9 @@
     childLayoutOverflowRect.move(delta);
     addLayoutOverflow(childLayoutOverflowRect);
 
+    if (paintContainmentApplies())
+        return;
+
     // Add in visual overflow from the child.  Even if the child clips its overflow, it may still
     // have visual overflow of its own set from box shadows or reflections. It is unnecessary to propagate this
     // overflow if we are clipping our own overflow.
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to