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 */
9
10[Exposed=Window]
11interface HTMLSelectElement : HTMLElement {
12  [HTMLConstructor] constructor();
13
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;
30
31  [ChromeOnly, Pure]
32  readonly attribute boolean isCombobox;
33
34  [Pure]
35  readonly attribute DOMString type;
36
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  void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
45  [CEReactions]
46  void remove(long index);
47  [CEReactions, Throws]
48  setter void (unsigned long index, HTMLOptionElement? option);
49
50  readonly attribute HTMLCollection selectedOptions;
51  [Pure]
52  attribute long selectedIndex;
53  [Pure]
54  attribute DOMString value;
55
56  readonly attribute boolean willValidate;
57  readonly attribute ValidityState validity;
58  [Throws]
59  readonly attribute DOMString validationMessage;
60  boolean checkValidity();
61  boolean reportValidity();
62  void setCustomValidity(DOMString error);
63
64  readonly attribute NodeList labels;
65
66  // https://www.w3.org/Bugs/Public/show_bug.cgi?id=20720
67  [CEReactions]
68  void remove();
69};
70
71// Chrome only interface
72
73partial interface HTMLSelectElement {
74  [ChromeOnly]
75  attribute boolean openInParentProcess;
76  [ChromeOnly]
77  AutocompleteInfo getAutocompleteInfo();
78  [ChromeOnly]
79  attribute DOMString previewValue;
80};
81