mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 12:19:54 +00:00
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:
parent
95bd0602ba
commit
44e4ea3d7a
Notes:
github-actions[bot]
2024-09-07 11:24:51 +00:00
Author: https://github.com/awesomekling
Commit: 44e4ea3d7a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1312
Reviewed-by: https://github.com/AtkinsSJ
4 changed files with 33 additions and 31 deletions
|
@ -71,8 +71,7 @@ String CSSLayerBlockRule::serialized() const
|
|||
|
||||
FlyString CSSLayerBlockRule::internal_qualified_name(Badge<StyleComputer>) const
|
||||
{
|
||||
// TODO: Cache this?
|
||||
auto parent_name = parent_layer_internal_qualified_name();
|
||||
auto const& parent_name = parent_layer_internal_qualified_name();
|
||||
if (parent_name.is_empty())
|
||||
return m_name_internal;
|
||||
return MUST(String::formatted("{}.{}", parent_name, m_name_internal));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue