ShadowRootInit

@JSType
trait ShadowRootInit extends Object

A ShadowRootInit object represents additional options associated with Element.attachShadow.

class Object
trait Any
class Object
trait Matchable
class Any

Value members

Inherited methods

def hasOwnProperty(v: String): Boolean
Inherited from:
Object
def isPrototypeOf(v: Object): Boolean
Inherited from:
Object
def propertyIsEnumerable(v: String): Boolean
Inherited from:
Object
def toLocaleString(): String
Inherited from:
Object
def valueOf(): Any
Inherited from:
Object

Abstract fields

@ExposedJSMember

A string specifying the encapsulation mode for the shadow DOM tree. This can be one of:

A string specifying the encapsulation mode for the shadow DOM tree. This can be one of:

open: Elements of the shadow root are accessible from JavaScript outside the root, for example using Element.shadowRoot: element.shadowRoot; // Returns a ShadowRoot obj

closed: Denies access to the node(s) of a closed shadow root from JavaScript outside it: element.shadowRoot; // Returns null

Concrete fields

@ExposedJSMember @JSOptional
var delegatesFocus: UndefOr[Boolean]

A boolean that, when set to true, specifies behavior that mitigates custom element issues around focusability. When a non-focusable part of the shadow DOM is clicked, the first focusable part is given focus, and the shadow host is given any available :focus styling.

A boolean that, when set to true, specifies behavior that mitigates custom element issues around focusability. When a non-focusable part of the shadow DOM is clicked, the first focusable part is given focus, and the shadow host is given any available :focus styling.