mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 20:07:36 +00:00
LibWeb: Implement Node.isSameNode(Node? otherNode)
This commit is contained in:
parent
25f43ea0a1
commit
a0528598b5
3 changed files with 9 additions and 0 deletions
|
@ -768,4 +768,10 @@ void Node::string_replace_all(String const& string)
|
||||||
replace_all(node);
|
replace_all(node);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://dom.spec.whatwg.org/#dom-node-issamenode
|
||||||
|
bool Node::is_same_node(Node const* other_node) const
|
||||||
|
{
|
||||||
|
return this == other_node;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -186,6 +186,8 @@ public:
|
||||||
void replace_all(RefPtr<Node>);
|
void replace_all(RefPtr<Node>);
|
||||||
void string_replace_all(String const&);
|
void string_replace_all(String const&);
|
||||||
|
|
||||||
|
bool is_same_node(Node const*) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
Node(Document&, NodeType);
|
Node(Document&, NodeType);
|
||||||
|
|
||||||
|
|
|
@ -26,6 +26,7 @@ interface Node : EventTarget {
|
||||||
[ImplementedAs=pre_remove] Node removeChild(Node child);
|
[ImplementedAs=pre_remove] Node removeChild(Node child);
|
||||||
[ImplementedAs=clone_node_binding] Node cloneNode(optional boolean deep = false);
|
[ImplementedAs=clone_node_binding] Node cloneNode(optional boolean deep = false);
|
||||||
boolean contains(Node? other);
|
boolean contains(Node? other);
|
||||||
|
boolean isSameNode(Node? otherNode);
|
||||||
|
|
||||||
const unsigned short ELEMENT_NODE = 1;
|
const unsigned short ELEMENT_NODE = 1;
|
||||||
const unsigned short ATTRIBUTE_NODE = 2;
|
const unsigned short ATTRIBUTE_NODE = 2;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue