boolean (@NotNull DomElement ancestor, @NotNull DomElement descendant, boolean strict) { if (!strict && ancestor.equals(descendant)) return true; final DomElement parent = descendant.getParent(); return parent != null && isAncestor(ancestor, parent, false); }