mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:07:47 +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:
parent
cb895edad4
commit
58b84f953c
2 changed files with 9 additions and 0 deletions
|
@ -77,6 +77,8 @@ public:
|
||||||
|
|
||||||
virtual bool is_editable() const;
|
virtual bool is_editable() const;
|
||||||
|
|
||||||
|
virtual bool is_html_template_element() const { return false; }
|
||||||
|
|
||||||
ExceptionOr<NonnullRefPtr<Node>> pre_insert(NonnullRefPtr<Node>, RefPtr<Node>);
|
ExceptionOr<NonnullRefPtr<Node>> pre_insert(NonnullRefPtr<Node>, RefPtr<Node>);
|
||||||
ExceptionOr<NonnullRefPtr<Node>> pre_remove(NonnullRefPtr<Node>);
|
ExceptionOr<NonnullRefPtr<Node>> pre_remove(NonnullRefPtr<Node>);
|
||||||
|
|
||||||
|
|
|
@ -25,9 +25,16 @@ public:
|
||||||
virtual void cloned(Node& copy, bool clone_children) override;
|
virtual void cloned(Node& copy, bool clone_children) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
virtual bool is_html_template_element() const final { return true; }
|
||||||
|
|
||||||
DOM::Document& appropriate_template_contents_owner_document(DOM::Document&);
|
DOM::Document& appropriate_template_contents_owner_document(DOM::Document&);
|
||||||
|
|
||||||
RefPtr<DOM::DocumentFragment> m_content;
|
RefPtr<DOM::DocumentFragment> m_content;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
namespace Web::DOM {
|
||||||
|
template<>
|
||||||
|
inline bool Node::fast_is<HTML::HTMLTemplateElement>() const { return is_html_template_element(); }
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue