Welcome to mirror list, hosted at ThFree Co, Russian Federation.

getDocumentElement.js.flow « dom-utils « lib « package « popperjs - github.com/gohugoio/hugo-mod-jslibs-dist.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ad6fa5f16e27744aa4363000a6e91c87ae9f6a7b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// @flow
import { isElement } from './instanceOf';
import type { Window } from '../types';

export default function getDocumentElement(
  element: Element | Window
): HTMLElement {
  // $FlowFixMe[incompatible-return]: assume body is always available
  return (
    (isElement(element)
      ? element.ownerDocument
      : // $FlowFixMe[prop-missing]
        element.document) || window.document
  ).documentElement;
}