Title: [287845] trunk
Revision
287845
Author
[email protected]
Date
2022-01-10 10:50:39 -0800 (Mon, 10 Jan 2022)

Log Message

REGRESSION(r287683): <dialog> elements inside clipped/overflowed elements are no longer shown
https://bugs.webkit.org/show_bug.cgi?id=234984

Reviewed by Simon Fraser.

Source/WebCore:

Paint at the right place by fixing isContainerForPositioned, also fix clip rects.

* rendering/RenderLayer.cpp:
(WebCore::isContainerForPositioned):
(WebCore::RenderLayer::enclosingAncestorForPosition const):
(WebCore::accumulateOffsetTowardsAncestor):
(WebCore::RenderLayer::calculateClipRects const):

LayoutTests:

Enable relevant tests. Set the asserting test as Crash instead of Skipping.

* TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (287844 => 287845)


--- trunk/LayoutTests/ChangeLog	2022-01-10 18:41:26 UTC (rev 287844)
+++ trunk/LayoutTests/ChangeLog	2022-01-10 18:50:39 UTC (rev 287845)
@@ -1,3 +1,14 @@
+2022-01-10  Tim Nguyen  <[email protected]>
+
+        REGRESSION(r287683): <dialog> elements inside clipped/overflowed elements are no longer shown
+        https://bugs.webkit.org/show_bug.cgi?id=234984
+
+        Reviewed by Simon Fraser.
+
+        Enable relevant tests. Set the asserting test as Crash instead of Skipping.
+
+        * TestExpectations:
+
 2022-01-10  Simon Fraser  <[email protected]>
 
         REGRESSION (r287431): [Big Sur WK1] fast/scrolling/latching/iframe-latch-small-deltas.html is consistently failing

Modified: trunk/LayoutTests/TestExpectations (287844 => 287845)


--- trunk/LayoutTests/TestExpectations	2022-01-10 18:41:26 UTC (rev 287844)
+++ trunk/LayoutTests/TestExpectations	2022-01-10 18:50:39 UTC (rev 287845)
@@ -2358,12 +2358,8 @@
 # Top layer tests
 webkit.org/b/229315 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-in-replaced-renderer.html [ ImageOnlyFailure ]
 webkit.org/b/229315 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/modal-dialog-in-table-column.html [ ImageOnlyFailure ]
-webkit.org/b/231292 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-containing-block.html [ ImageOnlyFailure ]
-webkit.org/b/231292 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-stacking.html [ ImageOnlyFailure ]
-webkit.org/b/231292 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-parent-overflow-clip.html [ ImageOnlyFailure ]
-webkit.org/b/231292 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-parent-overflow-scroll.html [ ImageOnlyFailure ]
 # Needs layer re-parenting
-webkit.org/b/231292 [ Debug ] imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-parent-transform.html [ Skip ]
+webkit.org/b/234980 [ Debug ] imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-parent-transform.html [ Crash ]
 
 # Assertion failure in MessagePort::contextDestroyed, usually attributed to later tests
 webkit.org/b/94458 http/tests/security/MessagePort/event-listener-context.html [ Skip ]

Modified: trunk/Source/WebCore/ChangeLog (287844 => 287845)


--- trunk/Source/WebCore/ChangeLog	2022-01-10 18:41:26 UTC (rev 287844)
+++ trunk/Source/WebCore/ChangeLog	2022-01-10 18:50:39 UTC (rev 287845)
@@ -1,3 +1,18 @@
+2022-01-10  Tim Nguyen  <[email protected]>
+
+        REGRESSION(r287683): <dialog> elements inside clipped/overflowed elements are no longer shown
+        https://bugs.webkit.org/show_bug.cgi?id=234984
+
+        Reviewed by Simon Fraser.
+
+        Paint at the right place by fixing isContainerForPositioned, also fix clip rects.
+
+        * rendering/RenderLayer.cpp:
+        (WebCore::isContainerForPositioned):
+        (WebCore::RenderLayer::enclosingAncestorForPosition const):
+        (WebCore::accumulateOffsetTowardsAncestor):
+        (WebCore::RenderLayer::calculateClipRects const):
+
 2022-01-10  Sam Weinig  <[email protected]>
 
         [CSS Color 4] CSS color() function should not clamp channels to the 0-1 range

Modified: trunk/Source/WebCore/rendering/RenderLayer.cpp (287844 => 287845)


--- trunk/Source/WebCore/rendering/RenderLayer.cpp	2022-01-10 18:41:26 UTC (rev 287844)
+++ trunk/Source/WebCore/rendering/RenderLayer.cpp	2022-01-10 18:50:39 UTC (rev 287845)
@@ -1777,8 +1777,11 @@
     return floatPointForLengthPoint(renderer().style().perspectiveOrigin(), borderBox.size());
 }
 
-static inline bool isContainerForPositioned(RenderLayer& layer, PositionType position)
+static inline bool isContainerForPositioned(RenderLayer& layer, PositionType position, bool establishesTopLayer)
 {
+    if (establishesTopLayer)
+        return layer.isRenderViewLayer();
+
     switch (position) {
     case PositionType::Fixed:
         return layer.renderer().canContainFixedPositionObjects();
@@ -1815,7 +1818,7 @@
         return renderer().view().layer();
 
     RenderLayer* curr = parent();
-    while (curr && !isContainerForPositioned(*curr, position))
+    while (curr && !isContainerForPositioned(*curr, position, establishesTopLayer()))
         curr = curr->parent();
 
     return curr;
@@ -2292,7 +2295,7 @@
             if (currLayer == ancestorLayer)
                 foundAncestor = true;
 
-            if (isContainerForPositioned(*currLayer, PositionType::Fixed)) {
+            if (isContainerForPositioned(*currLayer, PositionType::Fixed, layer->establishesTopLayer())) {
                 fixedPositionContainerLayer = currLayer;
                 ASSERT_UNUSED(foundAncestor, foundAncestor);
                 break;
@@ -2331,7 +2334,7 @@
             // RenderFragmentedFlow is a positioned container, child of RenderView, positioned at (0,0).
             // This implies that, for out-of-flow positioned elements inside a RenderFragmentedFlow,
             // we are bailing out before reaching root layer.
-            if (isContainerForPositioned(*parentLayer, position))
+            if (isContainerForPositioned(*parentLayer, position, layer->establishesTopLayer()))
                 break;
 
             if (parentLayer == ancestorLayer) {
@@ -4541,11 +4544,12 @@
 
 Ref<ClipRects> RenderLayer::parentClipRects(const ClipRectsContext& clipRectsContext) const
 {
-    ASSERT(parent());
+    ASSERT(parent() || establishesTopLayer());
 
+    auto containerLayer = establishesTopLayer() ? renderer().view().layer() : parent();
     auto temporaryParentClipRects = [&](const ClipRectsContext& clipContext) {
         auto parentClipRects = ClipRects::create();
-        parent()->calculateClipRects(clipContext, parentClipRects);
+        containerLayer->calculateClipRects(clipContext, parentClipRects);
         return parentClipRects;
     };
 
@@ -4558,7 +4562,7 @@
         return temporaryParentClipRects(tempClipRectsContext);
     }
 
-    return parent()->updateClipRects(clipRectsContext);
+    return containerLayer->updateClipRects(clipRectsContext);
 }
 
 static inline ClipRect backgroundClipRectForPosition(const ClipRects& parentRects, PositionType position)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to