mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibWeb: Implement Node.isEqualNode() for Attr nodes
This commit is contained in:
parent
a004d3043f
commit
de2c302cdb
Notes:
sideshowbarker
2024-07-17 03:15:03 +09:00
Author: https://github.com/awesomekling
Commit: de2c302cdb
Pull-request: https://github.com/SerenityOS/serenity/pull/16469
Reviewed-by: https://github.com/ADKaster
Reviewed-by: https://github.com/Dexesttp
Reviewed-by: https://github.com/emilio
1 changed files with 12 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue