1/* 2 * Copyright (C) 2006, 2010 Apple Inc. All rights reserved. 3 * Copyright (C) 2006 Samuel Weinig <sam.weinig@gmail.com> 4 * Copyright (C) 2012 Samsung Electronics. All rights reserved. 5 * 6 * This library is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU Library General Public 8 * License as published by the Free Software Foundation; either 9 * version 2 of the License, or (at your option) any later version. 10 * 11 * This library is distributed in the hope that it will be useful, 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 14 * Library General Public License for more details. 15 * 16 * You should have received a copy of the GNU Library General Public License 17 * along with this library; see the file COPYING.LIB. If not, write to 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 * Boston, MA 02110-1301, USA. 20 */ 21 22interface HTMLInputElement : HTMLElement { 23 [Reflect] attribute DOMString accept; 24 [Reflect] attribute DOMString alt; 25 [Reflect] attribute DOMString autocomplete; 26 [Reflect] attribute boolean autofocus; 27 [Reflect=checked] attribute boolean defaultChecked; 28 attribute boolean checked; 29 [Reflect] attribute DOMString dirName; 30 [Reflect] attribute boolean disabled; 31 readonly attribute HTMLFormElement form; 32 attribute FileList files; 33 [Reflect, URL] attribute DOMString formAction; 34 [TreatNullAs=NullString] attribute DOMString formEnctype; 35 [TreatNullAs=NullString] attribute DOMString formMethod; 36 [Reflect] attribute boolean formNoValidate; 37 [Reflect] attribute DOMString formTarget; 38 attribute unsigned long height; 39 attribute boolean indeterminate; 40 [Conditional=DATALIST_ELEMENT] readonly attribute HTMLElement list; 41 [Reflect] attribute DOMString max; 42 [SetterRaisesException] attribute long maxLength; 43 [Reflect] attribute DOMString min; 44 [Reflect] attribute boolean multiple; 45 [Reflect] attribute DOMString name; 46 [Reflect] attribute DOMString pattern; 47 [Reflect] attribute DOMString placeholder; 48 [Reflect] attribute boolean readOnly; 49 [Reflect] attribute boolean required; 50#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C 51 [ObjCImplementedAsUnsignedLong] attribute DOMString size; // DOM level 2 changed this to a long, but ObjC API is a string 52#else 53 [SetterRaisesException] attribute unsigned long size; // Changed string -> long -> unsigned long 54#endif 55 [Reflect, URL] attribute DOMString src; 56 [Reflect] attribute DOMString step; 57 [TreatNullAs=NullString] attribute DOMString type; // readonly dropped as part of DOM level 2 58 [TreatNullAs=NullString] attribute DOMString defaultValue; 59 // See the discussion in https://bugs.webkit.org/show_bug.cgi?id=100085 60#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT 61 [TreatNullAs=NullString, SetterRaisesException] attribute DOMString value; 62#else 63 [TreatNullAs=NullString] attribute DOMString value; 64#endif 65#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP 66 [SetterRaisesException] attribute Date valueAsDate; 67#endif 68 [SetterRaisesException] attribute double valueAsNumber; 69 70 [RaisesException] void stepUp(optional long n); 71 [RaisesException] void stepDown(optional long n); 72 73 attribute unsigned long width; 74 readonly attribute boolean willValidate; 75 readonly attribute ValidityState validity; 76 readonly attribute DOMString validationMessage; 77 boolean checkValidity(); 78 void setCustomValidity([TreatNullAs=NullString, TreatUndefinedAs=NullString] DOMString error); 79 80 readonly attribute NodeList labels; 81 82 void select(); 83 [Custom] attribute long selectionStart; 84 [Custom] attribute long selectionEnd; 85 [Custom] attribute DOMString selectionDirection; 86 87 [RaisesException] void setRangeText(DOMString replacement); 88 [RaisesException] void setRangeText(DOMString replacement, 89 unsigned long start, 90 unsigned long end, 91 [Default=NullString] optional DOMString selectionMode); 92 93#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C 94 [Custom] void setSelectionRange(long start, long end); 95#else 96 [Custom] void setSelectionRange([Default=Undefined] optional long start, 97 [Default=Undefined] optional long end, 98 optional DOMString direction); 99#endif 100 101 // Non-standard attributes 102 [Reflect] attribute DOMString align; 103 [Conditional=DIRECTORY_UPLOAD, Reflect] attribute boolean webkitdirectory; 104 [Reflect] attribute DOMString useMap; 105 [Reflect] attribute boolean incremental; 106 [Conditional=INPUT_SPEECH, Reflect] attribute boolean webkitSpeech; 107 [Conditional=INPUT_SPEECH, Reflect] attribute boolean webkitGrammar; 108 [Conditional=INPUT_SPEECH, NotEnumerable] attribute EventListener onwebkitspeechchange; 109 110#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C 111 [Reflect] attribute DOMString accessKey; 112#endif 113 114#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C 115 void click(); 116#endif 117 118#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT 119 void setValueForUser([TreatNullAs=NullString] DOMString value); 120#endif 121 122#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C 123 // Objective-C extension: 124 readonly attribute DOMString altDisplayString; 125 readonly attribute URL absoluteImageURL; 126#endif 127 128 // See http://www.w3.org/TR/html-media-capture/ 129 [Conditional=MEDIA_CAPTURE] attribute DOMString capture; 130}; 131