6 lines
311 B
JavaScript
6 lines
311 B
JavaScript
|
import { isElement } from "./instanceOf.js";
|
||
|
export default function getDocumentElement(element) {
|
||
|
// $FlowFixMe[incompatible-return]: assume body is always available
|
||
|
return ((isElement(element) ? element.ownerDocument : // $FlowFixMe[prop-missing]
|
||
|
element.document) || window.document).documentElement;
|
||
|
}
|