From aaff6f98b1bb0e437e78615951b2b8a5bf5e592d Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sat, 25 Jan 2025 19:53:57 +0100 Subject: [PATCH] LibWeb: Fix collection of pseudo class names used in :has() Before this change we were saving all pseudo class names as used in :has() regardless of whether they are nested inside :has() or not. --- Libraries/LibWeb/CSS/StyleInvalidationData.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Libraries/LibWeb/CSS/StyleInvalidationData.cpp b/Libraries/LibWeb/CSS/StyleInvalidationData.cpp index 9a5326d32dd..c54b99afa00 100644 --- a/Libraries/LibWeb/CSS/StyleInvalidationData.cpp +++ b/Libraries/LibWeb/CSS/StyleInvalidationData.cpp @@ -71,7 +71,8 @@ static void collect_properties_used_in_has(Selector::SimpleSelector const& selec case PseudoClass::Disabled: case PseudoClass::PlaceholderShown: case PseudoClass::Checked: - style_invalidation_data.pseudo_classes_used_in_has_selectors.set(pseudo_class.type); + if (in_has) + style_invalidation_data.pseudo_classes_used_in_has_selectors.set(pseudo_class.type); break; default: break;