1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 16:18:12 +00:00

LibWeb: Add "ID" buckets to StyleComputer::RuleCache

We can skip rules that require a specific ID when matching against any
element that doesn't have that ID.
This commit is contained in:
Andreas Kling 2022-02-10 18:50:58 +01:00
parent 646b37d1a9
commit 031296cf7b
2 changed files with 14 additions and 1 deletions

View file

@ -96,6 +96,7 @@ private:
DOM::Document& m_document;
struct RuleCache {
HashMap<FlyString, Vector<MatchingRule>> rules_by_id;
HashMap<FlyString, Vector<MatchingRule>> rules_by_class;
Vector<MatchingRule> other_rules;
int generation { 0 };