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);