LibWeb: Delete "names used in attribute selectors" from SelectorInsights

These are no longer needed because it's possible to tell if attribute
name is used in any selector by using invalidation sets.
This commit is contained in:
Aliaksandr Kalenik 2025-01-19 20:28:03 +01:00 committed by Andreas Kling
parent e0051db62e
commit 3b81d9d91d
Notes: github-actions[bot] 2025-01-20 17:24:31 +00:00
2 changed files with 0 additions and 14 deletions

View file

@ -2578,9 +2578,6 @@ void StyleComputer::collect_selector_insights(Selector const& selector, Selector
{ {
for (auto const& compound_selector : selector.compound_selectors()) { for (auto const& compound_selector : selector.compound_selectors()) {
for (auto const& simple_selector : compound_selector.simple_selectors) { for (auto const& simple_selector : compound_selector.simple_selectors) {
if (simple_selector.type == Selector::SimpleSelector::Type::Attribute) {
insights.all_names_used_in_attribute_selectors.set(simple_selector.attribute().qualified_name.name.lowercase_name);
}
if (simple_selector.type == Selector::SimpleSelector::Type::PseudoClass) { if (simple_selector.type == Selector::SimpleSelector::Type::PseudoClass) {
if (simple_selector.pseudo_class().type == PseudoClass::Has) { if (simple_selector.pseudo_class().type == PseudoClass::Has) {
insights.has_has_selectors = true; insights.has_has_selectors = true;
@ -3105,13 +3102,4 @@ bool StyleComputer::has_defined_selectors() const
return m_selector_insights->has_defined_selectors; return m_selector_insights->has_defined_selectors;
} }
bool StyleComputer::has_attribute_selector(FlyString const& attribute_name) const
{
if (!document().is_active())
return false;
build_rule_cache_if_needed();
return m_selector_insights->all_names_used_in_attribute_selectors.contains(attribute_name);
}
} }

View file

@ -178,7 +178,6 @@ public:
[[nodiscard]] bool has_has_selectors() const; [[nodiscard]] bool has_has_selectors() const;
[[nodiscard]] bool has_defined_selectors() const; [[nodiscard]] bool has_defined_selectors() const;
[[nodiscard]] bool has_attribute_selector(FlyString const& attribute_name) const;
size_t number_of_css_font_faces_with_loading_in_progress() const; size_t number_of_css_font_faces_with_loading_in_progress() const;
@ -259,7 +258,6 @@ private:
struct SelectorInsights { struct SelectorInsights {
bool has_has_selectors { false }; bool has_has_selectors { false };
bool has_defined_selectors { false }; bool has_defined_selectors { false };
HashTable<FlyString> all_names_used_in_attribute_selectors;
}; };
struct RuleCache { struct RuleCache {