Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
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 file, |
michael@0 | 4 | * You can obtain one at http://mozilla.org/MPL/2.0/. |
michael@0 | 5 | * |
michael@0 | 6 | * The origin of this IDL file is |
michael@0 | 7 | * http://www.whatwg.org/specs/web-apps/current-work/#the-input-element |
michael@0 | 8 | * http://www.whatwg.org/specs/web-apps/current-work/#other-elements,-attributes-and-apis |
michael@0 | 9 | * |
michael@0 | 10 | * © Copyright 2004-2011 Apple Computer, Inc., Mozilla Foundation, and |
michael@0 | 11 | * Opera Software ASA. You are granted a license to use, reproduce |
michael@0 | 12 | * and create derivative works of this document. |
michael@0 | 13 | */ |
michael@0 | 14 | |
michael@0 | 15 | enum SelectionMode { |
michael@0 | 16 | "select", |
michael@0 | 17 | "start", |
michael@0 | 18 | "end", |
michael@0 | 19 | "preserve", |
michael@0 | 20 | }; |
michael@0 | 21 | |
michael@0 | 22 | interface nsIControllers; |
michael@0 | 23 | |
michael@0 | 24 | interface HTMLInputElement : HTMLElement { |
michael@0 | 25 | [Pure, SetterThrows] |
michael@0 | 26 | attribute DOMString accept; |
michael@0 | 27 | [Pure, SetterThrows] |
michael@0 | 28 | attribute DOMString alt; |
michael@0 | 29 | [Pure, SetterThrows] |
michael@0 | 30 | attribute DOMString autocomplete; |
michael@0 | 31 | [Pure, SetterThrows] |
michael@0 | 32 | attribute boolean autofocus; |
michael@0 | 33 | [Pure, SetterThrows] |
michael@0 | 34 | attribute boolean defaultChecked; |
michael@0 | 35 | [Pure] |
michael@0 | 36 | attribute boolean checked; |
michael@0 | 37 | // Bug 850337 - attribute DOMString dirName; |
michael@0 | 38 | [Pure, SetterThrows] |
michael@0 | 39 | attribute boolean disabled; |
michael@0 | 40 | readonly attribute HTMLFormElement? form; |
michael@0 | 41 | [Pure] |
michael@0 | 42 | readonly attribute FileList? files; |
michael@0 | 43 | [Throws, Pref="dom.input.dirpicker"] |
michael@0 | 44 | void openDirectoryPicker(); |
michael@0 | 45 | [Pure, SetterThrows] |
michael@0 | 46 | attribute DOMString formAction; |
michael@0 | 47 | [Pure, SetterThrows] |
michael@0 | 48 | attribute DOMString formEnctype; |
michael@0 | 49 | [Pure, SetterThrows] |
michael@0 | 50 | attribute DOMString formMethod; |
michael@0 | 51 | [Pure, SetterThrows] |
michael@0 | 52 | attribute boolean formNoValidate; |
michael@0 | 53 | [Pure, SetterThrows] |
michael@0 | 54 | attribute DOMString formTarget; |
michael@0 | 55 | [Pure, SetterThrows] |
michael@0 | 56 | attribute unsigned long height; |
michael@0 | 57 | [Pure] |
michael@0 | 58 | attribute boolean indeterminate; |
michael@0 | 59 | [Pure, SetterThrows, Pref="dom.forms.inputmode"] |
michael@0 | 60 | attribute DOMString inputMode; |
michael@0 | 61 | [Pure] |
michael@0 | 62 | readonly attribute HTMLElement? list; |
michael@0 | 63 | [Pure, SetterThrows] |
michael@0 | 64 | attribute DOMString max; |
michael@0 | 65 | [Pure, SetterThrows] |
michael@0 | 66 | attribute long maxLength; |
michael@0 | 67 | [Pure, SetterThrows] |
michael@0 | 68 | attribute DOMString min; |
michael@0 | 69 | [Pure, SetterThrows] |
michael@0 | 70 | attribute boolean multiple; |
michael@0 | 71 | [Pure, SetterThrows] |
michael@0 | 72 | attribute DOMString name; |
michael@0 | 73 | [Pure, SetterThrows] |
michael@0 | 74 | attribute DOMString pattern; |
michael@0 | 75 | [Pure, SetterThrows] |
michael@0 | 76 | attribute DOMString placeholder; |
michael@0 | 77 | [Pure, SetterThrows] |
michael@0 | 78 | attribute boolean readOnly; |
michael@0 | 79 | [Pure, SetterThrows] |
michael@0 | 80 | attribute boolean required; |
michael@0 | 81 | [Pure, SetterThrows] |
michael@0 | 82 | attribute unsigned long size; |
michael@0 | 83 | [Pure, SetterThrows] |
michael@0 | 84 | attribute DOMString src; |
michael@0 | 85 | [Pure, SetterThrows] |
michael@0 | 86 | attribute DOMString step; |
michael@0 | 87 | [Pure, SetterThrows] |
michael@0 | 88 | attribute DOMString type; |
michael@0 | 89 | [Pure, SetterThrows] |
michael@0 | 90 | attribute DOMString defaultValue; |
michael@0 | 91 | [Pure, TreatNullAs=EmptyString, SetterThrows] |
michael@0 | 92 | attribute DOMString value; |
michael@0 | 93 | [Throws, Pref="dom.experimental_forms"] |
michael@0 | 94 | attribute Date? valueAsDate; |
michael@0 | 95 | [Pure, SetterThrows] |
michael@0 | 96 | attribute unrestricted double valueAsNumber; |
michael@0 | 97 | attribute unsigned long width; |
michael@0 | 98 | |
michael@0 | 99 | [Throws] |
michael@0 | 100 | void stepUp(optional long n = 1); |
michael@0 | 101 | [Throws] |
michael@0 | 102 | void stepDown(optional long n = 1); |
michael@0 | 103 | |
michael@0 | 104 | [Pure] |
michael@0 | 105 | readonly attribute boolean willValidate; |
michael@0 | 106 | [Pure] |
michael@0 | 107 | readonly attribute ValidityState validity; |
michael@0 | 108 | [GetterThrows] |
michael@0 | 109 | readonly attribute DOMString validationMessage; |
michael@0 | 110 | boolean checkValidity(); |
michael@0 | 111 | void setCustomValidity(DOMString error); |
michael@0 | 112 | |
michael@0 | 113 | // Bug 850365 readonly attribute NodeList labels; |
michael@0 | 114 | |
michael@0 | 115 | void select(); |
michael@0 | 116 | |
michael@0 | 117 | [Throws] |
michael@0 | 118 | // TODO: unsigned vs signed |
michael@0 | 119 | attribute long selectionStart; |
michael@0 | 120 | [Throws] |
michael@0 | 121 | attribute long selectionEnd; |
michael@0 | 122 | [Throws] |
michael@0 | 123 | attribute DOMString selectionDirection; |
michael@0 | 124 | [Throws] |
michael@0 | 125 | void setRangeText(DOMString replacement); |
michael@0 | 126 | [Throws] |
michael@0 | 127 | void setRangeText(DOMString replacement, unsigned long start, |
michael@0 | 128 | unsigned long end, optional SelectionMode selectionMode = "preserve"); |
michael@0 | 129 | |
michael@0 | 130 | // also has obsolete members |
michael@0 | 131 | }; |
michael@0 | 132 | |
michael@0 | 133 | partial interface HTMLInputElement { |
michael@0 | 134 | [Pure, SetterThrows] |
michael@0 | 135 | attribute DOMString align; |
michael@0 | 136 | [Pure, SetterThrows] |
michael@0 | 137 | attribute DOMString useMap; |
michael@0 | 138 | }; |
michael@0 | 139 | |
michael@0 | 140 | // Mozilla extensions |
michael@0 | 141 | |
michael@0 | 142 | partial interface HTMLInputElement { |
michael@0 | 143 | [Throws] |
michael@0 | 144 | void setSelectionRange(long start, long end, optional DOMString direction); |
michael@0 | 145 | |
michael@0 | 146 | [GetterThrows, ChromeOnly] |
michael@0 | 147 | readonly attribute nsIControllers controllers; |
michael@0 | 148 | [GetterThrows] |
michael@0 | 149 | readonly attribute long textLength; |
michael@0 | 150 | |
michael@0 | 151 | [ChromeOnly] |
michael@0 | 152 | sequence<DOMString> mozGetFileNameArray(); |
michael@0 | 153 | |
michael@0 | 154 | [ChromeOnly] |
michael@0 | 155 | void mozSetFileNameArray(sequence<DOMString> fileNames); |
michael@0 | 156 | |
michael@0 | 157 | // Number controls (<input type=number>) have an anonymous text control |
michael@0 | 158 | // (<input type=text>) in the anonymous shadow tree that they contain. On |
michael@0 | 159 | // such an anonymous text control this property provides access to the |
michael@0 | 160 | // number control that owns the text control. This is useful, for example, |
michael@0 | 161 | // in code that looks at the currently focused element to make decisions |
michael@0 | 162 | // about which IME to bring up. Such code needs to be able to check for any |
michael@0 | 163 | // owning number control since it probably wants to bring up a number pad |
michael@0 | 164 | // instead of the standard keyboard, even when the anonymous text control has |
michael@0 | 165 | // focus. |
michael@0 | 166 | [ChromeOnly] |
michael@0 | 167 | readonly attribute HTMLInputElement? ownerNumberControl; |
michael@0 | 168 | |
michael@0 | 169 | boolean mozIsTextField(boolean aExcludePassword); |
michael@0 | 170 | }; |
michael@0 | 171 | |
michael@0 | 172 | partial interface HTMLInputElement { |
michael@0 | 173 | // Mirrored chrome-only nsIDOMNSEditableElement methods. Please make sure |
michael@0 | 174 | // to update this list if nsIDOMNSEditableElement changes. |
michael@0 | 175 | |
michael@0 | 176 | [Pure, ChromeOnly] |
michael@0 | 177 | readonly attribute nsIEditor? editor; |
michael@0 | 178 | |
michael@0 | 179 | // This is similar to set .value on nsIDOMInput/TextAreaElements, but handling |
michael@0 | 180 | // of the value change is closer to the normal user input, so 'change' event |
michael@0 | 181 | // for example will be dispatched when focusing out the element. |
michael@0 | 182 | [ChromeOnly] |
michael@0 | 183 | void setUserInput(DOMString input); |
michael@0 | 184 | }; |
michael@0 | 185 | |
michael@0 | 186 | [NoInterfaceObject] |
michael@0 | 187 | interface MozPhonetic { |
michael@0 | 188 | [Pure, ChromeOnly] |
michael@0 | 189 | readonly attribute DOMString phonetic; |
michael@0 | 190 | }; |
michael@0 | 191 | |
michael@0 | 192 | HTMLInputElement implements MozImageLoadingContent; |
michael@0 | 193 | HTMLInputElement implements MozPhonetic; |