isParentOf function
Whether element is a parent of node in the dom tree.
Implementation
bool isParentOf(Element? element, Node? node) {
while (node != null) {
if (node == element) {
return true;
} else {
node = node.parent;
}
}
return false;
}