LibWeb: Cache the qualified layer name in CSSRule

This makes cascade layer filtering take <2% of CPU time when loading
https://vercel.com instead of 30%.
This commit is contained in:
Andreas Kling 2024-09-07 11:45:50 +02:00 committed by Andreas Kling
commit 44e4ea3d7a
Notes: github-actions[bot] 2024-09-07 11:24:51 +00:00
4 changed files with 33 additions and 31 deletions

View file

@ -58,10 +58,12 @@ protected:
virtual void visit_edges(Cell::Visitor&) override;
String parent_layer_internal_qualified_name() const;
FlyString const& parent_layer_internal_qualified_name() const;
JS::GCPtr<CSSRule> m_parent_rule;
JS::GCPtr<CSSStyleSheet> m_parent_style_sheet;
mutable Optional<FlyString> m_cached_layer_name;
};
}