A welcome refactoring of when_element_has_descendant.