function bodyContains(elt) {
    return elt.getRootNode({ composed: true }) === document
  }
Checks whether the element is in the document (includes shadow roots).
This function this is a slight misnomer; it will return true even for elements in the head.

@param {Node} elt
@returns {boolean}