The ShadowRoot
interface of the Shadow DOM API is the root node of a DOM subtree that is rendered separately from a document's main DOM tree.
ShadowRoot.mode
Read only
ShadowRoot
: either "open"
or "closed"
.mode
of a shadow root to "closed
" makes the shadow root’s implementation internals inaccessible and unchangeable from JavaScript—in the same way the implementation internals of, for example, the <video>
element are inaccessible and unchangeable from JavaScript.ShadowRoot.host
Read only
ShadowRoot
is attached.ShadowRoot.innerHTML
ShadowRoot
.Specification | Status | Comment |
---|---|---|
DOM The definition of 'Interface ShadowRoot' in that specification. | Living Standard | |
Shadow DOM The definition of 'the ShadowRoot interface' in that specification. | Working Draft | Initial definition. |
Feature | Chrome | Edge | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|---|
Basic support | 53 | No support[1] | No support[2] | No support | 40 | 10 |
Feature | Android | Edge | Firefox Mobile (Gecko) | IE Phone | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|---|
Basic support | 53 | No support[1] | No support[2] | No support | 40 | 10.1 |
[1] This feature is not implemented yet. See the Edge platform status.
[2] This feature is implemented behind the preference dom.webcomponents.enabled
, defaulting to false
. See bug 1205323.
© 2005–2017 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/ShadowRoot