diff options
author | Andreas Kling <kling@serenityos.org> | 2022-12-13 13:25:26 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-12-14 15:21:48 +0100 |
commit | b005e816a3b99bc748adb6b6edcdd68de9ce2dc5 (patch) | |
tree | b80ec4ad0c8ed924077ff479e6a25413e27da5ef /Userland/Libraries/LibWeb/DOM | |
parent | 8b0ace62898475ed864317ed684497c2c932a54b (diff) | |
download | serenity-b005e816a3b99bc748adb6b6edcdd68de9ce2dc5.zip |
LibWeb: Implement Node.isEqualNode() for ProcessingInstruction nodes
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Node.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Node.cpp b/Userland/Libraries/LibWeb/DOM/Node.cpp index ae3e444a34..d213cb4385 100644 --- a/Userland/Libraries/LibWeb/DOM/Node.cpp +++ b/Userland/Libraries/LibWeb/DOM/Node.cpp @@ -1274,8 +1274,16 @@ bool Node::is_equal_node(Node const* other_node) const return false; break; } - case (u16)NodeType::PROCESSING_INSTRUCTION_NODE: - TODO(); + case (u16)NodeType::PROCESSING_INSTRUCTION_NODE: { + // Its target and data. + auto& this_processing_instruction = verify_cast<ProcessingInstruction>(*this); + auto& other_processing_instruction = verify_cast<ProcessingInstruction>(*other_node); + if (this_processing_instruction.target() != other_processing_instruction.target()) + return false; + if (this_processing_instruction.data() != other_processing_instruction.data()) + return false; + break; + } default: break; } |