Wed, 31 Dec 2014 06:55:50 +0100
Added tag UPSTREAM_283F7C6 for changeset ca08bd8f51b2
michael@0 | 1 | /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #include "nsIDOMHTMLElement.idl" |
michael@0 | 7 | #include "nsIDOMHTMLCollection.idl" |
michael@0 | 8 | |
michael@0 | 9 | interface nsIDOMHTMLOptionElement; |
michael@0 | 10 | interface nsIDOMHTMLSelectElement; |
michael@0 | 11 | |
michael@0 | 12 | /** |
michael@0 | 13 | * The nsIDOMHTMLOptionsCollection interface is the interface to a |
michael@0 | 14 | * collection of [X]HTML option elements. |
michael@0 | 15 | * |
michael@0 | 16 | * This interface is trying to follow the DOM Level 2 HTML specification: |
michael@0 | 17 | * http://www.w3.org/TR/DOM-Level-2-HTML/ |
michael@0 | 18 | * |
michael@0 | 19 | * with changes from the work-in-progress WHATWG HTML specification: |
michael@0 | 20 | * http://www.whatwg.org/specs/web-apps/current-work/ |
michael@0 | 21 | */ |
michael@0 | 22 | |
michael@0 | 23 | // Introduced in DOM Level 2: |
michael@0 | 24 | [scriptable, uuid(4173cc53-30f6-4d12-a770-981ba53164e2)] |
michael@0 | 25 | interface nsIDOMHTMLOptionsCollection : nsISupports |
michael@0 | 26 | { |
michael@0 | 27 | attribute unsigned long length; |
michael@0 | 28 | // raises(DOMException) on setting |
michael@0 | 29 | |
michael@0 | 30 | // FIXME item should just be inherited from nsIDOMHTMLCollection |
michael@0 | 31 | nsIDOMNode item(in unsigned long index); |
michael@0 | 32 | |
michael@0 | 33 | // FIXME namedItem (and getNamedItem) should return a NodeList if there are |
michael@0 | 34 | // multiple matching items |
michael@0 | 35 | nsIDOMNode namedItem(in DOMString name); |
michael@0 | 36 | |
michael@0 | 37 | attribute long selectedIndex; |
michael@0 | 38 | |
michael@0 | 39 | [noscript] void setOption(in unsigned long index, |
michael@0 | 40 | in nsIDOMHTMLOptionElement option); |
michael@0 | 41 | |
michael@0 | 42 | [noscript] readonly attribute nsIDOMHTMLSelectElement select; |
michael@0 | 43 | |
michael@0 | 44 | // This add method implementation means the following |
michael@0 | 45 | // since IDL doesn't support overloading. |
michael@0 | 46 | // void add(in nsIDOMHTMLOptionElement, |
michael@0 | 47 | // [optional] in nsIDOMHTMLOptionElement) |
michael@0 | 48 | // void add(in nsIDOMHTMLOptionElement, in long) |
michael@0 | 49 | void add(in nsIDOMHTMLOptionElement option, |
michael@0 | 50 | [optional] in nsIVariant before); |
michael@0 | 51 | void remove(in long index); |
michael@0 | 52 | }; |