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

LibWeb: Implement Node.isEqualNode() for Attr nodes

This commit is contained in:
Andreas Kling 2022-12-13 13:09:09 +01:00
parent a004d3043f
commit de2c302cdb

View file

@ -1262,8 +1262,19 @@ bool Node::is_equal_node(Node const* other_node) const
return false;
break;
}
case (u16)NodeType::ATTRIBUTE_NODE: {
// Its namespace, local name, and value.
auto& this_attr = verify_cast<Attr>(*this);
auto& other_attr = verify_cast<Attr>(*other_node);
if (this_attr.namespace_uri() != other_attr.namespace_uri())
return false;
if (this_attr.local_name() != other_attr.local_name())
return false;
if (this_attr.value() != other_attr.value())
return false;
break;
}
case (u16)NodeType::PROCESSING_INSTRUCTION_NODE:
case (u16)NodeType::ATTRIBUTE_NODE:
TODO();
default:
break;