From 7679d38c5f9540cf6e8c5b06c8ed0875f227c41d Mon Sep 17 00:00:00 2001 From: Alexander Narsudinov Date: Sat, 17 Dec 2022 17:05:35 +0300 Subject: [PATCH] LibWeb: Fix incorrect behaviour in NamedNodeMap::removeNamedItem() According to the spec we should return removed attribute, but the old implementation returned nullptr instead. Now we return the element's removed attribute. --- Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp index 6d47d3c065..2c64ace03d 100644 --- a/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp +++ b/Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp @@ -103,7 +103,7 @@ WebIDL::ExceptionOr NamedNodeMap::remove_named_item(StringView qual return WebIDL::NotFoundError::create(realm(), DeprecatedString::formatted("Attribute with name '{}' not found", qualified_name)); // 3. Return attr. - return nullptr; + return attribute; } // https://dom.spec.whatwg.org/#concept-element-attributes-get-by-name