Title: [287683] trunk
- Revision
- 287683
- Author
- [email protected]
- Date
- 2022-01-06 06:33:25 -0800 (Thu, 06 Jan 2022)
Log Message
Ensure that the top layer is always anchored to the RenderView
https://bugs.webkit.org/show_bug.cgi?id=231292
<rdar://problem/83941854>
Reviewed by Simon Fraser.
Source/WebCore:
A fixed positioned block level box is not necessarily anchored to the RenderView (see canContainFixedPositionObjects).
This patch ensures that we skip those ancestors and return the RenderView as the containing block for the top layer content.
https://fullscreen.spec.whatwg.org/#new-stacking-layer
"If the top layer position property computes to fixed, its containing block is the viewport, and the initial containing block otherwise."
* rendering/RenderObject.cpp:
(WebCore::RenderObject::containingBlock const):
(WebCore::containerForElement):
LayoutTests:
* TestExpectations: offsetFromAncestorContainer expects no transformed renderer in-between the
dialog and the RenderView's layer. It will go away with the layer re-parenting work.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (287682 => 287683)
--- trunk/LayoutTests/ChangeLog 2022-01-06 13:41:00 UTC (rev 287682)
+++ trunk/LayoutTests/ChangeLog 2022-01-06 14:33:25 UTC (rev 287683)
@@ -1,3 +1,14 @@
+2022-01-06 Alan Bujtas <[email protected]>
+
+ Ensure that the top layer is always anchored to the RenderView
+ https://bugs.webkit.org/show_bug.cgi?id=231292
+ <rdar://problem/83941854>
+
+ Reviewed by Simon Fraser.
+
+ * TestExpectations: offsetFromAncestorContainer expects no transformed renderer in-between the
+ dialog and the RenderView's layer. It will go away with the layer re-parenting work.
+
2022-01-05 Antoine Quint <[email protected]>
computed style for transition longhand properties is wrong
Modified: trunk/LayoutTests/TestExpectations (287682 => 287683)
--- trunk/LayoutTests/TestExpectations 2022-01-06 13:41:00 UTC (rev 287682)
+++ trunk/LayoutTests/TestExpectations 2022-01-06 14:33:25 UTC (rev 287683)
@@ -2359,7 +2359,8 @@
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 ]
-webkit.org/b/231292 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-parent-transform.html [ ImageOnlyFailure ]
+# Needs layer re-parenting
+webkit.org/b/231292 imported/w3c/web-platform-tests/html/semantics/interactive-elements/the-dialog-element/top-layer-parent-transform.html [ Skip ]
# 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 (287682 => 287683)
--- trunk/Source/WebCore/ChangeLog 2022-01-06 13:41:00 UTC (rev 287682)
+++ trunk/Source/WebCore/ChangeLog 2022-01-06 14:33:25 UTC (rev 287683)
@@ -1,3 +1,21 @@
+2022-01-06 Alan Bujtas <[email protected]>
+
+ Ensure that the top layer is always anchored to the RenderView
+ https://bugs.webkit.org/show_bug.cgi?id=231292
+ <rdar://problem/83941854>
+
+ Reviewed by Simon Fraser.
+
+ A fixed positioned block level box is not necessarily anchored to the RenderView (see canContainFixedPositionObjects).
+ This patch ensures that we skip those ancestors and return the RenderView as the containing block for the top layer content.
+
+ https://fullscreen.spec.whatwg.org/#new-stacking-layer
+ "If the top layer position property computes to fixed, its containing block is the viewport, and the initial containing block otherwise."
+
+ * rendering/RenderObject.cpp:
+ (WebCore::RenderObject::containingBlock const):
+ (WebCore::containerForElement):
+
2022-01-06 Jean-Yves Avenard <[email protected]>
length argument passed to didReceiveData can never be negative.
Modified: trunk/Source/WebCore/rendering/RenderObject.cpp (287682 => 287683)
--- trunk/Source/WebCore/rendering/RenderObject.cpp 2022-01-06 13:41:00 UTC (rev 287682)
+++ trunk/Source/WebCore/rendering/RenderObject.cpp 2022-01-06 14:33:25 UTC (rev 287683)
@@ -658,8 +658,9 @@
RenderBlock* RenderObject::containingBlock() const
{
- auto containingBlockForRenderer = [](const RenderElement& renderer)
- {
+ auto containingBlockForRenderer = [](const auto& renderer) -> RenderBlock* {
+ if (isInTopLayerOrBackdrop(renderer.style(), renderer.element()))
+ return &renderer.view();
if (renderer.isAbsolutelyPositioned())
return renderer.containingBlockForAbsolutePosition();
if (renderer.isFixedPositioned())
@@ -1474,6 +1475,23 @@
// This does mean that computePositionedLogicalWidth and computePositionedLogicalHeight have to use container().
if (!is<RenderElement>(renderer))
return renderer.parent();
+ if (isInTopLayerOrBackdrop(renderer.style(), downcast<RenderElement>(renderer).element())) {
+ auto updateRepaintContainerSkippedFlagIfApplicable = [&] {
+ if (!repaintContainerSkipped)
+ return;
+ *repaintContainerSkipped = false;
+ if (repaintContainer == &renderer.view())
+ return;
+ for (auto& ancestor : ancestorsOfType<RenderElement>(renderer)) {
+ if (repaintContainer == &ancestor) {
+ *repaintContainerSkipped = true;
+ break;
+ }
+ }
+ };
+ updateRepaintContainerSkippedFlagIfApplicable();
+ return &renderer.view();
+ }
auto position = renderer.style().position();
if (position == PositionType::Static || position == PositionType::Relative || position == PositionType::Sticky)
return renderer.parent();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes