mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-24 08:59:50 +00:00
LibWeb: Invalidate layout tree after removing element from top layer
Otherwise the layout tree will still contain the top layer element(s). Fixes Steam Events & Announcements `<dialog>` modal visually not fully disappearing upon removal.
This commit is contained in:
parent
34857ba554
commit
11a1e97e40
Notes:
github-actions[bot]
2025-10-19 14:59:53 +00:00
Author: https://github.com/Lubrsi
Commit: 11a1e97e40
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6501
Reviewed-by: https://github.com/kalenikaliaksandr ✅
4 changed files with 31 additions and 0 deletions
|
|
@ -6177,6 +6177,8 @@ void Document::remove_an_element_from_the_top_layer_immediately(GC::Ref<Element>
|
|||
// FIXME: 3. Remove the UA !important overlay: auto rule targeting el, if it exists.
|
||||
element->set_rendered_in_top_layer(false);
|
||||
element->set_needs_style_update(true);
|
||||
|
||||
invalidate_layout_tree(InvalidateLayoutTreeReason::DocumentImmediatelyRemoveElementFromTheTopLayer);
|
||||
}
|
||||
|
||||
// https://drafts.csswg.org/css-position-4/#process-top-layer-removals
|
||||
|
|
@ -6196,6 +6198,9 @@ void Document::process_top_layer_removals()
|
|||
m_top_layer_elements.remove(element);
|
||||
m_top_layer_pending_removals.remove(element);
|
||||
}
|
||||
|
||||
if (!elements_to_remove.is_empty())
|
||||
invalidate_layout_tree(InvalidateLayoutTreeReason::DocumentPendingTopLayerRemovalsProcessed);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/popover.html#topmost-auto-popover
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue