diff --git a/Userland/Libraries/LibWeb/DOM/Node.h b/Userland/Libraries/LibWeb/DOM/Node.h index 91ab9dee9d..acdd0955e6 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.h +++ b/Userland/Libraries/LibWeb/DOM/Node.h @@ -77,6 +77,8 @@ public: virtual bool is_editable() const; + virtual bool is_html_template_element() const { return false; } + ExceptionOr> pre_insert(NonnullRefPtr, RefPtr); ExceptionOr> pre_remove(NonnullRefPtr); diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h index 28b38a3b72..8382a8ef90 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLTemplateElement.h @@ -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 m_content; }; } + +namespace Web::DOM { +template<> +inline bool Node::fast_is() const { return is_html_template_element(); } +}