I don't think you have to check element_at_point != element if you're checking isAncestor also, right?