浏览代码

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.
Alexander Narsudinov 2 年之前
父节点
当前提交
7679d38c5f
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp

+ 1 - 1
Userland/Libraries/LibWeb/DOM/NamedNodeMap.cpp

@@ -103,7 +103,7 @@ WebIDL::ExceptionOr<Attr const*> 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