OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
6 | 6 |
7 /// @domName $DOMNAME | 7 @DomName('$DOMNAME') |
8 class $CLASSNAME$EXTENDS implements | 8 class $CLASSNAME$EXTENDS implements |
9 HiddenInputElement, | 9 HiddenInputElement, |
10 SearchInputElement, | 10 SearchInputElement, |
11 TextInputElement, | 11 TextInputElement, |
12 UrlInputElement, | 12 UrlInputElement, |
13 TelephoneInputElement, | 13 TelephoneInputElement, |
14 EmailInputElement, | 14 EmailInputElement, |
15 PasswordInputElement, | 15 PasswordInputElement, |
16 DateTimeInputElement, | 16 DateTimeInputElement, |
17 DateInputElement, | 17 DateInputElement, |
18 MonthInputElement, | 18 MonthInputElement, |
19 WeekInputElement, | 19 WeekInputElement, |
20 TimeInputElement, | 20 TimeInputElement, |
21 LocalDateTimeInputElement, | 21 LocalDateTimeInputElement, |
22 NumberInputElement, | 22 NumberInputElement, |
23 RangeInputElement, | 23 RangeInputElement, |
24 CheckboxInputElement, | 24 CheckboxInputElement, |
25 RadioButtonInputElement, | 25 RadioButtonInputElement, |
26 FileUploadInputElement, | 26 FileUploadInputElement, |
27 SubmitButtonInputElement, | 27 SubmitButtonInputElement, |
28 ImageButtonInputElement, | 28 ImageButtonInputElement, |
29 ResetButtonInputElement, | 29 ResetButtonInputElement, |
30 ButtonInputElement | 30 ButtonInputElement |
31 $NATIVESPEC { | 31 $NATIVESPEC { |
32 | 32 |
33 ///@docsEditable true | 33 /// @docsEditable true |
34 factory InputElement({String type}) { | 34 factory InputElement({String type}) { |
35 var e = document.$dom_createElement("input"); | 35 var e = document.$dom_createElement("input"); |
36 if (type != null) { | 36 if (type != null) { |
37 try { | 37 try { |
38 // IE throws an exception for unknown types. | 38 // IE throws an exception for unknown types. |
39 e.type = type; | 39 e.type = type; |
40 } catch(_) {} | 40 } catch(_) {} |
41 } | 41 } |
42 return e; | 42 return e; |
43 } | 43 } |
44 $!MEMBERS | 44 $!MEMBERS |
45 } | 45 } |
46 | 46 |
47 | 47 |
48 // Interfaces representing the InputElement APIs which are supported | 48 // Interfaces representing the InputElement APIs which are supported |
49 // for the various types of InputElement. | 49 // for the various types of InputElement. |
50 // From http://dev.w3.org/html5/spec/the-input-element.html#the-input-element. | 50 // From http://dev.w3.org/html5/spec/the-input-element.html#the-input-element. |
51 | 51 |
52 /** | 52 /** |
53 * Exposes the functionality common between all InputElement types. | 53 * Exposes the functionality common between all InputElement types. |
54 */ | 54 */ |
55 abstract class InputElementBase implements Element { | 55 abstract class InputElementBase implements Element { |
56 /// @domName HTMLInputElement.autofocus | 56 @DomName('HTMLInputElement.autofocus') |
57 bool autofocus; | 57 bool autofocus; |
58 | 58 |
59 /// @domName HTMLInputElement.disabled | 59 @DomName('HTMLInputElement.disabled') |
60 bool disabled; | 60 bool disabled; |
61 | 61 |
62 /// @domName HTMLInputElement.incremental | 62 @DomName('HTMLInputElement.incremental') |
63 bool incremental; | 63 bool incremental; |
64 | 64 |
65 /// @domName HTMLInputElement.indeterminate | 65 @DomName('HTMLInputElement.indeterminate') |
66 bool indeterminate; | 66 bool indeterminate; |
67 | 67 |
68 /// @domName HTMLInputElement.labels | 68 @DomName('HTMLInputElement.labels') |
69 List<Node> get labels; | 69 List<Node> get labels; |
70 | 70 |
71 /// @domName HTMLInputElement.name | 71 @DomName('HTMLInputElement.name') |
72 String name; | 72 String name; |
73 | 73 |
74 /// @domName HTMLInputElement.validationMessage | 74 @DomName('HTMLInputElement.validationMessage') |
75 String get validationMessage; | 75 String get validationMessage; |
76 | 76 |
77 /// @domName HTMLInputElement.validity | 77 @DomName('HTMLInputElement.validity') |
78 ValidityState get validity; | 78 ValidityState get validity; |
79 | 79 |
80 /// @domName HTMLInputElement.value | 80 @DomName('HTMLInputElement.value') |
81 String value; | 81 String value; |
82 | 82 |
83 /// @domName HTMLInputElement.willValidate | 83 @DomName('HTMLInputElement.willValidate') |
84 bool get willValidate; | 84 bool get willValidate; |
85 | 85 |
86 /// @domName HTMLInputElement.checkValidity | 86 @DomName('HTMLInputElement.checkValidity') |
87 bool checkValidity(); | 87 bool checkValidity(); |
88 | 88 |
89 /// @domName HTMLInputElement.setCustomValidity | 89 @DomName('HTMLInputElement.setCustomValidity') |
90 void setCustomValidity(String error); | 90 void setCustomValidity(String error); |
91 } | 91 } |
92 | 92 |
93 /** | 93 /** |
94 * Hidden input which is not intended to be seen or edited by the user. | 94 * Hidden input which is not intended to be seen or edited by the user. |
95 */ | 95 */ |
96 abstract class HiddenInputElement implements Element { | 96 abstract class HiddenInputElement implements Element { |
97 factory HiddenInputElement() => new InputElement(type: 'hidden'); | 97 factory HiddenInputElement() => new InputElement(type: 'hidden'); |
98 } | 98 } |
99 | 99 |
100 | 100 |
101 /** | 101 /** |
102 * Base interface for all inputs which involve text editing. | 102 * Base interface for all inputs which involve text editing. |
103 */ | 103 */ |
104 abstract class TextInputElementBase implements InputElementBase { | 104 abstract class TextInputElementBase implements InputElementBase { |
105 /// @domName HTMLInputElement.autocomplete | 105 @DomName('HTMLInputElement.autocomplete') |
106 String autocomplete; | 106 String autocomplete; |
107 | 107 |
108 /// @domName HTMLInputElement.maxLength | 108 @DomName('HTMLInputElement.maxLength') |
109 int maxLength; | 109 int maxLength; |
110 | 110 |
111 /// @domName HTMLInputElement.pattern | 111 @DomName('HTMLInputElement.pattern') |
112 String pattern; | 112 String pattern; |
113 | 113 |
114 /// @domName HTMLInputElement.placeholder | 114 @DomName('HTMLInputElement.placeholder') |
115 String placeholder; | 115 String placeholder; |
116 | 116 |
117 /// @domName HTMLInputElement.readOnly | 117 @DomName('HTMLInputElement.readOnly') |
118 bool readOnly; | 118 bool readOnly; |
119 | 119 |
120 /// @domName HTMLInputElement.required | 120 @DomName('HTMLInputElement.required') |
121 bool required; | 121 bool required; |
122 | 122 |
123 /// @domName HTMLInputElement.size | 123 @DomName('HTMLInputElement.size') |
124 int size; | 124 int size; |
125 | 125 |
126 /// @domName HTMLInputElement.select | 126 @DomName('HTMLInputElement.select') |
127 void select(); | 127 void select(); |
128 | 128 |
129 /// @domName HTMLInputElement.selectionDirection | 129 @DomName('HTMLInputElement.selectionDirection') |
130 String selectionDirection; | 130 String selectionDirection; |
131 | 131 |
132 /// @domName HTMLInputElement.selectionEnd | 132 @DomName('HTMLInputElement.selectionEnd') |
133 int selectionEnd; | 133 int selectionEnd; |
134 | 134 |
135 /// @domName HTMLInputElement.selectionStart | 135 @DomName('HTMLInputElement.selectionStart') |
136 int selectionStart; | 136 int selectionStart; |
137 | 137 |
138 /// @domName HTMLInputElement.setSelectionRange | 138 @DomName('HTMLInputElement.setSelectionRange') |
139 void setSelectionRange(int start, int end, [String direction]); | 139 void setSelectionRange(int start, int end, [String direction]); |
140 } | 140 } |
141 | 141 |
142 /** | 142 /** |
143 * Similar to [TextInputElement], but on platforms where search is styled | 143 * Similar to [TextInputElement], but on platforms where search is styled |
144 * differently this will get the search style. | 144 * differently this will get the search style. |
145 * | 145 * |
146 * Use [supported] to check if this is supported on the current platform. | 146 * Use [supported] to check if this is supported on the current platform. |
147 */ | 147 */ |
148 @SupportedBrowser(SupportedBrowser.CHROME) | 148 @SupportedBrowser(SupportedBrowser.CHROME) |
149 @SupportedBrowser(SupportedBrowser.FIREFOX) | 149 @SupportedBrowser(SupportedBrowser.FIREFOX) |
150 @SupportedBrowser(SupportedBrowser.IE, '10') | 150 @SupportedBrowser(SupportedBrowser.IE, '10') |
151 @SupportedBrowser(SupportedBrowser.SAFARI) | 151 @SupportedBrowser(SupportedBrowser.SAFARI) |
152 abstract class SearchInputElement implements TextInputElementBase { | 152 abstract class SearchInputElement implements TextInputElementBase { |
153 factory SearchInputElement() => new InputElement(type: 'search'); | 153 factory SearchInputElement() => new InputElement(type: 'search'); |
154 | 154 |
155 /// @domName HTMLInputElement.dirName; | 155 @DomName('HTMLInputElement.dirName') |
156 String dirName; | 156 String dirName; |
157 | 157 |
158 /// @domName HTMLInputElement.list; | 158 @DomName('HTMLInputElement.list') |
159 Element get list; | 159 Element get list; |
160 | 160 |
161 /// Returns true if this input type is supported on the current platform. | 161 /// Returns true if this input type is supported on the current platform. |
162 static bool get supported { | 162 static bool get supported { |
163 return (new InputElement(type: 'search')).type == 'search'; | 163 return (new InputElement(type: 'search')).type == 'search'; |
164 } | 164 } |
165 } | 165 } |
166 | 166 |
167 /** | 167 /** |
168 * A basic text input editor control. | 168 * A basic text input editor control. |
169 */ | 169 */ |
170 abstract class TextInputElement implements TextInputElementBase { | 170 abstract class TextInputElement implements TextInputElementBase { |
171 factory TextInputElement() => new InputElement(type: 'text'); | 171 factory TextInputElement() => new InputElement(type: 'text'); |
172 | 172 |
173 /// @domName HTMLInputElement.dirName; | 173 @DomName('HTMLInputElement.dirName') |
174 String dirName; | 174 String dirName; |
175 | 175 |
176 /// @domName HTMLInputElement.list; | 176 @DomName('HTMLInputElement.list') |
177 Element get list; | 177 Element get list; |
178 } | 178 } |
179 | 179 |
180 /** | 180 /** |
181 * A control for editing an absolute URL. | 181 * A control for editing an absolute URL. |
182 * | 182 * |
183 * Use [supported] to check if this is supported on the current platform. | 183 * Use [supported] to check if this is supported on the current platform. |
184 */ | 184 */ |
185 @SupportedBrowser(SupportedBrowser.CHROME) | 185 @SupportedBrowser(SupportedBrowser.CHROME) |
186 @SupportedBrowser(SupportedBrowser.FIREFOX) | 186 @SupportedBrowser(SupportedBrowser.FIREFOX) |
187 @SupportedBrowser(SupportedBrowser.IE, '10') | 187 @SupportedBrowser(SupportedBrowser.IE, '10') |
188 @SupportedBrowser(SupportedBrowser.SAFARI) | 188 @SupportedBrowser(SupportedBrowser.SAFARI) |
189 abstract class UrlInputElement implements TextInputElementBase { | 189 abstract class UrlInputElement implements TextInputElementBase { |
190 factory UrlInputElement() => new InputElement(type: 'url'); | 190 factory UrlInputElement() => new InputElement(type: 'url'); |
191 | 191 |
192 /// @domName HTMLInputElement.list; | 192 @DomName('HTMLInputElement.list') |
193 Element get list; | 193 Element get list; |
194 | 194 |
195 /// Returns true if this input type is supported on the current platform. | 195 /// Returns true if this input type is supported on the current platform. |
196 static bool get supported { | 196 static bool get supported { |
197 return (new InputElement(type: 'url')).type == 'url'; | 197 return (new InputElement(type: 'url')).type == 'url'; |
198 } | 198 } |
199 } | 199 } |
200 | 200 |
201 /** | 201 /** |
202 * Represents a control for editing a telephone number. | 202 * Represents a control for editing a telephone number. |
203 * | 203 * |
204 * This provides a single line of text with minimal formatting help since | 204 * This provides a single line of text with minimal formatting help since |
205 * there is a wide variety of telephone numbers. | 205 * there is a wide variety of telephone numbers. |
206 * | 206 * |
207 * Use [supported] to check if this is supported on the current platform. | 207 * Use [supported] to check if this is supported on the current platform. |
208 */ | 208 */ |
209 @SupportedBrowser(SupportedBrowser.CHROME) | 209 @SupportedBrowser(SupportedBrowser.CHROME) |
210 @SupportedBrowser(SupportedBrowser.FIREFOX) | 210 @SupportedBrowser(SupportedBrowser.FIREFOX) |
211 @SupportedBrowser(SupportedBrowser.IE, '10') | 211 @SupportedBrowser(SupportedBrowser.IE, '10') |
212 @SupportedBrowser(SupportedBrowser.SAFARI) | 212 @SupportedBrowser(SupportedBrowser.SAFARI) |
213 abstract class TelephoneInputElement implements TextInputElementBase { | 213 abstract class TelephoneInputElement implements TextInputElementBase { |
214 factory TelephoneInputElement() => new InputElement(type: 'tel'); | 214 factory TelephoneInputElement() => new InputElement(type: 'tel'); |
215 | 215 |
216 /// @domName HTMLInputElement.list; | 216 @DomName('HTMLInputElement.list') |
217 Element get list; | 217 Element get list; |
218 | 218 |
219 /// Returns true if this input type is supported on the current platform. | 219 /// Returns true if this input type is supported on the current platform. |
220 static bool get supported { | 220 static bool get supported { |
221 return (new InputElement(type: 'tel')).type == 'tel'; | 221 return (new InputElement(type: 'tel')).type == 'tel'; |
222 } | 222 } |
223 } | 223 } |
224 | 224 |
225 /** | 225 /** |
226 * An e-mail address or list of e-mail addresses. | 226 * An e-mail address or list of e-mail addresses. |
227 * | 227 * |
228 * Use [supported] to check if this is supported on the current platform. | 228 * Use [supported] to check if this is supported on the current platform. |
229 */ | 229 */ |
230 @SupportedBrowser(SupportedBrowser.CHROME) | 230 @SupportedBrowser(SupportedBrowser.CHROME) |
231 @SupportedBrowser(SupportedBrowser.FIREFOX) | 231 @SupportedBrowser(SupportedBrowser.FIREFOX) |
232 @SupportedBrowser(SupportedBrowser.IE, '10') | 232 @SupportedBrowser(SupportedBrowser.IE, '10') |
233 @SupportedBrowser(SupportedBrowser.SAFARI) | 233 @SupportedBrowser(SupportedBrowser.SAFARI) |
234 abstract class EmailInputElement implements TextInputElementBase { | 234 abstract class EmailInputElement implements TextInputElementBase { |
235 factory EmailInputElement() => new InputElement(type: 'email'); | 235 factory EmailInputElement() => new InputElement(type: 'email'); |
236 | 236 |
237 /// @domName HTMLInputElement.autocomplete | 237 @DomName('HTMLInputElement.autocomplete') |
238 String autocomplete; | 238 String autocomplete; |
239 | 239 |
240 /// @domName HTMLInputElement.autofocus | 240 @DomName('HTMLInputElement.autofocus') |
241 bool autofocus; | 241 bool autofocus; |
242 | 242 |
243 /// @domName HTMLInputElement.list; | 243 @DomName('HTMLInputElement.list') |
244 Element get list; | 244 Element get list; |
245 | 245 |
246 /// @domName HTMLInputElement.maxLength | 246 @DomName('HTMLInputElement.maxLength') |
247 int maxLength; | 247 int maxLength; |
248 | 248 |
249 /// @domName HTMLInputElement.multiple; | 249 @DomName('HTMLInputElement.multiple') |
250 bool multiple; | 250 bool multiple; |
251 | 251 |
252 /// @domName HTMLInputElement.pattern | 252 @DomName('HTMLInputElement.pattern') |
253 String pattern; | 253 String pattern; |
254 | 254 |
255 /// @domName HTMLInputElement.placeholder | 255 @DomName('HTMLInputElement.placeholder') |
256 String placeholder; | 256 String placeholder; |
257 | 257 |
258 /// @domName HTMLInputElement.readOnly | 258 @DomName('HTMLInputElement.readOnly') |
259 bool readOnly; | 259 bool readOnly; |
260 | 260 |
261 /// @domName HTMLInputElement.required | 261 @DomName('HTMLInputElement.required') |
262 bool required; | 262 bool required; |
263 | 263 |
264 /// @domName HTMLInputElement.size | 264 @DomName('HTMLInputElement.size') |
265 int size; | 265 int size; |
266 | 266 |
267 /// Returns true if this input type is supported on the current platform. | 267 /// Returns true if this input type is supported on the current platform. |
268 static bool get supported { | 268 static bool get supported { |
269 return (new InputElement(type: 'email')).type == 'email'; | 269 return (new InputElement(type: 'email')).type == 'email'; |
270 } | 270 } |
271 } | 271 } |
272 | 272 |
273 /** | 273 /** |
274 * Text with no line breaks (sensitive information). | 274 * Text with no line breaks (sensitive information). |
275 */ | 275 */ |
276 abstract class PasswordInputElement implements TextInputElementBase { | 276 abstract class PasswordInputElement implements TextInputElementBase { |
277 factory PasswordInputElement() => new InputElement(type: 'password'); | 277 factory PasswordInputElement() => new InputElement(type: 'password'); |
278 } | 278 } |
279 | 279 |
280 /** | 280 /** |
281 * Base interface for all input element types which involve ranges. | 281 * Base interface for all input element types which involve ranges. |
282 */ | 282 */ |
283 abstract class RangeInputElementBase implements InputElementBase { | 283 abstract class RangeInputElementBase implements InputElementBase { |
284 | 284 |
285 /// @domName HTMLInputElement.list | 285 @DomName('HTMLInputElement.list') |
286 Element get list; | 286 Element get list; |
287 | 287 |
288 /// @domName HTMLInputElement.max | 288 @DomName('HTMLInputElement.max') |
289 String max; | 289 String max; |
290 | 290 |
291 /// @domName HTMLInputElement.min | 291 @DomName('HTMLInputElement.min') |
292 String min; | 292 String min; |
293 | 293 |
294 /// @domName HTMLInputElement.step | 294 @DomName('HTMLInputElement.step') |
295 String step; | 295 String step; |
296 | 296 |
297 /// @domName HTMLInputElement.valueAsNumber | 297 @DomName('HTMLInputElement.valueAsNumber') |
298 num valueAsNumber; | 298 num valueAsNumber; |
299 | 299 |
300 /// @domName HTMLInputElement.stepDown | 300 @DomName('HTMLInputElement.stepDown') |
301 void stepDown([int n]); | 301 void stepDown([int n]); |
302 | 302 |
303 /// @domName HTMLInputElement.stepUp | 303 @DomName('HTMLInputElement.stepUp') |
304 void stepUp([int n]); | 304 void stepUp([int n]); |
305 } | 305 } |
306 | 306 |
307 /** | 307 /** |
308 * A date and time (year, month, day, hour, minute, second, fraction of a | 308 * A date and time (year, month, day, hour, minute, second, fraction of a |
309 * second) with the time zone set to UTC. | 309 * second) with the time zone set to UTC. |
310 * | 310 * |
311 * Use [supported] to check if this is supported on the current platform. | 311 * Use [supported] to check if this is supported on the current platform. |
312 */ | 312 */ |
313 @SupportedBrowser(SupportedBrowser.CHROME, '25') | 313 @SupportedBrowser(SupportedBrowser.CHROME, '25') |
314 @Experimental() | 314 @Experimental() |
315 abstract class DateTimeInputElement implements RangeInputElementBase { | 315 abstract class DateTimeInputElement implements RangeInputElementBase { |
316 factory DateTimeInputElement() => new InputElement(type: 'datetime'); | 316 factory DateTimeInputElement() => new InputElement(type: 'datetime'); |
317 | 317 |
318 /// @domName HTMLInputElement.valueAsDate | 318 @DomName('HTMLInputElement.valueAsDate') |
319 Date valueAsDate; | 319 Date valueAsDate; |
320 | 320 |
321 /// @domName HTMLInputElement.readOnly | 321 @DomName('HTMLInputElement.readOnly') |
322 bool readOnly; | 322 bool readOnly; |
323 | 323 |
324 /// @domName HTMLInputElement.required | 324 @DomName('HTMLInputElement.required') |
325 bool required; | 325 bool required; |
326 | 326 |
327 /// Returns true if this input type is supported on the current platform. | 327 /// Returns true if this input type is supported on the current platform. |
328 static bool get supported { | 328 static bool get supported { |
329 return (new InputElement(type: 'datetime')).type == 'datetime'; | 329 return (new InputElement(type: 'datetime')).type == 'datetime'; |
330 } | 330 } |
331 } | 331 } |
332 | 332 |
333 /** | 333 /** |
334 * A date (year, month, day) with no time zone. | 334 * A date (year, month, day) with no time zone. |
335 * | 335 * |
336 * Use [supported] to check if this is supported on the current platform. | 336 * Use [supported] to check if this is supported on the current platform. |
337 */ | 337 */ |
338 @SupportedBrowser(SupportedBrowser.CHROME, '25') | 338 @SupportedBrowser(SupportedBrowser.CHROME, '25') |
339 @Experimental() | 339 @Experimental() |
340 abstract class DateInputElement implements RangeInputElementBase { | 340 abstract class DateInputElement implements RangeInputElementBase { |
341 factory DateInputElement() => new InputElement(type: 'date'); | 341 factory DateInputElement() => new InputElement(type: 'date'); |
342 | 342 |
343 /// @domName HTMLInputElement.valueAsDate | 343 @DomName('HTMLInputElement.valueAsDate') |
344 Date valueAsDate; | 344 Date valueAsDate; |
345 | 345 |
346 /// @domName HTMLInputElement.readOnly | 346 @DomName('HTMLInputElement.readOnly') |
347 bool readOnly; | 347 bool readOnly; |
348 | 348 |
349 /// @domName HTMLInputElement.required | 349 @DomName('HTMLInputElement.required') |
350 bool required; | 350 bool required; |
351 | 351 |
352 /// Returns true if this input type is supported on the current platform. | 352 /// Returns true if this input type is supported on the current platform. |
353 static bool get supported { | 353 static bool get supported { |
354 return (new InputElement(type: 'date')).type == 'date'; | 354 return (new InputElement(type: 'date')).type == 'date'; |
355 } | 355 } |
356 } | 356 } |
357 | 357 |
358 /** | 358 /** |
359 * A date consisting of a year and a month with no time zone. | 359 * A date consisting of a year and a month with no time zone. |
360 * | 360 * |
361 * Use [supported] to check if this is supported on the current platform. | 361 * Use [supported] to check if this is supported on the current platform. |
362 */ | 362 */ |
363 @SupportedBrowser(SupportedBrowser.CHROME, '25') | 363 @SupportedBrowser(SupportedBrowser.CHROME, '25') |
364 @Experimental() | 364 @Experimental() |
365 abstract class MonthInputElement implements RangeInputElementBase { | 365 abstract class MonthInputElement implements RangeInputElementBase { |
366 factory MonthInputElement() => new InputElement(type: 'month'); | 366 factory MonthInputElement() => new InputElement(type: 'month'); |
367 | 367 |
368 /// @domName HTMLInputElement.valueAsDate | 368 @DomName('HTMLInputElement.valueAsDate') |
369 Date valueAsDate; | 369 Date valueAsDate; |
370 | 370 |
371 /// @domName HTMLInputElement.readOnly | 371 @DomName('HTMLInputElement.readOnly') |
372 bool readOnly; | 372 bool readOnly; |
373 | 373 |
374 /// @domName HTMLInputElement.required | 374 @DomName('HTMLInputElement.required') |
375 bool required; | 375 bool required; |
376 | 376 |
377 /// Returns true if this input type is supported on the current platform. | 377 /// Returns true if this input type is supported on the current platform. |
378 static bool get supported { | 378 static bool get supported { |
379 return (new InputElement(type: 'month')).type == 'month'; | 379 return (new InputElement(type: 'month')).type == 'month'; |
380 } | 380 } |
381 } | 381 } |
382 | 382 |
383 /** | 383 /** |
384 * A date consisting of a week-year number and a week number with no time zone. | 384 * A date consisting of a week-year number and a week number with no time zone. |
385 * | 385 * |
386 * Use [supported] to check if this is supported on the current platform. | 386 * Use [supported] to check if this is supported on the current platform. |
387 */ | 387 */ |
388 @SupportedBrowser(SupportedBrowser.CHROME, '25') | 388 @SupportedBrowser(SupportedBrowser.CHROME, '25') |
389 @Experimental() | 389 @Experimental() |
390 abstract class WeekInputElement implements RangeInputElementBase { | 390 abstract class WeekInputElement implements RangeInputElementBase { |
391 factory WeekInputElement() => new InputElement(type: 'week'); | 391 factory WeekInputElement() => new InputElement(type: 'week'); |
392 | 392 |
393 /// @domName HTMLInputElement.valueAsDate | 393 @DomName('HTMLInputElement.valueAsDate') |
394 Date valueAsDate; | 394 Date valueAsDate; |
395 | 395 |
396 /// @domName HTMLInputElement.readOnly | 396 @DomName('HTMLInputElement.readOnly') |
397 bool readOnly; | 397 bool readOnly; |
398 | 398 |
399 /// @domName HTMLInputElement.required | 399 @DomName('HTMLInputElement.required') |
400 bool required; | 400 bool required; |
401 | 401 |
402 /// Returns true if this input type is supported on the current platform. | 402 /// Returns true if this input type is supported on the current platform. |
403 static bool get supported { | 403 static bool get supported { |
404 return (new InputElement(type: 'week')).type == 'week'; | 404 return (new InputElement(type: 'week')).type == 'week'; |
405 } | 405 } |
406 } | 406 } |
407 | 407 |
408 /** | 408 /** |
409 * A time (hour, minute, seconds, fractional seconds) with no time zone. | 409 * A time (hour, minute, seconds, fractional seconds) with no time zone. |
410 * | 410 * |
411 * Use [supported] to check if this is supported on the current platform. | 411 * Use [supported] to check if this is supported on the current platform. |
412 */ | 412 */ |
413 @SupportedBrowser(SupportedBrowser.CHROME) | 413 @SupportedBrowser(SupportedBrowser.CHROME) |
414 @Experimental() | 414 @Experimental() |
415 abstract class TimeInputElement implements RangeInputElementBase { | 415 abstract class TimeInputElement implements RangeInputElementBase { |
416 factory TimeInputElement() => new InputElement(type: 'time'); | 416 factory TimeInputElement() => new InputElement(type: 'time'); |
417 | 417 |
418 /// @domName HTMLInputElement.valueAsDate | 418 @DomName('HTMLInputElement.valueAsDate') |
419 Date valueAsDate; | 419 Date valueAsDate; |
420 | 420 |
421 /// @domName HTMLInputElement.readOnly | 421 @DomName('HTMLInputElement.readOnly') |
422 bool readOnly; | 422 bool readOnly; |
423 | 423 |
424 /// @domName HTMLInputElement.required | 424 @DomName('HTMLInputElement.required') |
425 bool required; | 425 bool required; |
426 | 426 |
427 /// Returns true if this input type is supported on the current platform. | 427 /// Returns true if this input type is supported on the current platform. |
428 static bool get supported { | 428 static bool get supported { |
429 return (new InputElement(type: 'time')).type == 'time'; | 429 return (new InputElement(type: 'time')).type == 'time'; |
430 } | 430 } |
431 } | 431 } |
432 | 432 |
433 /** | 433 /** |
434 * A date and time (year, month, day, hour, minute, second, fraction of a | 434 * A date and time (year, month, day, hour, minute, second, fraction of a |
435 * second) with no time zone. | 435 * second) with no time zone. |
436 * | 436 * |
437 * Use [supported] to check if this is supported on the current platform. | 437 * Use [supported] to check if this is supported on the current platform. |
438 */ | 438 */ |
439 @SupportedBrowser(SupportedBrowser.CHROME, '25') | 439 @SupportedBrowser(SupportedBrowser.CHROME, '25') |
440 @Experimental() | 440 @Experimental() |
441 abstract class LocalDateTimeInputElement implements RangeInputElementBase { | 441 abstract class LocalDateTimeInputElement implements RangeInputElementBase { |
442 factory LocalDateTimeInputElement() => | 442 factory LocalDateTimeInputElement() => |
443 new InputElement(type: 'datetime-local'); | 443 new InputElement(type: 'datetime-local'); |
444 | 444 |
445 /// @domName HTMLInputElement.readOnly | 445 @DomName('HTMLInputElement.readOnly') |
446 bool readOnly; | 446 bool readOnly; |
447 | 447 |
448 /// @domName HTMLInputElement.required | 448 @DomName('HTMLInputElement.required') |
449 bool required; | 449 bool required; |
450 | 450 |
451 /// Returns true if this input type is supported on the current platform. | 451 /// Returns true if this input type is supported on the current platform. |
452 static bool get supported { | 452 static bool get supported { |
453 return (new InputElement(type: 'datetime-local')).type == 'datetime-local'; | 453 return (new InputElement(type: 'datetime-local')).type == 'datetime-local'; |
454 } | 454 } |
455 } | 455 } |
456 | 456 |
457 /** | 457 /** |
458 * A numeric editor control. | 458 * A numeric editor control. |
459 */ | 459 */ |
460 @SupportedBrowser(SupportedBrowser.CHROME) | 460 @SupportedBrowser(SupportedBrowser.CHROME) |
461 @SupportedBrowser(SupportedBrowser.IE) | 461 @SupportedBrowser(SupportedBrowser.IE) |
462 @SupportedBrowser(SupportedBrowser.SAFARI) | 462 @SupportedBrowser(SupportedBrowser.SAFARI) |
463 @Experimental() | 463 @Experimental() |
464 abstract class NumberInputElement implements RangeInputElementBase { | 464 abstract class NumberInputElement implements RangeInputElementBase { |
465 factory NumberInputElement() => new InputElement(type: 'number'); | 465 factory NumberInputElement() => new InputElement(type: 'number'); |
466 | 466 |
467 /// @domName HTMLInputElement.placeholder | 467 @DomName('HTMLInputElement.placeholder') |
468 String placeholder; | 468 String placeholder; |
469 | 469 |
470 /// @domName HTMLInputElement.readOnly | 470 @DomName('HTMLInputElement.readOnly') |
471 bool readOnly; | 471 bool readOnly; |
472 | 472 |
473 /// @domName HTMLInputElement.required | 473 @DomName('HTMLInputElement.required') |
474 bool required; | 474 bool required; |
475 | 475 |
476 /// Returns true if this input type is supported on the current platform. | 476 /// Returns true if this input type is supported on the current platform. |
477 static bool get supported { | 477 static bool get supported { |
478 return (new InputElement(type: 'number')).type == 'number'; | 478 return (new InputElement(type: 'number')).type == 'number'; |
479 } | 479 } |
480 } | 480 } |
481 | 481 |
482 /** | 482 /** |
483 * Similar to [NumberInputElement] but the browser may provide more optimal | 483 * Similar to [NumberInputElement] but the browser may provide more optimal |
(...skipping 15 matching lines...) Expand all Loading... |
499 | 499 |
500 /** | 500 /** |
501 * A boolean editor control. | 501 * A boolean editor control. |
502 * | 502 * |
503 * Note that if [indeterminate] is set then this control is in a third | 503 * Note that if [indeterminate] is set then this control is in a third |
504 * indeterminate state. | 504 * indeterminate state. |
505 */ | 505 */ |
506 abstract class CheckboxInputElement implements InputElementBase { | 506 abstract class CheckboxInputElement implements InputElementBase { |
507 factory CheckboxInputElement() => new InputElement(type: 'checkbox'); | 507 factory CheckboxInputElement() => new InputElement(type: 'checkbox'); |
508 | 508 |
509 /// @domName HTMLInputElement.checked | 509 @DomName('HTMLInputElement.checked') |
510 bool checked; | 510 bool checked; |
511 | 511 |
512 /// @domName HTMLInputElement.required | 512 @DomName('HTMLInputElement.required') |
513 bool required; | 513 bool required; |
514 } | 514 } |
515 | 515 |
516 | 516 |
517 /** | 517 /** |
518 * A control that when used with other [ReadioButtonInputElement] controls | 518 * A control that when used with other [ReadioButtonInputElement] controls |
519 * forms a radio button group in which only one control can be checked at a | 519 * forms a radio button group in which only one control can be checked at a |
520 * time. | 520 * time. |
521 * | 521 * |
522 * Radio buttons are considered to be in the same radio button group if: | 522 * Radio buttons are considered to be in the same radio button group if: |
523 * | 523 * |
524 * * They are all of type 'radio'. | 524 * * They are all of type 'radio'. |
525 * * They all have either the same [FormElement] owner, or no owner. | 525 * * They all have either the same [FormElement] owner, or no owner. |
526 * * Their name attributes contain the same name. | 526 * * Their name attributes contain the same name. |
527 */ | 527 */ |
528 abstract class RadioButtonInputElement implements InputElementBase { | 528 abstract class RadioButtonInputElement implements InputElementBase { |
529 factory RadioButtonInputElement() => new InputElement(type: 'radio'); | 529 factory RadioButtonInputElement() => new InputElement(type: 'radio'); |
530 | 530 |
531 /// @domName HTMLInputElement.checked | 531 @DomName('HTMLInputElement.checked') |
532 bool checked; | 532 bool checked; |
533 | 533 |
534 /// @domName HTMLInputElement.required | 534 @DomName('HTMLInputElement.required') |
535 bool required; | 535 bool required; |
536 } | 536 } |
537 | 537 |
538 /** | 538 /** |
539 * A control for picking files from the user's computer. | 539 * A control for picking files from the user's computer. |
540 */ | 540 */ |
541 abstract class FileUploadInputElement implements InputElementBase { | 541 abstract class FileUploadInputElement implements InputElementBase { |
542 factory FileUploadInputElement() => new InputElement(type: 'file'); | 542 factory FileUploadInputElement() => new InputElement(type: 'file'); |
543 | 543 |
544 /// @domName HTMLInputElement.accept | 544 @DomName('HTMLInputElement.accept') |
545 String accept; | 545 String accept; |
546 | 546 |
547 /// @domName HTMLInputElement.multiple | 547 @DomName('HTMLInputElement.multiple') |
548 bool multiple; | 548 bool multiple; |
549 | 549 |
550 /// @domName HTMLInputElement.required | 550 @DomName('HTMLInputElement.required') |
551 bool required; | 551 bool required; |
552 | 552 |
553 /// @domName HTMLInputElement.files | 553 @DomName('HTMLInputElement.files') |
554 List<File> files; | 554 List<File> files; |
555 } | 555 } |
556 | 556 |
557 /** | 557 /** |
558 * A button, which when clicked, submits the form. | 558 * A button, which when clicked, submits the form. |
559 */ | 559 */ |
560 abstract class SubmitButtonInputElement implements InputElementBase { | 560 abstract class SubmitButtonInputElement implements InputElementBase { |
561 factory SubmitButtonInputElement() => new InputElement(type: 'submit'); | 561 factory SubmitButtonInputElement() => new InputElement(type: 'submit'); |
562 | 562 |
563 /// @domName HTMLInputElement.formAction | 563 @DomName('HTMLInputElement.formAction') |
564 String formAction; | 564 String formAction; |
565 | 565 |
566 /// @domName HTMLInputElement.formEnctype | 566 @DomName('HTMLInputElement.formEnctype') |
567 String formEnctype; | 567 String formEnctype; |
568 | 568 |
569 /// @domName HTMLInputElement.formMethod | 569 @DomName('HTMLInputElement.formMethod') |
570 String formMethod; | 570 String formMethod; |
571 | 571 |
572 /// @domName HTMLInputElement.formNoValidate | 572 @DomName('HTMLInputElement.formNoValidate') |
573 bool formNoValidate; | 573 bool formNoValidate; |
574 | 574 |
575 /// @domName HTMLInputElement.formTarget | 575 @DomName('HTMLInputElement.formTarget') |
576 String formTarget; | 576 String formTarget; |
577 } | 577 } |
578 | 578 |
579 /** | 579 /** |
580 * Either an image which the user can select a coordinate to or a form | 580 * Either an image which the user can select a coordinate to or a form |
581 * submit button. | 581 * submit button. |
582 */ | 582 */ |
583 abstract class ImageButtonInputElement implements InputElementBase { | 583 abstract class ImageButtonInputElement implements InputElementBase { |
584 factory ImageButtonInputElement() => new InputElement(type: 'image'); | 584 factory ImageButtonInputElement() => new InputElement(type: 'image'); |
585 | 585 |
586 /// @domName HTMLInputElement.alt | 586 @DomName('HTMLInputElement.alt') |
587 String alt; | 587 String alt; |
588 | 588 |
589 /// @domName HTMLInputElement.formAction | 589 @DomName('HTMLInputElement.formAction') |
590 String formAction; | 590 String formAction; |
591 | 591 |
592 /// @domName HTMLInputElement.formEnctype | 592 @DomName('HTMLInputElement.formEnctype') |
593 String formEnctype; | 593 String formEnctype; |
594 | 594 |
595 /// @domName HTMLInputElement.formMethod | 595 @DomName('HTMLInputElement.formMethod') |
596 String formMethod; | 596 String formMethod; |
597 | 597 |
598 /// @domName HTMLInputElement.formNoValidate | 598 @DomName('HTMLInputElement.formNoValidate') |
599 bool formNoValidate; | 599 bool formNoValidate; |
600 | 600 |
601 /// @domName HTMLInputElement.formTarget | 601 @DomName('HTMLInputElement.formTarget') |
602 String formTarget; | 602 String formTarget; |
603 | 603 |
604 /// @domName HTMLInputElement.height | 604 @DomName('HTMLInputElement.height') |
605 int height; | 605 int height; |
606 | 606 |
607 /// @domName HTMLInputElement.src | 607 @DomName('HTMLInputElement.src') |
608 String src; | 608 String src; |
609 | 609 |
610 /// @domName HTMLInputElement.width | 610 @DomName('HTMLInputElement.width') |
611 int width; | 611 int width; |
612 } | 612 } |
613 | 613 |
614 /** | 614 /** |
615 * A button, which when clicked, resets the form. | 615 * A button, which when clicked, resets the form. |
616 */ | 616 */ |
617 abstract class ResetButtonInputElement implements InputElementBase { | 617 abstract class ResetButtonInputElement implements InputElementBase { |
618 factory ResetButtonInputElement() => new InputElement(type: 'reset'); | 618 factory ResetButtonInputElement() => new InputElement(type: 'reset'); |
619 } | 619 } |
620 | 620 |
621 /** | 621 /** |
622 * A button, with no default behavior. | 622 * A button, with no default behavior. |
623 */ | 623 */ |
624 abstract class ButtonInputElement implements InputElementBase { | 624 abstract class ButtonInputElement implements InputElementBase { |
625 factory ButtonInputElement() => new InputElement(type: 'button'); | 625 factory ButtonInputElement() => new InputElement(type: 'button'); |
626 } | 626 } |
627 | 627 |
OLD | NEW |