michael@0: /* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsIDOMHTMLElement.idl" michael@0: #include "nsIDOMHTMLCollection.idl" michael@0: michael@0: interface nsIDOMHTMLOptionElement; michael@0: interface nsIDOMHTMLSelectElement; michael@0: michael@0: /** michael@0: * The nsIDOMHTMLOptionsCollection interface is the interface to a michael@0: * collection of [X]HTML option elements. michael@0: * michael@0: * This interface is trying to follow the DOM Level 2 HTML specification: michael@0: * http://www.w3.org/TR/DOM-Level-2-HTML/ michael@0: * michael@0: * with changes from the work-in-progress WHATWG HTML specification: michael@0: * http://www.whatwg.org/specs/web-apps/current-work/ michael@0: */ michael@0: michael@0: // Introduced in DOM Level 2: michael@0: [scriptable, uuid(4173cc53-30f6-4d12-a770-981ba53164e2)] michael@0: interface nsIDOMHTMLOptionsCollection : nsISupports michael@0: { michael@0: attribute unsigned long length; michael@0: // raises(DOMException) on setting michael@0: michael@0: // FIXME item should just be inherited from nsIDOMHTMLCollection michael@0: nsIDOMNode item(in unsigned long index); michael@0: michael@0: // FIXME namedItem (and getNamedItem) should return a NodeList if there are michael@0: // multiple matching items michael@0: nsIDOMNode namedItem(in DOMString name); michael@0: michael@0: attribute long selectedIndex; michael@0: michael@0: [noscript] void setOption(in unsigned long index, michael@0: in nsIDOMHTMLOptionElement option); michael@0: michael@0: [noscript] readonly attribute nsIDOMHTMLSelectElement select; michael@0: michael@0: // This add method implementation means the following michael@0: // since IDL doesn't support overloading. michael@0: // void add(in nsIDOMHTMLOptionElement, michael@0: // [optional] in nsIDOMHTMLOptionElement) michael@0: // void add(in nsIDOMHTMLOptionElement, in long) michael@0: void add(in nsIDOMHTMLOptionElement option, michael@0: [optional] in nsIVariant before); michael@0: void remove(in long index); michael@0: };