1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 14:07:46 +00:00

LibWeb: Implement Element.getAttributeNode

This commit is contained in:
Luke Wilde 2022-11-05 04:37:40 +00:00 committed by Andreas Kling
parent 469ef22a22
commit 8066a67da2
3 changed files with 12 additions and 0 deletions

View file

@ -93,6 +93,13 @@ String Element::get_attribute(FlyString const& name) const
return attribute->value();
}
// https://dom.spec.whatwg.org/#dom-element-getattributenode
JS::GCPtr<Attr> Element::get_attribute_node(FlyString const& name) const
{
// The getAttributeNode(qualifiedName) method steps are to return the result of getting an attribute given qualifiedName and this.
return m_attributes->get_attribute(name);
}
// https://dom.spec.whatwg.org/#dom-element-setattribute
WebIDL::ExceptionOr<void> Element::set_attribute(FlyString const& name, String const& value)
{