|
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 "nsIDOMHTMLCollection.idl" |
|
8 |
|
9 interface nsIDOMHTMLOptionElement; |
|
10 interface nsIDOMHTMLSelectElement; |
|
11 |
|
12 /** |
|
13 * The nsIDOMHTMLOptionsCollection interface is the interface to a |
|
14 * collection of [X]HTML option elements. |
|
15 * |
|
16 * This interface is trying to follow the DOM Level 2 HTML specification: |
|
17 * http://www.w3.org/TR/DOM-Level-2-HTML/ |
|
18 * |
|
19 * with changes from the work-in-progress WHATWG HTML specification: |
|
20 * http://www.whatwg.org/specs/web-apps/current-work/ |
|
21 */ |
|
22 |
|
23 // Introduced in DOM Level 2: |
|
24 [scriptable, uuid(4173cc53-30f6-4d12-a770-981ba53164e2)] |
|
25 interface nsIDOMHTMLOptionsCollection : nsISupports |
|
26 { |
|
27 attribute unsigned long length; |
|
28 // raises(DOMException) on setting |
|
29 |
|
30 // FIXME item should just be inherited from nsIDOMHTMLCollection |
|
31 nsIDOMNode item(in unsigned long index); |
|
32 |
|
33 // FIXME namedItem (and getNamedItem) should return a NodeList if there are |
|
34 // multiple matching items |
|
35 nsIDOMNode namedItem(in DOMString name); |
|
36 |
|
37 attribute long selectedIndex; |
|
38 |
|
39 [noscript] void setOption(in unsigned long index, |
|
40 in nsIDOMHTMLOptionElement option); |
|
41 |
|
42 [noscript] readonly attribute nsIDOMHTMLSelectElement select; |
|
43 |
|
44 // This add method implementation means the following |
|
45 // since IDL doesn't support overloading. |
|
46 // void add(in nsIDOMHTMLOptionElement, |
|
47 // [optional] in nsIDOMHTMLOptionElement) |
|
48 // void add(in nsIDOMHTMLOptionElement, in long) |
|
49 void add(in nsIDOMHTMLOptionElement option, |
|
50 [optional] in nsIVariant before); |
|
51 void remove(in long index); |
|
52 }; |