From ce6cf5bab8322412c14aa8a273f1fa4714769248 Mon Sep 17 00:00:00 2001 From: Alexander Narsudinov Date: Sat, 17 Dec 2022 17:24:10 +0300 Subject: [PATCH] LibWeb: Make method NamedNodeMap::set_attribute() closer to the spec This patch eliminates 1 FIXME that I've got during fixme roulette! :^) --- Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp index e121b3f1b9..5ba887d206 100644 --- a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp +++ b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp @@ -168,9 +168,8 @@ WebIDL::ExceptionOr 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 attr’s namespace, attr’s 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)