diff --git a/Userland/Libraries/LibWeb/DOM/Node.h b/Userland/Libraries/LibWeb/DOM/Node.h index 8cd3ffb2c9..482f20055a 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.h +++ b/Userland/Libraries/LibWeb/DOM/Node.h @@ -89,6 +89,7 @@ public: virtual bool is_html_html_element() const { return false; } virtual bool is_html_anchor_element() const { return false; } + virtual bool is_html_base_element() const { return false; } virtual bool is_html_template_element() const { return false; } virtual bool is_browsing_context_container() const { return false; } diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h index 13afb78cfc..0c904246cb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h @@ -26,6 +26,8 @@ public: virtual void parse_attribute(FlyString const& name, String const& value) override; private: + virtual bool is_html_base_element() const override { return true; } + // https://html.spec.whatwg.org/multipage/semantics.html#frozen-base-url // A base element that is the first base element with an href content attribute in a document tree has a frozen base URL. AK::URL m_frozen_base_url; @@ -34,3 +36,8 @@ private: }; } + +namespace Web::DOM { +template<> +inline bool Node::fast_is() const { return is_html_base_element(); } +}