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
30 changed files with 23 additions and 42 deletions

View File

@@ -20,7 +20,7 @@ JS::NonnullGCPtr<CSSKeyframesRule> CSSKeyframesRule::create(JS::Realm& realm, Fl
}
CSSKeyframesRule::CSSKeyframesRule(JS::Realm& realm, FlyString name, JS::NonnullGCPtr<CSSRuleList> keyframes)
: CSSRule(realm)
: CSSRule(realm, Type::Keyframes)
, m_name(move(name))
, m_rules(move(keyframes))
{