Bug 1885489 - Part 5: Add SnapshotIterator::readInt32(). r=iain
[gecko.git] / dom / webidl / ShadowRoot.webidl
blob57051c5e7f94afd3ba598fcac341e5241f0a6a13
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/.
5  *
6  * The origin of this IDL file is
7  * https://dvcs.w3.org/hg/webcomponents/raw-file/tip/spec/shadow/index.html
8  *
9  * Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
10  * liability, trademark and document use rules apply.
11  */
13 // https://dom.spec.whatwg.org/#enumdef-shadowrootmode
14 enum ShadowRootMode {
15   "open",
16   "closed"
19 enum SlotAssignmentMode { "manual", "named" };
21 // https://dom.spec.whatwg.org/#shadowroot
22 [Exposed=Window,
23  InstrumentedProps=(pictureInPictureElement)]
24 interface ShadowRoot : DocumentFragment
26   // Shadow DOM v1
27   readonly attribute ShadowRootMode mode;
28   readonly attribute boolean delegatesFocus;
29   readonly attribute SlotAssignmentMode slotAssignment;
30   [Pref="dom.webcomponents.shadowdom.declarative.enabled"]
31   readonly attribute boolean clonable;
32   readonly attribute Element host;
33   attribute EventHandler onslotchange;
35   Element? getElementById(DOMString elementId);
37   // https://w3c.github.io/DOM-Parsing/#the-innerhtml-mixin
38   [CEReactions, SetterThrows]
39   attribute [LegacyNullToEmptyString] DOMString innerHTML;
41   // When JS invokes importNode or createElement, the binding code needs to
42   // create a reflector, and so invoking those methods directly on the content
43   // document would cause the reflector to be created in the content scope,
44   // at which point it would be difficult to move into the UA Widget scope.
45   // As such, these methods allow UA widget code to simultaneously create nodes
46   // and associate them with the UA widget tree, so that the reflectors get
47   // created in the right scope.
48   [CEReactions, Throws, Func="IsChromeOrUAWidget"]
49   Node importNodeAndAppendChildAt(Node parentNode, Node node, optional boolean deep = false);
51   [CEReactions, Throws, Func="IsChromeOrUAWidget"]
52   Node createElementAndAppendChildAt(Node parentNode, DOMString localName);
54   // For triggering UA Widget scope in tests.
55   [ChromeOnly]
56   undefined setIsUAWidget();
57   [ChromeOnly]
58   boolean isUAWidget();
61 partial interface ShadowRoot {
62   // https://html.spec.whatwg.org/#dom-shadowroot-sethtmlunsafe
63   [Pref="dom.webcomponents.shadowdom.declarative.enabled"]
64   undefined setHTMLUnsafe(DOMString html);
67 ShadowRoot includes DocumentOrShadowRoot;