main
Last change
on this file was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 2 weeks ago |
F4 Finalna Verzija
|
-
Property mode
set to
100644
|
File size:
420 bytes
|
Line | |
---|
1 | // @flow
|
---|
2 | import { isElement } from './instanceOf';
|
---|
3 | import type { Window } from '../types';
|
---|
4 |
|
---|
5 | export default function getDocumentElement(
|
---|
6 | element: Element | Window
|
---|
7 | ): HTMLElement {
|
---|
8 | // $FlowFixMe[incompatible-return]: assume body is always available
|
---|
9 | return (
|
---|
10 | (isElement(element)
|
---|
11 | ? element.ownerDocument
|
---|
12 | : // $FlowFixMe[prop-missing]
|
---|
13 | element.document) || window.document
|
---|
14 | ).documentElement;
|
---|
15 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.