diff --git a/Libraries/LibWeb/DOM/Element.h b/Libraries/LibWeb/DOM/Element.h index d85c2115b8..45b18ef0e2 100644 --- a/Libraries/LibWeb/DOM/Element.h +++ b/Libraries/LibWeb/DOM/Element.h @@ -60,6 +60,7 @@ public: const FlyString& namespace_uri() const { return namespace_(); } bool has_attribute(const FlyString& name) const { return !attribute(name).is_null(); } + bool has_attributes() const { return !m_attributes.is_empty(); } String attribute(const FlyString& name) const; String get_attribute(const FlyString& name) const { return attribute(name); } void set_attribute(const FlyString& name, const String& value); diff --git a/Libraries/LibWeb/DOM/Element.idl b/Libraries/LibWeb/DOM/Element.idl index 386b44db3a..e5de36e75b 100644 --- a/Libraries/LibWeb/DOM/Element.idl +++ b/Libraries/LibWeb/DOM/Element.idl @@ -4,6 +4,9 @@ interface Element : Node { DOMString? getAttribute(DOMString qualifiedName); undefined setAttribute(DOMString qualifiedName, DOMString value); + undefined removeAttribute(DOMString qualifiedName); + boolean hasAttribute(DOMString qualifiedName); + boolean hasAttributes(); readonly attribute Element? firstElementChild; readonly attribute Element? lastElementChild;