diff options
author | Andreas Kling <kling@serenityos.org> | 2022-07-27 16:03:43 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-07-27 17:29:48 +0200 |
commit | 9f32da1dbccf7550c53f84e260dfe97e042067f3 (patch) | |
tree | 0695ea854e44eaf1e458945263b31a25b41f8f12 /Userland/Libraries/LibWeb/HTML | |
parent | 7b4004d6828f6c133638f34e4d10382123ab3fb8 (diff) | |
download | serenity-9f32da1dbccf7550c53f84e260dfe97e042067f3.zip |
LibWeb: Add fast_is<HTMLBaseElement>()
This avoids slow RTTI lookups in Document::base_url().
Diffstat (limited to 'Userland/Libraries/LibWeb/HTML')
-rw-r--r-- | Userland/Libraries/LibWeb/HTML/HTMLBaseElement.h | 7 |
1 files changed, 7 insertions, 0 deletions
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<HTML::HTMLBaseElement>() const { return is_html_base_element(); } +} |