1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:47:44 +00:00

LibWeb: Implement the CSS rule cache optimization for UA style as well

We were already sorting the author style selectors into buckets.
Now we do it for the built-in UA style as well.

This means less work for the selector engine everywhere :^)
This commit is contained in:
Andreas Kling 2023-03-07 20:13:13 +01:00
parent 2042993997
commit 72569bca1c
2 changed files with 64 additions and 57 deletions

View file

@ -114,7 +114,13 @@ private:
HashMap<Selector::PseudoElement, Vector<MatchingRule>> rules_by_pseudo_element;
Vector<MatchingRule> other_rules;
};
OwnPtr<RuleCache> m_rule_cache;
NonnullOwnPtr<RuleCache> make_rule_cache_for_cascade_origin(CascadeOrigin);
RuleCache const& rule_cache_for_cascade_origin(CascadeOrigin) const;
OwnPtr<RuleCache> m_author_rule_cache;
OwnPtr<RuleCache> m_user_agent_rule_cache;
class FontLoader;
HashMap<String, NonnullOwnPtr<FontLoader>> m_loaded_fonts;