LibWeb: Make method NamedNodeMap::set_attribute() closer to the spec

This patch eliminates 1 FIXME that I've got during fixme roulette! :^)
This commit is contained in:
Alexander Narsudinov 2022-12-17 17:24:10 +03:00 committed by Andreas Kling
parent 1a0fbe1e85
commit ce6cf5bab8
Notes: sideshowbarker 2024-07-17 03:04:21 +09:00

View file

@ -168,9 +168,8 @@ WebIDL::ExceptionOr<Attr const*> NamedNodeMap::set_attribute(Attr& attribute)
return WebIDL::InUseAttributeError::create(realm(), "Attribute must not already be in use"sv);
// 2. Let oldAttr be the result of getting an attribute given attrs namespace, attrs local name, and element.
// FIXME: When getNamedItemNS is implemented, use that instead.
size_t old_attribute_index = 0;
auto* old_attribute = get_attribute(attribute.local_name(), &old_attribute_index);
auto* old_attribute = get_attribute_ns(attribute.namespace_uri(), attribute.local_name(), &old_attribute_index);
// 3. If oldAttr is attr, return attr.
if (old_attribute == &attribute)