|
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 #include "nsIDOMHTMLElement.idl" |
|
7 #include "nsIDOMHTMLOptionsCollection.idl" |
|
8 |
|
9 /** |
|
10 * The nsIDOMHTMLSelectElement interface is the interface to a [X]HTML |
|
11 * select element. |
|
12 * |
|
13 * This interface is trying to follow the DOM Level 2 HTML specification: |
|
14 * http://www.w3.org/TR/DOM-Level-2-HTML/ |
|
15 * |
|
16 * with changes from the work-in-progress WHATWG HTML specification: |
|
17 * http://www.whatwg.org/specs/web-apps/current-work/ |
|
18 */ |
|
19 |
|
20 interface nsIDOMValidityState; |
|
21 |
|
22 [scriptable, uuid(d8914a2d-3556-4b66-911c-a84c4394e7fa)] |
|
23 interface nsIDOMHTMLSelectElement : nsISupports |
|
24 { |
|
25 attribute boolean autofocus; |
|
26 attribute boolean disabled; |
|
27 readonly attribute nsIDOMHTMLFormElement form; |
|
28 attribute boolean multiple; |
|
29 attribute DOMString name; |
|
30 attribute unsigned long size; |
|
31 |
|
32 readonly attribute DOMString type; |
|
33 |
|
34 readonly attribute nsIDOMHTMLOptionsCollection options; |
|
35 attribute unsigned long length; |
|
36 nsIDOMNode item(in unsigned long index); |
|
37 nsIDOMNode namedItem(in DOMString name); |
|
38 // This add method implementation means the following |
|
39 // since IDL doesn't support overfload. |
|
40 // void add(in nsIDOMHTMLElement, [optional] in nsIDOMHTMLElement) |
|
41 // void add(in nsIDOMHTMLElement, in long) |
|
42 void add(in nsIDOMHTMLElement element, |
|
43 [optional] in nsIVariant before) |
|
44 raises(DOMException); |
|
45 void remove(in long index); |
|
46 |
|
47 readonly attribute nsIDOMHTMLCollection selectedOptions; |
|
48 attribute long selectedIndex; |
|
49 attribute DOMString value; |
|
50 |
|
51 // The following lines are part of the constraint validation API, see: |
|
52 // http://www.whatwg.org/specs/web-apps/current-work/#the-constraint-validation-api |
|
53 readonly attribute boolean willValidate; |
|
54 readonly attribute nsIDOMValidityState validity; |
|
55 readonly attribute DOMString validationMessage; |
|
56 boolean checkValidity(); |
|
57 void setCustomValidity(in DOMString error); |
|
58 |
|
59 attribute boolean required; |
|
60 }; |