Bug 1787199 [wpt PR 35620] - Add tests for `VisibilityStateEntry`, a=testonly
[gecko.git] / dom / webidl / HTMLSelectElement.webidl
blobe9cc960fd8ff2eaf7fe63b0b0176cc128c139e8b
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/.
5  *
6  * The origin of this IDL file is
7  * http://www.whatwg.org/html/#the-select-element
8  */
10 [Exposed=Window]
11 interface HTMLSelectElement : HTMLElement {
12   [HTMLConstructor] constructor();
14   [CEReactions, SetterThrows, Pure]
15   attribute boolean autofocus;
16   [CEReactions, SetterThrows, Pure]
17   attribute DOMString autocomplete;
18   [CEReactions, SetterThrows, Pure]
19   attribute boolean disabled;
20   [Pure]
21   readonly attribute HTMLFormElement? form;
22   [CEReactions, SetterThrows, Pure]
23   attribute boolean multiple;
24   [CEReactions, SetterThrows, Pure]
25   attribute DOMString name;
26   [CEReactions, SetterThrows, Pure]
27   attribute boolean required;
28   [CEReactions, SetterThrows, Pure]
29   attribute unsigned long size;
31   [ChromeOnly, Pure]
32   readonly attribute boolean isCombobox;
34   [Pure]
35   readonly attribute DOMString type;
37   [Constant]
38   readonly attribute HTMLOptionsCollection options;
39   [CEReactions, SetterThrows, Pure]
40   attribute unsigned long length;
41   getter Element? item(unsigned long index);
42   HTMLOptionElement? namedItem(DOMString name);
43   [CEReactions, Throws]
44   undefined add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
45   [CEReactions]
46   undefined remove(long index);
47   [CEReactions, Throws]
48   setter undefined (unsigned long index, HTMLOptionElement? option);
50   readonly attribute HTMLCollection selectedOptions;
51   [Pure]
52   attribute long selectedIndex;
53   [Pure]
54   attribute DOMString value;
56   readonly attribute boolean willValidate;
57   readonly attribute ValidityState validity;
58   [Throws]
59   readonly attribute DOMString validationMessage;
60   boolean checkValidity();
61   boolean reportValidity();
62   undefined setCustomValidity(DOMString error);
64   readonly attribute NodeList labels;
66   // https://www.w3.org/Bugs/Public/show_bug.cgi?id=20720
67   [CEReactions]
68   undefined remove();
71 // Chrome only interface
73 partial interface HTMLSelectElement {
74   [ChromeOnly]
75   attribute boolean openInParentProcess;
76   [ChromeOnly]
77   AutocompleteInfo getAutocompleteInfo();
78   [ChromeOnly]
79   attribute DOMString previewValue;