LibWeb: Expose NamedNodeMap::append_attribute in Element

This commit is contained in:
Shannon Booth 2023-10-04 17:42:40 +13:00 committed by Sam Atkins
parent 907be5a96e
commit 19ca6f68ba
Notes: sideshowbarker 2024-07-17 11:29:41 +09:00
2 changed files with 8 additions and 0 deletions

View file

@ -270,6 +270,12 @@ WebIDL::ExceptionOr<void> Element::set_attribute_ns(Optional<String> 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<FlyString> const& prefix, DeprecatedFlyString const& namespace_)
{

View file

@ -122,6 +122,8 @@ public:
WebIDL::ExceptionOr<JS::GCPtr<Attr>> set_attribute_node(Attr&);
WebIDL::ExceptionOr<JS::GCPtr<Attr>> set_attribute_node_ns(Attr&);
void append_attribute(Attr&);
// FIXME: This should take a 'FlyString cosnt&'
void remove_attribute(StringView name);