mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 20:59:16 +00:00
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:
parent
74f133293d
commit
c56f7d9cde
Notes:
github-actions[bot]
2025-05-07 11:56:29 +00:00
Author: https://github.com/gmta
Commit: c56f7d9cde
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4632
Reviewed-by: https://github.com/kalenikaliaksandr ✅
5 changed files with 52 additions and 7 deletions
|
@ -453,8 +453,8 @@ public:
|
|||
bool affected_by_indirect_sibling_combinator() const { return m_affected_by_indirect_sibling_combinator; }
|
||||
void set_affected_by_indirect_sibling_combinator(bool value) { m_affected_by_indirect_sibling_combinator = value; }
|
||||
|
||||
bool affected_by_first_or_last_child_pseudo_class() const { return m_affected_by_first_or_last_child_pseudo_class; }
|
||||
void set_affected_by_first_or_last_child_pseudo_class(bool value) { m_affected_by_first_or_last_child_pseudo_class = value; }
|
||||
bool affected_by_sibling_position_or_count_pseudo_class() const { return m_affected_by_sibling_position_or_count_pseudo_class; }
|
||||
void set_affected_by_sibling_position_or_count_pseudo_class(bool value) { m_affected_by_sibling_position_or_count_pseudo_class = value; }
|
||||
|
||||
bool affected_by_nth_child_pseudo_class() const { return m_affected_by_nth_child_pseudo_class; }
|
||||
void set_affected_by_nth_child_pseudo_class(bool value) { m_affected_by_nth_child_pseudo_class = value; }
|
||||
|
@ -464,7 +464,7 @@ public:
|
|||
|
||||
bool style_affected_by_structural_changes() const
|
||||
{
|
||||
return affected_by_direct_sibling_combinator() || affected_by_indirect_sibling_combinator() || affected_by_first_or_last_child_pseudo_class() || affected_by_nth_child_pseudo_class();
|
||||
return affected_by_direct_sibling_combinator() || affected_by_indirect_sibling_combinator() || affected_by_sibling_position_or_count_pseudo_class() || affected_by_nth_child_pseudo_class();
|
||||
}
|
||||
|
||||
size_t number_of_owned_list_items() const;
|
||||
|
@ -573,7 +573,7 @@ private:
|
|||
bool m_affected_by_has_pseudo_class_in_non_subject_position : 1 { false };
|
||||
bool m_affected_by_direct_sibling_combinator : 1 { false };
|
||||
bool m_affected_by_indirect_sibling_combinator : 1 { false };
|
||||
bool m_affected_by_first_or_last_child_pseudo_class : 1 { false };
|
||||
bool m_affected_by_sibling_position_or_count_pseudo_class : 1 { false };
|
||||
bool m_affected_by_nth_child_pseudo_class : 1 { false };
|
||||
bool m_affected_by_has_pseudo_class_with_relative_selector_that_has_sibling_combinator : 1 { false };
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue