1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:37:46 +00:00

LibWeb: Add "tag name" buckets to StyleComputer::RuleCache

We can skip rules that require a specific tag name when matching against
any element with a different tag name. :^)
This commit is contained in:
Andreas Kling 2022-02-10 18:59:19 +01:00
parent 031296cf7b
commit b68c51379e
2 changed files with 12 additions and 1 deletions

View file

@ -98,6 +98,7 @@ private:
struct RuleCache {
HashMap<FlyString, Vector<MatchingRule>> rules_by_id;
HashMap<FlyString, Vector<MatchingRule>> rules_by_class;
HashMap<FlyString, Vector<MatchingRule>> rules_by_tag_name;
Vector<MatchingRule> other_rules;
int generation { 0 };
};