function isValidFocusTarget(el) {
    if (el && el !== document && el.nodeName !== 'HTML' && el.nodeName !== 'BODY' && 'classList' in el && 'contains' in el.classList) {
      return true;
    }

    return false;
  }
Helper function for legacy browsers and iframes which sometimes focus
elements like document, body, and non-interactive SVG.