DocumentOrShadowRoot

Shadow DOM API 의 DocumentOrShadowRoot 믹스인(mixin)은 문서와 섀도우 루트간에 공유되는 API를 제공합니다. 다음 기능은 문서Document와 ShadowRoot에 모두 포함되어 있습니다.

Properties

DocumentOrShadowRoot.activeElementRead only
포커스를 가지는 섀도우 루트 내의 요소Element를 반환합니다.
DocumentOrShadowRoot.fullscreenElementRead only
현재 이 문서에서 full screen mode인 요소Element를 반환합니다.
DocumentOrShadowRoot.pointerLockElement  Read only
포인터가 잠겨있는 동안 마우스 이벤트의 대상으로 설정된 요소를 반환합니다. 잠금이 보류중이거나 포인터가 잠금 해제되어 있거나, 대상이 다른 문서(document)에 있으면 null을 반환합니다.
DocumentOrShadowRoot.styleSheetsRead only
문서에 명시적으로 링크되었거나 포함하고 있는 스타일 시트의 CSSStyleSheet 객체의 StyleSheetList를 반환합니다.

Methods

DocumentOrShadowRoot.getSelection()
유저가 선택한 텍스트의 범위, 또는 캐럿(caret - 텍스트 커서)의 현재 위치를 나타내는 Selection객체를 반환합니다.
DocumentOrShadowRoot.elementFromPoint()
지정된 좌표의 최상위 요소를 반환합니다.
DocumentOrShadowRoot.elementsFromPoint()
지정된 자표에 있는 모든 요소의 배열을 반환합니다.
DocumentOrShadowRoot.caretPositionFromPoint()
캐럿을 포함한 DOM 노드와 그 노드 내에서 캐럿의 문자 오프셋을 포함한 CaretPosition를 반환합니다.

Specifications

Specification Status Comment
DOM
The definition of 'DocumentOrShadowRoot' in that specification.
Living Standard Initial definition.
Shadow DOM
The definition of 'DocumentOrShadowRoot' in that specification.
Obsolete Implementation in Shadow DOM.

