From 67d2e329840091308c10ad3f81f5c1725e38830c Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 8 May 2023 07:10:24 +0200 Subject: [PATCH] LibWeb: Don't include DOM/NamedNodeMap.h from DOM/Element.h --- Userland/Libraries/LibWeb/DOM/Element.cpp | 11 +++++++++++ Userland/Libraries/LibWeb/DOM/Element.h | 5 ++--- .../Libraries/LibWeb/DOMParsing/XMLSerializer.cpp | 1 + 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index fe2a649375e..3cdaca22f93 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -1692,4 +1693,14 @@ Layout::NodeWithStyle const* Element::layout_node() const return static_cast(Node::layout_node()); } +bool Element::has_attributes() const +{ + return !m_attributes->is_empty(); +} + +size_t Element::attribute_list_size() const +{ + return m_attributes->length(); +} + } diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index 3628b5720a1..0df51fca6b0 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include @@ -89,7 +88,7 @@ public: DeprecatedFlyString const& namespace_uri() const { return namespace_(); } bool has_attribute(DeprecatedFlyString const& name) const; - bool has_attributes() const { return !m_attributes->is_empty(); } + bool has_attributes() const; DeprecatedString attribute(DeprecatedFlyString const& name) const { return get_attribute(name); } DeprecatedString get_attribute(DeprecatedFlyString const& name) const; WebIDL::ExceptionOr set_attribute(DeprecatedFlyString const& name, DeprecatedString const& value); @@ -98,7 +97,7 @@ public: WebIDL::ExceptionOr> set_attribute_node_ns(Attr&); void remove_attribute(DeprecatedFlyString const& name); WebIDL::ExceptionOr toggle_attribute(DeprecatedFlyString const& name, Optional force); - size_t attribute_list_size() const { return m_attributes->length(); } + size_t attribute_list_size() const; NamedNodeMap const* attributes() const { return m_attributes.ptr(); } Vector get_attribute_names() const; diff --git a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp index 7873639fb12..222085a1192 100644 --- a/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp +++ b/Userland/Libraries/LibWeb/DOMParsing/XMLSerializer.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include