Forráskód Böngészése

LibWeb: Implement the Element attributes getter

Timothy Flynn 3 éve
szülő
commit
5d4cd061c7

+ 1 - 0
Userland/Libraries/LibWeb/DOM/Element.h

@@ -56,6 +56,7 @@ public:
     ExceptionOr<void> 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<NamedNodeMap> const& attributes() const { return m_attributes; }
 
     DOM::ExceptionOr<bool> matches(StringView selectors) const;
 

+ 1 - 0
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);