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

@ -42,10 +42,9 @@ String CSSLayerStatementRule::serialized() const
Vector<FlyString> CSSLayerStatementRule::internal_qualified_name_list(Badge<StyleComputer>) const
{
// TODO: Cache these?
Vector<FlyString> qualified_layer_names;
auto qualified_parent_layer_name = parent_layer_internal_qualified_name();
auto const& qualified_parent_layer_name = parent_layer_internal_qualified_name();
if (qualified_parent_layer_name.is_empty())
return m_name_list;