1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

LibWeb: Add fast_is<HTMLTemplateElement>()

This was showing up as hot in profiles, as the HTML parser calls it
quite a lot.
This commit is contained in:
Andreas Kling 2021-09-16 00:52:10 +02:00
parent cb895edad4
commit 58b84f953c
2 changed files with 9 additions and 0 deletions

View file

@ -25,9 +25,16 @@ public:
virtual void cloned(Node& copy, bool clone_children) override;
private:
virtual bool is_html_template_element() const final { return true; }
DOM::Document& appropriate_template_contents_owner_document(DOM::Document&);
RefPtr<DOM::DocumentFragment> m_content;
};
}
namespace Web::DOM {
template<>
inline bool Node::fast_is<HTML::HTMLTemplateElement>() const { return is_html_template_element(); }
}