Browser Compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
DocumentOrShadowRoot
Experimental
Chrome Full support 53Edge Full support YesFirefox Full support YesIE Full support YesOpera Full support 40Safari Full support YesWebView Android Full support 53Chrome Android Full support 53Firefox Android Full support YesOpera Android Full support 41Safari iOS Full support YesSamsung Internet Android Full support 6.0
activeElement
Experimental
Chrome Full support 53Edge Full support YesFirefox Full support 63IE Full support YesOpera Full support 40Safari Full support YesWebView Android Full support 53Chrome Android Full support 53Firefox Android Full support 63Opera Android Full support 41Safari iOS Full support YesSamsung Internet Android Full support 6.0
adoptedStyleSheets
Experimental
Chrome Full support 73Edge No support NoFirefox No support NoIE No support NoOpera Full support 60Safari No support NoWebView Android Full support 73Chrome Android Full support 73Firefox Android No support NoOpera Android Full support 50Safari iOS No support NoSamsung Internet Android No support No
caretPositionFromPoint
Experimental
Chrome No support NoEdge No support NoFirefox Full support 20IE No support NoOpera No support NoSafari Full support YesWebView Android No support NoChrome Android No support NoFirefox Android Full support 20Opera Android No support NoSafari iOS Full support YesSamsung Internet Android No support No
elementFromPoint
Experimental
Chrome Full support 53
Notes
Full support 53
Notes
Notes Before Chrome 66, this method returned null when the element was a child of a host node. See issue 759947.
Edge Full support YesFirefox Full support 63IE Full support YesOpera Full support 40Safari Full support YesWebView Android Full support 53
Notes
Full support 53
Notes
Notes Before WebView 66, this method returned null when the element was a child of a host node. See issue 759947.
Chrome Android Full support 53
Notes
Full support 53
Notes
Notes Before Chrome 66, this method returned null when the element was a child of a host node. See issue 759947.
Firefox Android Full support 63Opera Android Full support 41Safari iOS Full support YesSamsung Internet Android Full support 6.0
elementsFromPoint
Experimental
Chrome Full support 53
Notes
Full support 53
Notes
Notes Before Chrome 66, this method returned null when the element was a child of a host node. See issue 759947.
Edge Full support 12
Notes Alternate Name
Full support 12
Notes Alternate Name
Notes Returns a NodeList instead of an array. See the MSDN documentation. Returns null when the point provided has no elements beneath it (e.g., when given a point outside the document).
Alternate Name Uses the non-standard name: msElementsFromPoint
Firefox Full support 63IE Full support 10
Notes Alternate Name
Full support 10
Notes Alternate Name
Notes Returns a NodeList instead of an array. See the MSDN documentation. Returns null when the point provided has no elements beneath it (e.g., when given a point outside the document).
Alternate Name Uses the non-standard name: msElementsFromPoint
Opera Full support 40Safari Full support 12WebView Android Full support 53
Notes
Full support 53
Notes
Notes Before WebView 66, this method returned null when the element was a child of a host node. See issue 759947.
Chrome Android Full support 53
Notes
Full support 53
Notes
Notes Before Chrome 66, this method returned null when the element was a child of a host node. See issue 759947.
Firefox Android Full support 63Opera Android Full support 41Safari iOS Full support 12Samsung Internet Android Full support 6.0
fullscreenElementChrome Full support 53
Prefixed
Full support 53
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Edge Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Full support 64
Full support 64
No support 47 — 65
Disabled
Disabled From version 47 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No support 9 — 65
Alternate Name
Alternate Name Uses the non-standard name: mozFullScreenElement
IE Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: ms
Opera Full support 40
Prefixed
Full support 40
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari Full support Yes
Prefixed
Full support Yes
Prefixed
Prefixed Implemented with the vendor prefix: webkit
WebView Android Full support 53
Prefixed
Full support 53
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Chrome Android Full support 53
Prefixed
Full support 53
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Firefox Android Full support 64
Full support 64
No support 47 — 65
Disabled
Disabled From version 47 until version 65 (exclusive): this feature is behind the full-screen-api.unprefix.enabled preference (needs to be set to true). To change preferences in Firefox, visit about:config.
No support 9 — 65
Alternate Name
Alternate Name Uses the non-standard name: mozFullScreenElement
Opera Android Full support 41
Prefixed
Full support 41
Prefixed
Prefixed Implemented with the vendor prefix: webkit
Safari iOS Partial support 12
Notes Alternate Name
Partial support 12
Notes Alternate Name
Notes Full-screen mode is only supported on the iPad.
Alternate Name Uses the non-standard name: webkitFullscreenElement
Samsung Internet Android Full support 6.0
Prefixed
Full support 6.0
Prefixed
Prefixed Implemented with the vendor prefix: webkit
getSelection
Experimental
Chrome Full support 53Edge Full support YesFirefox Full support 63IE Full support YesOpera Full support 40Safari Full support YesWebView Android Full support 53Chrome Android Full support 53Firefox Android Full support 63Opera Android Full support 41Safari iOS Full support YesSamsung Internet Android Full support 6.0
nodeFromPoint
ExperimentalNon-standard
Chrome No support NoEdge No support NoFirefox No support No
Notes
No support No
Notes
Notes Implemented in Firefox but currently only works in chrome code.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android No support No
Notes
No support No
Notes
Notes Implemented in Firefox but currently only works in chrome code.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
nodesFromPoint
ExperimentalNon-standard
Chrome No support NoEdge No support NoFirefox No support No
Notes
No support No
Notes
Notes Implemented in Firefox but currently only works in chrome code.
IE No support NoOpera No support NoSafari No support NoWebView Android No support NoChrome Android No support NoFirefox Android No support No
Notes
No support No
Notes
Notes Implemented in Firefox but currently only works in chrome code.
Opera Android No support NoSafari iOS No support NoSamsung Internet Android No support No
pointerLockElement
Experimental
Chrome Full support 53Edge Full support YesFirefox Full support 63IE Full support YesOpera Full support 40Safari Full support YesWebView Android Full support 53Chrome Android Full support 53Firefox Android Full support 63Opera Android Full support 41Safari iOS Full support YesSamsung Internet Android Full support 6.0
styleSheets
Experimental
Chrome Full support 53Edge Full support YesFirefox Full support 63IE Full support YesOpera Full support 40Safari Full support YesWebView Android Full support 53Chrome Android Full support 53Firefox Android Full support 63Opera Android Full support 41Safari iOS Full support YesSamsung Internet Android Full support 6.0

Legend

Full support  
Full support
Partial support  
Partial support
No support  
No support
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
Non-standard. Expect poor cross-browser support.
Non-standard. Expect poor cross-browser support.
See implementation notes.
See implementation notes.
User must explicitly enable this feature.
User must explicitly enable this feature.
Uses a non-standard name.
Uses a non-standard name.
Requires a vendor prefix or different name for use.
Requires a vendor prefix or different name for use.

[1] This interface's features are still implemented on the Document object.