Title: [292350] trunk
Revision
292350
Author
mattwood...@apple.com
Date
2022-04-04 15:04:24 -0700 (Mon, 04 Apr 2022)

Log Message

intersectsWithAncestor should take fragmented boxes into account.
https://bugs.webkit.org/show_bug.cgi?id=238648

Reviewed by Dean Jackson.

Source/WebCore:

Test: compositing/backing/backing-store-columns-inside-position-fixed.html

* rendering/RenderLayerBacking.cpp:
(WebCore::intersectsWithAncestor):

Use boundingBox() for intersectsWithAncestor, so that we can explicitly request the box that contains
all fragment boxes.

LayoutTests:

* compositing/backing/backing-store-columns-inside-position-fixed-expected.txt: Added.
* compositing/backing/backing-store-columns-inside-position-fixed.html: Added.

Adds new test that scrolls content split into columns until the first column is offscreen, to confirm
that we still have a backing store.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (292349 => 292350)


--- trunk/LayoutTests/ChangeLog	2022-04-04 22:01:16 UTC (rev 292349)
+++ trunk/LayoutTests/ChangeLog	2022-04-04 22:04:24 UTC (rev 292350)
@@ -1,3 +1,16 @@
+2022-04-04  Matt Woodrow  <mattwood...@apple.com>
+
+        intersectsWithAncestor should take fragmented boxes into account.
+        https://bugs.webkit.org/show_bug.cgi?id=238648
+
+        Reviewed by Dean Jackson.
+
+        * compositing/backing/backing-store-columns-inside-position-fixed-expected.txt: Added.
+        * compositing/backing/backing-store-columns-inside-position-fixed.html: Added.
+
+        Adds new test that scrolls content split into columns until the first column is offscreen, to confirm
+        that we still have a backing store.
+
 2022-04-04  Alan Bujtas  <za...@apple.com>
 
         [CSS-contain] Update select element based test failures.

Added: trunk/LayoutTests/compositing/backing/backing-store-columns-inside-position-fixed-expected.txt (0 => 292350)


--- trunk/LayoutTests/compositing/backing/backing-store-columns-inside-position-fixed-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/compositing/backing/backing-store-columns-inside-position-fixed-expected.txt	2022-04-04 22:04:24 UTC (rev 292350)
@@ -0,0 +1,21 @@
+(GraphicsLayer
+  (anchor 0.00 0.00)
+  (bounds 800.00 600.00)
+  (backingStoreAttached 1)
+  (children 1
+    (GraphicsLayer
+      (bounds 800.00 600.00)
+      (contentsOpaque 1)
+      (backingStoreAttached 1)
+      (children 1
+        (GraphicsLayer
+          (position 8.00 0.00)
+          (bounds 600.00 600.00)
+          (drawsContent 1)
+          (backingStoreAttached 1)
+        )
+      )
+    )
+  )
+)
+

Added: trunk/LayoutTests/compositing/backing/backing-store-columns-inside-position-fixed.html (0 => 292350)


--- trunk/LayoutTests/compositing/backing/backing-store-columns-inside-position-fixed.html	                        (rev 0)
+++ trunk/LayoutTests/compositing/backing/backing-store-columns-inside-position-fixed.html	2022-04-04 22:04:24 UTC (rev 292350)
@@ -0,0 +1,71 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+#out {
+    position: absolute;
+}
+
+.fixed {
+    position: fixed;
+    top: 0px;
+    bottom:0px;
+    overflow-x: scroll;
+}
+.scrolled {
+    column-width: 200px;
+    column-fill: auto;
+    height: 200px;
+    width: 600px;
+}
+.filler {
+    width: 200px;
+    height: 200px;
+    background-color:blue;
+}
+</style>
+<script>
+if (window.testRunner) {
+    testRunner.dumpAsText();
+    testRunner.waitUntilDone();
+}
+
+window._onload_ = function() {
+    if (!window.testRunner)
+        return;
+
+    requestAnimationFrame(() => {
+
+        let scroller = document.getElementById('fixed');
+        scroller.scrollTo(400, 0);
+
+        let uiScript = `(function() {
+            uiController.doAfterNextStablePresentationUpdate(function() {
+                uiController.uiScriptComplete();
+            });
+        })()`
+
+        testRunner.runUIScript(uiScript, () => {
+            let afterLayers = internals.layerTreeAsText(document, internals.LAYER_TREE_INCLUDES_BACKING_STORE_ATTACHED);
+            let out = document.getElementById('out');
+            out.textContent = `${afterLayers}`
+            testRunner.notifyDone();
+        });
+    });
+};
+</script>
+</head>
+<body>
+<pre id="out"></pre>
+
+<div id="fixed" class="fixed">
+    <div class="scrolled">
+        <div class="filler"></div>
+        <div class="filler"></div>
+        <div class="filler"></div>
+        <div class="filler"></div>
+        <div class="filler"></div>
+    </div>
+</div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (292349 => 292350)


--- trunk/Source/WebCore/ChangeLog	2022-04-04 22:01:16 UTC (rev 292349)
+++ trunk/Source/WebCore/ChangeLog	2022-04-04 22:04:24 UTC (rev 292350)
@@ -1,3 +1,18 @@
+2022-04-04  Matt Woodrow  <mattwood...@apple.com>
+
+        intersectsWithAncestor should take fragmented boxes into account.
+        https://bugs.webkit.org/show_bug.cgi?id=238648
+
+        Reviewed by Dean Jackson.
+
+        Test: compositing/backing/backing-store-columns-inside-position-fixed.html
+
+        * rendering/RenderLayerBacking.cpp:
+        (WebCore::intersectsWithAncestor):
+
+        Use boundingBox() for intersectsWithAncestor, so that we can explicitly request the box that contains
+        all fragment boxes.
+
 2022-04-04  Tyler Wilcock  <tyle...@apple.com>
 
         AccessibilityNodeObject::elementRect should use children rects for display:contents AX objects

Modified: trunk/Source/WebCore/rendering/RenderLayerBacking.cpp (292349 => 292350)


--- trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2022-04-04 22:01:16 UTC (rev 292349)
+++ trunk/Source/WebCore/rendering/RenderLayerBacking.cpp	2022-04-04 22:04:24 UTC (rev 292350)
@@ -2810,9 +2810,7 @@
             return std::nullopt;
     }
 
-    auto offset = child.convertToLayerCoords(&ancestor, { }, RenderLayer::AdjustForColumns);
-    auto overlap = child.overlapBounds();
-    overlap.moveBy(offset);
+    auto overlap = child.boundingBox(&ancestor, child.offsetFromAncestor(&ancestor), RenderLayer::UseFragmentBoxesExcludingCompositing);
     return overlap.intersects(ancestorCompositedBounds);
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to