1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:28:12 +00:00

LibWeb: Add fast_is<T>() for SVGUseElement

is<SVGUseElement> quite hot in profiles
This commit is contained in:
Aliaksandr Kalenik 2023-06-23 02:15:03 +03:00 committed by Andreas Kling
parent 80a228383b
commit 04a5196a5d
2 changed files with 10 additions and 0 deletions

View file

@ -40,6 +40,8 @@ private:
virtual JS::ThrowCompletionOr<void> initialize(JS::Realm&) override;
virtual void visit_edges(Cell::Visitor&) override;
virtual bool is_svg_use_element() const override { return true; }
Optional<StringView> parse_id_from_href(DeprecatedString const& href);
JS::GCPtr<DOM::Element> referenced_element();
@ -56,3 +58,10 @@ private:
};
}
namespace Web::DOM {
template<>
inline bool Node::fast_is<SVG::SVGUseElement>() const { return is_svg_use_element(); }
}