From b005e816a3b99bc748adb6b6edcdd68de9ce2dc5 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 13 Dec 2022 13:25:26 +0100 Subject: [PATCH] LibWeb: Implement Node.isEqualNode() for ProcessingInstruction nodes --- Userland/Libraries/LibWeb/DOM/Node.cpp | 12 ++++++++++-- 1 file 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(*this); + auto& other_processing_instruction = verify_cast(*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; }