1 /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
4 * You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
9 * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10 * liability, trademark and document use rules apply.
13 // https://dom.spec.whatwg.org/#enumdef-shadowrootmode
19 enum SlotAssignmentMode { "manual", "named" };
21 // https://dom.spec.whatwg.org/#shadowroot
23 InstrumentedProps=(pictureInPictureElement)]
24 interface ShadowRoot : DocumentFragment
27 readonly attribute ShadowRootMode mode;
28 readonly attribute boolean delegatesFocus;
29 readonly attribute SlotAssignmentMode slotAssignment;
30 readonly attribute Element host;
31 attribute EventHandler onslotchange;
33 Element? getElementById(DOMString elementId);
35 // https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin
36 [CEReactions, SetterThrows]
37 attribute [LegacyNullToEmptyString] DOMString innerHTML;
39 // When JS invokes importNode or createElement, the binding code needs to
40 // create a reflector, and so invoking those methods directly on the content
41 // document would cause the reflector to be created in the content scope,
42 // at which point it would be difficult to move into the UA Widget scope.
43 // As such, these methods allow UA widget code to simultaneously create nodes
44 // and associate them with the UA widget tree, so that the reflectors get
45 // created in the right scope.
46 [CEReactions, Throws, Func="IsChromeOrUAWidget"]
47 Node importNodeAndAppendChildAt(Node parentNode, Node node, optional boolean deep = false);
49 [CEReactions, Throws, Func="IsChromeOrUAWidget"]
50 Node createElementAndAppendChildAt(Node parentNode, DOMString localName);
52 // For triggering UA Widget scope in tests.
54 undefined setIsUAWidget();
59 ShadowRoot includes DocumentOrShadowRoot;