2016-07-24 21:38:00 +00:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
|
|
|
|
|
|
|
// https://html.spec.whatwg.org/#dom-window-customelements
|
2019-09-27 15:26:14 +00:00
|
|
|
[Exposed=Window]
|
2016-10-12 07:26:02 +00:00
|
|
|
interface CustomElementRegistry {
|
2018-11-26 16:59:55 +00:00
|
|
|
[CEReactions, Throws, UseCounter]
|
2022-09-21 07:44:58 +00:00
|
|
|
undefined define(DOMString name, CustomElementConstructor constructor,
|
|
|
|
optional ElementDefinitionOptions options = {});
|
2018-05-11 18:23:31 +00:00
|
|
|
[ChromeOnly, Throws]
|
2022-09-21 07:44:58 +00:00
|
|
|
undefined setElementCreationCallback(DOMString name, CustomElementCreationCallback callback);
|
2022-09-28 19:10:51 +00:00
|
|
|
(CustomElementConstructor or undefined) get(DOMString name);
|
2023-06-27 09:38:01 +00:00
|
|
|
DOMString? getName(CustomElementConstructor constructor);
|
2016-07-24 21:38:00 +00:00
|
|
|
[Throws]
|
2020-09-28 21:55:35 +00:00
|
|
|
Promise<CustomElementConstructor> whenDefined(DOMString name);
|
2022-09-21 07:44:58 +00:00
|
|
|
[CEReactions] undefined upgrade(Node root);
|
2016-07-24 21:38:00 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ElementDefinitionOptions {
|
|
|
|
DOMString extends;
|
|
|
|
};
|
|
|
|
|
2023-06-13 15:51:46 +00:00
|
|
|
enum RestoreReason {
|
|
|
|
"restore",
|
|
|
|
"autocomplete",
|
|
|
|
};
|
|
|
|
|
2019-04-11 23:05:10 +00:00
|
|
|
callback constructor CustomElementConstructor = any ();
|
|
|
|
|
2019-03-19 12:59:54 +00:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 07:44:58 +00:00
|
|
|
callback CustomElementCreationCallback = undefined (DOMString name);
|
2021-10-25 14:28:04 +00:00
|
|
|
|
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 07:44:58 +00:00
|
|
|
callback LifecycleConnectedCallback = undefined();
|
2021-10-25 14:28:04 +00:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 07:44:58 +00:00
|
|
|
callback LifecycleDisconnectedCallback = undefined();
|
2021-10-25 14:28:04 +00:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 07:44:58 +00:00
|
|
|
callback LifecycleAdoptedCallback = undefined(Document? oldDocument,
|
|
|
|
Document? newDocment);
|
2021-10-25 14:28:04 +00:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 07:44:58 +00:00
|
|
|
callback LifecycleAttributeChangedCallback = undefined(DOMString attrName,
|
|
|
|
DOMString? oldValue,
|
|
|
|
DOMString? newValue,
|
|
|
|
DOMString? namespaceURI);
|
2021-10-25 14:28:04 +00:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 07:44:58 +00:00
|
|
|
callback LifecycleFormAssociatedCallback = undefined(HTMLFormElement? form);
|
2021-10-28 10:29:38 +00:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 07:44:58 +00:00
|
|
|
callback LifecycleFormResetCallback = undefined();
|
2021-10-25 14:28:05 +00:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 07:44:58 +00:00
|
|
|
callback LifecycleFormDisabledCallback = undefined(boolean disabled);
|
2021-10-25 20:43:11 +00:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2023-06-13 15:51:46 +00:00
|
|
|
callback LifecycleFormStateRestoreCallback = undefined((File or USVString or FormData)? state, RestoreReason reason);
|
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2021-10-25 14:28:04 +00:00
|
|
|
callback LifecycleGetCustomInterfaceCallback = object?(any iid);
|
|
|
|
|
2023-01-26 00:52:46 +00:00
|
|
|
// Unsorted is necessary until https://github.com/whatwg/html/issues/3580 is resolved.
|
|
|
|
[GenerateInit, Unsorted]
|
2021-10-25 14:28:04 +00:00
|
|
|
dictionary LifecycleCallbacks {
|
|
|
|
LifecycleConnectedCallback connectedCallback;
|
|
|
|
LifecycleDisconnectedCallback disconnectedCallback;
|
|
|
|
LifecycleAdoptedCallback adoptedCallback;
|
|
|
|
LifecycleAttributeChangedCallback attributeChangedCallback;
|
2023-01-26 22:26:00 +00:00
|
|
|
[ChromeOnly] LifecycleGetCustomInterfaceCallback getCustomInterfaceCallback;
|
|
|
|
};
|
|
|
|
|
|
|
|
[GenerateInit, Unsorted]
|
|
|
|
dictionary FormAssociatedLifecycleCallbacks {
|
2021-10-28 10:29:38 +00:00
|
|
|
LifecycleFormAssociatedCallback formAssociatedCallback;
|
2021-10-25 14:28:05 +00:00
|
|
|
LifecycleFormResetCallback formResetCallback;
|
2021-10-25 20:43:11 +00:00
|
|
|
LifecycleFormDisabledCallback formDisabledCallback;
|
2023-06-13 15:51:46 +00:00
|
|
|
LifecycleFormStateRestoreCallback formStateRestoreCallback;
|
2021-10-25 14:28:04 +00:00
|
|
|
};
|