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

LibWeb: Add fast_is<T> for CSSRule subclasses

Since we already have a type enum for these, let's use it to make
is<T> bypass dynamic_cast for CSS rules.

These were often near the top of random browser profiles.
This commit is contained in:
Andreas Kling 2021-03-18 21:50:52 +01:00
parent a078733865
commit 0d8c9024ee
Notes: sideshowbarker 2024-07-18 21:14:33 +09:00
3 changed files with 9 additions and 0 deletions

View file

@ -59,4 +59,7 @@ private:
NonnullRefPtr<CSSStyleDeclaration> m_declaration;
};
template<>
inline bool CSSRule::fast_is<CSSStyleRule>() const { return type() == CSSRule::Type::Style; }
}