function isOrContainsNode(parent, child, environment) {
  const result =
    parent === child ||
    (child instanceof environment.Node &&
      parent.contains &&
      parent.contains(child))
  return result
}
@param {HTMLElement} parent the parent node
@param {HTMLElement} child the child node
@param {Window} environment The window context where downshift renders.
@return {Boolean} whether the parent is the child or the child is in the parent