LibWeb: Only create backdrop when originating element is invalidated

This commit is contained in:
Gingeh 2025-04-13 18:58:40 +10:00 committed by Andrew Kaster
commit bbf4f546af
Notes: github-actions[bot] 2025-04-16 15:02:08 +00:00
3 changed files with 42 additions and 0 deletions

View file

@ -570,6 +570,9 @@ void TreeBuilder::update_layout_tree(DOM::Node& dom_node, TreeBuilder::Context&
if (top_layer_element->rendered_in_top_layer()) {
// Each element rendered in the top layer has a ::backdrop pseudo-element, for which it is the originating element.
[&]() {
if (!should_create_layout_node && !top_layer_element->needs_layout_tree_update())
return;
if (top_layer_element->has_inclusive_ancestor_with_display_none())
return;