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 * http://www.whatwg.org/html/#the-select-element
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;
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;
32 readonly attribute DOMString type;
35 readonly attribute HTMLOptionsCollection options;
36 [CEReactions, SetterThrows, Pure]
37 attribute unsigned long length;
38 getter Element? item(unsigned long index);
39 HTMLOptionElement? namedItem(DOMString name);
41 void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
43 void remove(long index);
45 setter void (unsigned long index, HTMLOptionElement? option);
47 readonly attribute HTMLCollection selectedOptions;
49 attribute long selectedIndex;
51 attribute DOMString value;
53 readonly attribute boolean willValidate;
54 readonly attribute ValidityState validity;
56 readonly attribute DOMString validationMessage;
57 boolean checkValidity();
58 boolean reportValidity();
59 void setCustomValidity(DOMString error);
61 readonly attribute NodeList labels;
63 // https://www.w3.org/Bugs/Public/show_bug.cgi?id=20720
68 // Chrome only interface
70 partial interface HTMLSelectElement {
72 attribute boolean openInParentProcess;
74 AutocompleteInfo getAutocompleteInfo();
76 attribute DOMString previewValue;