From 5d4cd061c770abd813e44a11f41b203e67b70384 Mon Sep 17 00:00:00 2001 From: Timothy Flynn Date: Sat, 16 Oct 2021 17:00:49 -0400 Subject: [PATCH] LibWeb: Implement the Element attributes getter --- Userland/Libraries/LibWeb/DOM/Element.h | 1 + Userland/Libraries/LibWeb/DOM/Element.idl | 1 + 2 files changed, 2 insertions(+) diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index 6c2bc5b838..5ae982baa0 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -56,6 +56,7 @@ public: ExceptionOr set_attribute(const FlyString& name, const String& value); void remove_attribute(const FlyString& name); size_t attribute_list_size() const { return m_attributes->length(); } + NonnullRefPtr const& attributes() const { return m_attributes; } DOM::ExceptionOr matches(StringView selectors) const; diff --git a/Userland/Libraries/LibWeb/DOM/Element.idl b/Userland/Libraries/LibWeb/DOM/Element.idl index 19330dd789..aa5ef33882 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.idl +++ b/Userland/Libraries/LibWeb/DOM/Element.idl @@ -9,6 +9,7 @@ interface Element : Node { undefined removeAttribute(DOMString qualifiedName); boolean hasAttribute(DOMString qualifiedName); boolean hasAttributes(); + [SameObject] readonly attribute NamedNodeMap attributes; HTMLCollection getElementsByTagName(DOMString tagName); HTMLCollection getElementsByTagNameNS(DOMString? namespace, DOMString localName);