isDescendantOf method
Implementation
bool isDescendantOf(Node? other) {
// Return true if other is an ancestor of this, otherwise false
if (other == null || isConnected != other.isConnected) {
return false;
}
if (other.ownerDocument != ownerDocument) {
return false;
}
ContainerNode? n = parentNode;
while (n != null) {
if (n == other) {
return true;
}
n = n.parentNode;
}
return false;
}