LibWeb: Invalidate whole document style on attr change if :has() present
This sucks, and we're gonna have to do better, but for now let's invalidate the whole document's style, so that we get correct behavior if there are :has() selectors present.
This commit is contained in:
parent
690d9c8752
commit
f24b91b01e
Notes:
github-actions[bot]
2024-10-27 12:34:57 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/f24b91b01e1 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1997
1 changed files with 4 additions and 2 deletions
|
@ -1930,8 +1930,10 @@ void Element::invalidate_style_after_attribute_change(FlyString const& attribute
|
|||
// FIXME: Only invalidate if the attribute can actually affect style.
|
||||
(void)attribute_name;
|
||||
|
||||
// FIXME: This will need to become smarter when we implement the :has() selector.
|
||||
invalidate_style(StyleInvalidationReason::ElementAttributeChange);
|
||||
if (document().style_computer().has_has_selectors())
|
||||
document().invalidate_style(StyleInvalidationReason::ElementAttributeChange);
|
||||
else
|
||||
invalidate_style(StyleInvalidationReason::ElementAttributeChange);
|
||||
}
|
||||
|
||||
// https://www.w3.org/TR/wai-aria-1.2/#tree_exclusion
|
||||
|
|
Loading…
Add table
Reference in a new issue