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