From ed35f9e7c2b1302cc2ea87db09739f71ce6dc984 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 17 Apr 2025 12:32:19 +0200 Subject: [PATCH] LibWeb: Remove unused MatchingRule::must_be_hovered flag This was a vestige from an earlier version of hover selector work avoidance optimizations. --- Libraries/LibWeb/CSS/StyleComputer.cpp | 20 -------------------- Libraries/LibWeb/CSS/StyleComputer.h | 1 - 2 files changed, 21 deletions(-) diff --git a/Libraries/LibWeb/CSS/StyleComputer.cpp b/Libraries/LibWeb/CSS/StyleComputer.cpp index ab549353406..39e4bbf5c3e 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.cpp +++ b/Libraries/LibWeb/CSS/StyleComputer.cpp @@ -2809,7 +2809,6 @@ void StyleComputer::make_rule_cache_for_cascade_origin(CascadeOrigin cascade_ori selector.specificity(), cascade_origin, false, - false, }; auto const& qualified_layer_name = matching_rule.qualified_layer_name(); @@ -2833,25 +2832,6 @@ void StyleComputer::make_rule_cache_for_cascade_origin(CascadeOrigin cascade_ori contains_root_pseudo_class = true; } } - - if (!matching_rule.must_be_hovered) { - if (simple_selector.type == CSS::Selector::SimpleSelector::Type::PseudoClass && simple_selector.pseudo_class().type == CSS::PseudoClass::Hover) { - matching_rule.must_be_hovered = true; - } - if (simple_selector.type == CSS::Selector::SimpleSelector::Type::PseudoClass - && (simple_selector.pseudo_class().type == CSS::PseudoClass::Is - || simple_selector.pseudo_class().type == CSS::PseudoClass::Where)) { - auto const& argument_selectors = simple_selector.pseudo_class().argument_selector_list; - - if (argument_selectors.size() == 1) { - auto const& simple_argument_selector = argument_selectors.first()->compound_selectors().last().simple_selectors.last(); - if (simple_argument_selector.type == CSS::Selector::SimpleSelector::Type::PseudoClass - && simple_argument_selector.pseudo_class().type == CSS::PseudoClass::Hover) { - matching_rule.must_be_hovered = true; - } - } - } - } } if (selector.contains_hover_pseudo_class()) { diff --git a/Libraries/LibWeb/CSS/StyleComputer.h b/Libraries/LibWeb/CSS/StyleComputer.h index 3859ffdda27..cf6d7feb479 100644 --- a/Libraries/LibWeb/CSS/StyleComputer.h +++ b/Libraries/LibWeb/CSS/StyleComputer.h @@ -86,7 +86,6 @@ struct MatchingRule { u32 specificity { 0 }; CascadeOrigin cascade_origin; bool contains_pseudo_element { false }; - bool must_be_hovered { false }; // Helpers to deal with the fact that `rule` might be a CSSStyleRule or a CSSNestedDeclarations CSSStyleProperties const& declaration() const;