1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-11 18:20:43 +09:00

LibWeb: Make CSSRule::type() non-virtual

All its overrides return constants, and without virtual dispatch the
`qualified_layer_name` and `absolutized_selectors` functions can benefit
from slightly better optimizations.

`CSSRule`s aren't allocated that often, so the memory impact is minimal.
This commit is contained in:
Jonne Ransijn 2024-10-28 20:16:28 +01:00 committed by Andreas Kling
parent 2f41be733f
commit 5c1bbd3eff
Notes: github-actions[bot] 2024-10-28 21:56:20 +00:00
30 changed files with 23 additions and 42 deletions

View file

@ -25,7 +25,7 @@ FlyString CSSLayerBlockRule::next_unique_anonymous_layer_name()
}
CSSLayerBlockRule::CSSLayerBlockRule(JS::Realm& realm, FlyString name, CSSRuleList& rules)
: CSSGroupingRule(realm, rules)
: CSSGroupingRule(realm, rules, Type::LayerBlock)
, m_name(move(name))
{
if (m_name.is_empty()) {