1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
3 * You can obtain one at http://mozilla.org/MPL/2.0/. */
5 // https://html.spec.whatwg.org/#dom-window-customelements
7 interface CustomElementRegistry {
8 [CEReactions, Throws, UseCounter]
9 undefined define(DOMString name, CustomElementConstructor constructor,
10 optional ElementDefinitionOptions options = {});
12 undefined setElementCreationCallback(DOMString name, CustomElementCreationCallback callback);
13 (CustomElementConstructor or undefined) get(DOMString name);
14 DOMString? getName(CustomElementConstructor constructor);
16 Promise<CustomElementConstructor> whenDefined(DOMString name);
17 [CEReactions] undefined upgrade(Node root);
20 dictionary ElementDefinitionOptions {
29 callback constructor CustomElementConstructor = any ();
31 [MOZ_CAN_RUN_SCRIPT_BOUNDARY]
32 callback CustomElementCreationCallback = undefined (DOMString name);
34 [MOZ_CAN_RUN_SCRIPT_BOUNDARY]
35 callback LifecycleConnectedCallback = undefined();
36 [MOZ_CAN_RUN_SCRIPT_BOUNDARY]
37 callback LifecycleDisconnectedCallback = undefined();
38 [MOZ_CAN_RUN_SCRIPT_BOUNDARY]
39 callback LifecycleAdoptedCallback = undefined(Document? oldDocument,
40 Document? newDocment);
41 [MOZ_CAN_RUN_SCRIPT_BOUNDARY]
42 callback LifecycleAttributeChangedCallback = undefined(DOMString attrName,
45 DOMString? namespaceURI);
46 [MOZ_CAN_RUN_SCRIPT_BOUNDARY]
47 callback LifecycleFormAssociatedCallback = undefined(HTMLFormElement? form);
48 [MOZ_CAN_RUN_SCRIPT_BOUNDARY]
49 callback LifecycleFormResetCallback = undefined();
50 [MOZ_CAN_RUN_SCRIPT_BOUNDARY]
51 callback LifecycleFormDisabledCallback = undefined(boolean disabled);
52 [MOZ_CAN_RUN_SCRIPT_BOUNDARY]
53 callback LifecycleFormStateRestoreCallback = undefined((File or USVString or FormData)? state, RestoreReason reason);
54 [MOZ_CAN_RUN_SCRIPT_BOUNDARY]
55 callback LifecycleGetCustomInterfaceCallback = object?(any iid);
57 // Unsorted is necessary until https://github.com/whatwg/html/issues/3580 is resolved.
58 [GenerateInit, Unsorted]
59 dictionary LifecycleCallbacks {
60 LifecycleConnectedCallback connectedCallback;
61 LifecycleDisconnectedCallback disconnectedCallback;
62 LifecycleAdoptedCallback adoptedCallback;
63 LifecycleAttributeChangedCallback attributeChangedCallback;
64 [ChromeOnly] LifecycleGetCustomInterfaceCallback getCustomInterfaceCallback;
67 [GenerateInit, Unsorted]
68 dictionary FormAssociatedLifecycleCallbacks {
69 LifecycleFormAssociatedCallback formAssociatedCallback;
70 LifecycleFormResetCallback formResetCallback;
71 LifecycleFormDisabledCallback formDisabledCallback;
72 LifecycleFormStateRestoreCallback formStateRestoreCallback;