2016-07-25 00:38:00 +03: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 18:26:14 +03:00
|
|
|
[Exposed=Window]
|
2016-10-12 10:26:02 +03:00
|
|
|
interface CustomElementRegistry {
|
2018-11-26 19:59:55 +03:00
|
|
|
[CEReactions, Throws, UseCounter]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined define(DOMString name, CustomElementConstructor constructor,
|
|
|
|
optional ElementDefinitionOptions options = {});
|
2018-05-11 21:23:31 +03:00
|
|
|
[ChromeOnly, Throws]
|
2022-09-21 10:44:58 +03:00
|
|
|
undefined setElementCreationCallback(DOMString name, CustomElementCreationCallback callback);
|
2022-09-28 22:10:51 +03:00
|
|
|
(CustomElementConstructor or undefined) get(DOMString name);
|
2023-06-27 12:38:01 +03:00
|
|
|
DOMString? getName(CustomElementConstructor constructor);
|
2016-07-25 00:38:00 +03:00
|
|
|
[Throws]
|
2020-09-29 00:55:35 +03:00
|
|
|
Promise<CustomElementConstructor> whenDefined(DOMString name);
|
2022-09-21 10:44:58 +03:00
|
|
|
[CEReactions] undefined upgrade(Node root);
|
2016-07-25 00:38:00 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
dictionary ElementDefinitionOptions {
|
|
|
|
DOMString extends;
|
|
|
|
};
|
|
|
|
|
2023-06-13 18:51:46 +03:00
|
|
|
enum RestoreReason {
|
|
|
|
"restore",
|
|
|
|
"autocomplete",
|
|
|
|
};
|
|
|
|
|
2019-04-12 02:05:10 +03:00
|
|
|
callback constructor CustomElementConstructor = any ();
|
|
|
|
|
2019-03-19 15:59:54 +03:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 10:44:58 +03:00
|
|
|
callback CustomElementCreationCallback = undefined (DOMString name);
|
2021-10-25 17:28:04 +03:00
|
|
|
|
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 10:44:58 +03:00
|
|
|
callback LifecycleConnectedCallback = undefined();
|
2021-10-25 17:28:04 +03:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 10:44:58 +03:00
|
|
|
callback LifecycleDisconnectedCallback = undefined();
|
2021-10-25 17:28:04 +03:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 10:44:58 +03:00
|
|
|
callback LifecycleAdoptedCallback = undefined(Document? oldDocument,
|
|
|
|
Document? newDocment);
|
2021-10-25 17:28:04 +03:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 10:44:58 +03:00
|
|
|
callback LifecycleAttributeChangedCallback = undefined(DOMString attrName,
|
|
|
|
DOMString? oldValue,
|
|
|
|
DOMString? newValue,
|
|
|
|
DOMString? namespaceURI);
|
2021-10-25 17:28:04 +03:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 10:44:58 +03:00
|
|
|
callback LifecycleFormAssociatedCallback = undefined(HTMLFormElement? form);
|
2021-10-28 13:29:38 +03:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 10:44:58 +03:00
|
|
|
callback LifecycleFormResetCallback = undefined();
|
2021-10-25 17:28:05 +03:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2022-09-21 10:44:58 +03:00
|
|
|
callback LifecycleFormDisabledCallback = undefined(boolean disabled);
|
2021-10-25 23:43:11 +03:00
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2023-06-13 18:51:46 +03:00
|
|
|
callback LifecycleFormStateRestoreCallback = undefined((File or USVString or FormData)? state, RestoreReason reason);
|
|
|
|
[MOZ_CAN_RUN_SCRIPT_BOUNDARY]
|
2021-10-25 17:28:04 +03:00
|
|
|
callback LifecycleGetCustomInterfaceCallback = object?(any iid);
|
|
|
|
|
2023-01-26 03:52:46 +03:00
|
|
|
// Unsorted is necessary until https://github.com/whatwg/html/issues/3580 is resolved.
|
|
|
|
[GenerateInit, Unsorted]
|
2021-10-25 17:28:04 +03:00
|
|
|
dictionary LifecycleCallbacks {
|
|
|
|
LifecycleConnectedCallback connectedCallback;
|
|
|
|
LifecycleDisconnectedCallback disconnectedCallback;
|
|
|
|
LifecycleAdoptedCallback adoptedCallback;
|
|
|
|
LifecycleAttributeChangedCallback attributeChangedCallback;
|
2023-01-27 01:26:00 +03:00
|
|
|
[ChromeOnly] LifecycleGetCustomInterfaceCallback getCustomInterfaceCallback;
|
|
|
|
};
|
|
|
|
|
|
|
|
[GenerateInit, Unsorted]
|
|
|
|
dictionary FormAssociatedLifecycleCallbacks {
|
2021-10-28 13:29:38 +03:00
|
|
|
LifecycleFormAssociatedCallback formAssociatedCallback;
|
2021-10-25 17:28:05 +03:00
|
|
|
LifecycleFormResetCallback formResetCallback;
|
2021-10-25 23:43:11 +03:00
|
|
|
LifecycleFormDisabledCallback formDisabledCallback;
|
2023-06-13 18:51:46 +03:00
|
|
|
LifecycleFormStateRestoreCallback formStateRestoreCallback;
|
2021-10-25 17:28:04 +03:00
|
|
|
};
|