isDescendantOf method

bool isDescendantOf(
  1. Node? other
)
inherited

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;
}