diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index b9aa52fd81..8d3f00763c 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -270,6 +270,12 @@ WebIDL::ExceptionOr Element::set_attribute_ns(Optional const& name return {}; } +// https://dom.spec.whatwg.org/#concept-element-attributes-append +void Element::append_attribute(Attr& attribute) +{ + m_attributes->append_attribute(attribute); +} + // https://dom.spec.whatwg.org/#concept-element-attributes-set-value void Element::set_attribute_value(FlyString const& local_name, DeprecatedString const& value, Optional const& prefix, DeprecatedFlyString const& namespace_) { diff --git a/Userland/Libraries/LibWeb/DOM/Element.h b/Userland/Libraries/LibWeb/DOM/Element.h index db0477be01..d4c4eb4ce0 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.h +++ b/Userland/Libraries/LibWeb/DOM/Element.h @@ -122,6 +122,8 @@ public: WebIDL::ExceptionOr> set_attribute_node(Attr&); WebIDL::ExceptionOr> set_attribute_node_ns(Attr&); + void append_attribute(Attr&); + // FIXME: This should take a 'FlyString cosnt&' void remove_attribute(StringView name);