ladybird/Tests/LibWeb/Layout/input/layout-tree-update
Sam Atkins b6207201d6 LibWeb/Layout: Replace existing ::backdrop layout nodes when necessary
We had two issues with ::backdrop which this commit fixes:

::backdrop is unique in that it's the previous sibling to its
originating element, instead of a child of it. This means when that
element's layout node is thrown away, the ::backdrop's is not.

A second issue is that if we do a partial layout rebuild, the
originating element's layout node replaces its previous one, but we
would still append a new layout node for ::backdrop to the root, so it
would appear in front of the originating element.

A related issue is that clear_pseudo_element_nodes() got called on the
element after its ::backdrop had been assigned, so it would immediately
lose track of it again.

To solve this, we now always remove the ::backdrop's layout node. If we
need to create a new one, we insert it before the element's layout node
if it has one, otherwise we append as before. This ensures we only ever
have up to one layout node for the ::backdrop, and it appears behind
its originating element.

To support this, create_pseudo_element_if_needed() has a couple of
changes:
- It returns the node that was created.
- The caller can ask it not to insert the node, so that the caller can
  do so (which we use so that we can insert it in a specific place)
2026-01-22 13:52:31 +00:00
..
change-position-for-child-of-display-contents.html LibWeb: Propagate layout tree update in display: contents to parent 2025-11-08 11:20:32 +01:00
dialog-backdrop-update.html LibWeb: Only create backdrop when originating element is invalidated 2025-04-16 09:01:08 -06:00
dialog-removal.html LibWeb: Invalidate layout tree after removing element from top layer 2025-10-19 16:58:47 +02:00
inline-element-position-change.html LibWeb: Invalidate layout tree at nearest non-anonymous ancestor 2025-06-04 00:43:23 +02:00
maintain-single-backdrop-pseudo-element.html LibWeb/Layout: Replace existing ::backdrop layout nodes when necessary 2026-01-22 13:52:31 +00:00
simple-update-inside-svg-subtree.html LibWeb: Do not render SVG <symbol> elements unless part of <use> 2025-11-27 07:55:29 +01:00