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
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
6 * The origin of this IDL file is
7 * https://html.spec.whatwg.org/#elementinternals
11 interface ElementInternals {
13 readonly attribute ShadowRoot? shadowRoot;
15 // Form-associated custom elements
17 undefined setFormValue((File or USVString or FormData)? value,
18 optional (File or USVString or FormData)? state);
21 readonly attribute HTMLFormElement? form;
24 undefined setValidity(optional ValidityStateFlags flags = {},
25 optional DOMString message,
26 optional HTMLElement anchor);
28 readonly attribute boolean willValidate;
30 readonly attribute ValidityState validity;
32 readonly attribute DOMString validationMessage;
34 boolean checkValidity();
36 boolean reportValidity();
39 readonly attribute NodeList labels;
41 [Pref="dom.element.customstateset.enabled", SameObject] readonly attribute CustomStateSet states;
44 [Pref="dom.element.customstateset.enabled", Exposed=Window]
45 interface CustomStateSet {
49 partial interface CustomStateSet {
50 // Setlike methods need to be overriden.
52 undefined add(DOMString state);
55 boolean delete(DOMString state);
61 partial interface ElementInternals {
63 readonly attribute HTMLElement? validationAnchor;
66 ElementInternals includes ARIAMixin;
68 dictionary ValidityStateFlags {
69 boolean valueMissing = false;
70 boolean typeMismatch = false;
71 boolean patternMismatch = false;
72 boolean tooLong = false;
73 boolean tooShort = false;
74 boolean rangeUnderflow = false;
75 boolean rangeOverflow = false;
76 boolean stepMismatch = false;
77 boolean badInput = false;
78 boolean customError = false;