LibWeb: Add direct pointer to CSS::Selector in MatchingRule struct

This avoids looking up the selector by index repeatedly, giving us a
~400ms reduction in load time on https://wpt.fyi/
This commit is contained in:
Andreas Kling 2025-01-25 19:57:11 +01:00 committed by Jelle Raaijmakers
commit e03aedbdf0
Notes: github-actions[bot] 2025-01-26 14:08:36 +00:00
3 changed files with 10 additions and 13 deletions

View file

@ -1652,7 +1652,7 @@ void Document::invalidate_style_for_elements_affected_by_hover_change(Node& old_
if (!rule_is_relevant_for_current_scope)
continue;
auto const& selector = rule.absolutized_selectors()[rule.selector_index];
auto const& selector = rule.selector;
SelectorEngine::MatchContext context;
bool selector_matched = false;