1/* 2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Library General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Library General Public License for more details. 14 * 15 * You should have received a copy of the GNU Library General Public License 16 * along with this library; see the file COPYING.LIB. If not, write to 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 18 * Boston, MA 02110-1301, USA. 19 */ 20 21module html { 22 23 interface [ 24 HasIndexGetter, 25 HasCustomIndexSetter 26 ] HTMLSelectElement : HTMLElement { 27 readonly attribute DOMString type; 28 attribute long selectedIndex; 29 attribute [ConvertNullToNullString] DOMString value; 30 31 // Modified in DOM Level 2: 32#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C 33 readonly attribute long length; 34#else 35 attribute unsigned long length setter raises (DOMException); 36#endif 37 38 readonly attribute HTMLFormElement form; 39 readonly attribute ValidityState validity; 40 readonly attribute boolean willValidate; 41 readonly attribute DOMString validationMessage; 42 boolean checkValidity(); 43 void setCustomValidity(in [ConvertUndefinedOrNullToNullString] DOMString error); 44 45 // Modified in DOM Level 2: 46 readonly attribute HTMLOptionsCollection options; 47 48 attribute [Reflect] boolean disabled; 49 attribute [Reflect] boolean autofocus; 50 attribute boolean multiple; 51 attribute [ConvertNullToNullString] DOMString name; 52 attribute [Reflect] boolean required; 53 attribute long size; 54 55 [OldStyleObjC] void add(in HTMLElement element, in HTMLElement before) raises(DOMException); 56 57#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT 58 // In JavaScript, we support both option index and option object parameters. 59 // As of this writing this cannot be auto-generated. 60 [Custom] void remove(/* indexOrOption */); 61#else 62 void remove(in long index); 63#endif 64 65 // These methods are not in DOM Level 2 IDL, but are mentioned in the standard: 66 // "The contained options can be directly accessed through the select element as a collection." 67 Node item(in [IsIndex] unsigned long index); 68 Node namedItem(in DOMString name); 69 readonly attribute NodeList labels; 70 }; 71 72} 73