diff options
author | Andreas Kling <kling@serenityos.org> | 2020-03-28 09:12:13 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-03-28 09:13:29 +0100 |
commit | 660ec504ca4707ee02e17fdc21a8472defbb0fd2 (patch) | |
tree | f9e01eb4d5f1dce773f63458f13008e977127a43 /Libraries/LibWeb/DOM/Document.h | |
parent | 95cc4c7e748b6bf77d132a05e962a6830b5f7622 (diff) | |
download | serenity-660ec504ca4707ee02e17fdc21a8472defbb0fd2.zip |
LibWeb: Move get_element_by_id() to a NonElementParentNode mixin class
This matches the current version of the DOM spec. And since C++ doesn't
have mixins this is actually a CRTP class.
Diffstat (limited to 'Libraries/LibWeb/DOM/Document.h')
-rw-r--r-- | Libraries/LibWeb/DOM/Document.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Libraries/LibWeb/DOM/Document.h b/Libraries/LibWeb/DOM/Document.h index c80f6dfe98..dab8e4db0f 100644 --- a/Libraries/LibWeb/DOM/Document.h +++ b/Libraries/LibWeb/DOM/Document.h @@ -37,6 +37,7 @@ #include <LibJS/Forward.h> #include <LibWeb/CSS/StyleResolver.h> #include <LibWeb/CSS/StyleSheet.h> +#include <LibWeb/DOM/NonElementParentNode.h> #include <LibWeb/DOM/ParentNode.h> namespace Web { @@ -50,7 +51,9 @@ class LayoutNode; class StyleResolver; class StyleSheet; -class Document : public ParentNode { +class Document + : public ParentNode + , public NonElementParentNode<Document> { public: using WrapperType = Bindings::DocumentWrapper; @@ -119,7 +122,6 @@ public: void schedule_style_update(); - const Element* get_element_by_id(const String&) const; Vector<const Element*> get_elements_by_name(const String&) const; const String& source() const { return m_source; } |