LibWeb: Invalidate sibling style for :only-child and :*-of-type

After f7a3f785a8, sibling nodes' styles
were no longer invalidated after a node was removed. This reuses the
flag for `:first-child` and `:last-child` to indicate that a node's
style might be affected by any structural change in its siblings.

Fixes #4631.

Resolves the `:only-child` ACID3 failure as documented in #1231.
This commit is contained in:
Jelle Raaijmakers 2025-05-07 12:27:42 +02:00 committed by Alexander Kalenik
commit c56f7d9cde
Notes: github-actions[bot] 2025-05-07 11:56:29 +00:00
5 changed files with 52 additions and 7 deletions

View file

@ -620,7 +620,7 @@ CSS::RequiredInvalidationAfterStyleChange Element::recompute_style()
m_affected_by_has_pseudo_class_with_relative_selector_that_has_sibling_combinator = false;
m_affected_by_direct_sibling_combinator = false;
m_affected_by_indirect_sibling_combinator = false;
m_affected_by_first_or_last_child_pseudo_class = false;
m_affected_by_sibling_position_or_count_pseudo_class = false;
m_affected_by_nth_child_pseudo_class = false;
m_sibling_invalidation_distance = 0;