code: function isAncestor(ancestor, descendant) {
  	return ancestor
  		&& descendant
  		&& Boolean(ancestor.compareDocumentPosition(descendant) & Node.DOCUMENT_POSITION_CONTAINED_BY);
  }
docs: Returns true if ancestor is an ancestor of descendant, false otherwise.