Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 5761cdbb640cbf6968990b75b99602e9cf08a7dc
https://github.com/WebKit/WebKit/commit/5761cdbb640cbf6968990b75b99602e9cf08a7dc
Author: Alan Baradlay <[email protected]>
Date: 2026-03-26 (Thu, 26 Mar 2026)
Changed paths:
A LayoutTests/fast/block/missing-popover-content-expected.txt
A LayoutTests/fast/block/missing-popover-content.html
M Source/WebCore/dom/Element.cpp
M Source/WebCore/rendering/RenderElement.cpp
M Source/WebCore/rendering/RenderElement.h
Log Message:
-----------
Nested children of popover fail to render when position:absolute
https://bugs.webkit.org/show_bug.cgi?id=308657
<rdar://problem/171735933>
Reviewed by Simon Fraser.
When an element with an existing renderer enters the top layer (via
showPopover(),
showModal(), etc.), its containing block changes to RenderView. However, the
renderer
remained in the old containing block's out-of-flow box list. If the old
containing block's
size didn't change, it would perform simplified layout, leaving the top-layer
element and
all its descendants at size 0x0.
This patch introduces RenderElement::establishesTopLayerWillChange() and
establishesTopLayerDidChange() callbacks, called from Element::addToTopLayer()
and removeFromTopLayer(). The willChange callback removes the out-of-flow box
from
its current containing block's list and marks the static-position parent for
layout,
so the box gets re-inserted into RenderView's list during the next layout pass.
Test: fast/block/missing-popover-content.html
* LayoutTests/fast/block/missing-popover-content-expected.txt: Added.
* LayoutTests/fast/block/missing-popover-content.html: Added.
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::addToTopLayer):
(WebCore::Element::removeFromTopLayer):
* Source/WebCore/rendering/RenderElement.cpp:
(WebCore::RenderElement::establishesTopLayerWillChange):
(WebCore::RenderElement::establishesTopLayerDidChange):
* Source/WebCore/rendering/RenderElement.h:
Canonical link: https://commits.webkit.org/310019@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications