summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-12-13 13:25:26 +0100
committerAndreas Kling <kling@serenityos.org>2022-12-14 15:21:48 +0100
commitb005e816a3b99bc748adb6b6edcdd68de9ce2dc5 (patch)
treeb80ec4ad0c8ed924077ff479e6a25413e27da5ef /Userland/Libraries/LibWeb/DOM
parent8b0ace62898475ed864317ed684497c2c932a54b (diff)
downloadserenity-b005e816a3b99bc748adb6b6edcdd68de9ce2dc5.zip
LibWeb: Implement Node.isEqualNode() for ProcessingInstruction nodes
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Node.cpp12
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;
}