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

LibWeb: Add a rule-cache for PseudoElements

This works a little differently from the other caches - ALL rules
containing a pseudo-element are in this bucket. This lets us only look
at this bucket when finding styles for a pseudo-element, and ignore it
if we're not.
This commit is contained in:
Sam Atkins 2022-02-25 17:50:06 +00:00 committed by Andreas Kling
parent 817cd13d59
commit f3cda3c830
2 changed files with 45 additions and 28 deletions

View file

@ -100,6 +100,7 @@ private:
HashMap<FlyString, Vector<MatchingRule>> rules_by_id;
HashMap<FlyString, Vector<MatchingRule>> rules_by_class;
HashMap<FlyString, Vector<MatchingRule>> rules_by_tag_name;
HashMap<Selector::PseudoElement, Vector<MatchingRule>> rules_by_pseudo_element;
Vector<MatchingRule> other_rules;
int generation { 0 };
};