diff --git a/Libraries/LibWeb/Layout/TreeBuilder.cpp b/Libraries/LibWeb/Layout/TreeBuilder.cpp index a91f6f43a74..04eeafde4d7 100644 --- a/Libraries/LibWeb/Layout/TreeBuilder.cpp +++ b/Libraries/LibWeb/Layout/TreeBuilder.cpp @@ -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; diff --git a/Tests/LibWeb/Layout/expected/layout-tree-update/dialog-backdrop-update.txt b/Tests/LibWeb/Layout/expected/layout-tree-update/dialog-backdrop-update.txt new file mode 100644 index 00000000000..0d8d58ad42b --- /dev/null +++ b/Tests/LibWeb/Layout/expected/layout-tree-update/dialog-backdrop-update.txt @@ -0,0 +1,26 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x16 [BFC] children: not-inline + BlockContainer
at (8,8) content-size 784x0 children: inline + TextNode <#text> + TextNode <#text> + TextNode <#text> + BlockContainer <(anonymous)> at (0,0) content-size 800x600 positioned [BFC] children: not-inline + BlockContainer