Bug 1634779 - pt 2. Partially revert Bug 1603006 r=kmag
[gecko.git] / dom / webidl / HTMLSelectElement.webidl
blob0dd3d862247c44d25be49edb2257ef8016bc10ba
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   [Pure]
32   readonly attribute DOMString type;
34   [Constant]
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);
40   [CEReactions, Throws]
41   void add((HTMLOptionElement or HTMLOptGroupElement) element, optional (HTMLElement or long)? before = null);
42   [CEReactions]
43   void remove(long index);
44   [CEReactions, Throws]
45   setter void (unsigned long index, HTMLOptionElement? option);
47   readonly attribute HTMLCollection selectedOptions;
48   [Pure]
49   attribute long selectedIndex;
50   [Pure]
51   attribute DOMString value;
53   readonly attribute boolean willValidate;
54   readonly attribute ValidityState validity;
55   [Throws]
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
64   [CEReactions]
65   void remove();
68 // Chrome only interface
70 partial interface HTMLSelectElement {
71   [ChromeOnly]
72   attribute boolean openInParentProcess;
73   [ChromeOnly]
74   AutocompleteInfo getAutocompleteInfo();
75   [ChromeOnly]
76   attribute DOMString previewValue;