Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(211)

Side by Side Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 11696002: Filling in supported platforms for InputElement types. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 library html; 1 library html;
2 2
3 import 'dart:collection'; 3 import 'dart:collection';
4 import 'dart:html_common'; 4 import 'dart:html_common';
5 import 'dart:indexed_db'; 5 import 'dart:indexed_db';
6 import 'dart:isolate'; 6 import 'dart:isolate';
7 import 'dart:json'; 7 import 'dart:json';
8 import 'dart:svg' as svg; 8 import 'dart:svg' as svg;
9 import 'dart:web_audio' as web_audio; 9 import 'dart:web_audio' as web_audio;
10 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
(...skipping 10739 matching lines...) Expand 10 before | Expand all | Expand 10 after
10750 FileUploadInputElement, 10750 FileUploadInputElement,
10751 SubmitButtonInputElement, 10751 SubmitButtonInputElement,
10752 ImageButtonInputElement, 10752 ImageButtonInputElement,
10753 ResetButtonInputElement, 10753 ResetButtonInputElement,
10754 ButtonInputElement 10754 ButtonInputElement
10755 native "*HTMLInputElement" { 10755 native "*HTMLInputElement" {
10756 10756
10757 ///@docsEditable true 10757 ///@docsEditable true
10758 factory InputElement({String type}) { 10758 factory InputElement({String type}) {
10759 var e = document.$dom_createElement("input"); 10759 var e = document.$dom_createElement("input");
10760 if (type != null) e.type = type; 10760 if (type != null) {
10761 try {
10762 // IE throws an exception for unknown types.
10763 e.type = type;
10764 } catch(_) {}
10765 }
10761 return e; 10766 return e;
10762 } 10767 }
10763 10768
10769
10764 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true 10770 /// @domName EventTarget.addEventListener, EventTarget.removeEventListener, Ev entTarget.dispatchEvent; @docsEditable true
10765 InputElementEvents get on => 10771 InputElementEvents get on =>
10766 new InputElementEvents(this); 10772 new InputElementEvents(this);
10767 10773
10768 /// @domName HTMLInputElement.accept; @docsEditable true 10774 /// @domName HTMLInputElement.accept; @docsEditable true
10769 String accept; 10775 String accept;
10770 10776
10771 /// @domName HTMLInputElement.align; @docsEditable true 10777 /// @domName HTMLInputElement.align; @docsEditable true
10772 String align; 10778 String align;
10773 10779
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after
11153 /// @domName HTMLInputElement.stepDown 11159 /// @domName HTMLInputElement.stepDown
11154 void stepDown([int n]); 11160 void stepDown([int n]);
11155 11161
11156 /// @domName HTMLInputElement.stepUp 11162 /// @domName HTMLInputElement.stepUp
11157 void stepUp([int n]); 11163 void stepUp([int n]);
11158 } 11164 }
11159 11165
11160 /** 11166 /**
11161 * A date and time (year, month, day, hour, minute, second, fraction of a 11167 * A date and time (year, month, day, hour, minute, second, fraction of a
11162 * second) with the time zone set to UTC. 11168 * second) with the time zone set to UTC.
11169 *
11170 * Use [supported] to check if this is supported on the current platform.
11163 */ 11171 */
11172 @SupportedBrowser(SupportedBrowser.CHROME, '25')
11173 @Experimental()
11164 abstract class DateTimeInputElement implements RangeInputElementBase { 11174 abstract class DateTimeInputElement implements RangeInputElementBase {
11165 factory DateTimeInputElement() => new InputElement(type: 'datetime'); 11175 factory DateTimeInputElement() => new InputElement(type: 'datetime');
11166 11176
11167 /// @domName HTMLInputElement.valueAsDate 11177 /// @domName HTMLInputElement.valueAsDate
11168 Date valueAsDate; 11178 Date valueAsDate;
11169 11179
11170 /// @domName HTMLInputElement.readOnly 11180 /// @domName HTMLInputElement.readOnly
11171 bool readOnly; 11181 bool readOnly;
11172 11182
11173 /// @domName HTMLInputElement.required 11183 /// @domName HTMLInputElement.required
11174 bool required; 11184 bool required;
11185
11186 /// Returns true if this input type is supported on the current platform.
11187 static bool get supported {
11188 return (new InputElement(type: 'datetime')).type == 'datetime';
11189 }
11175 } 11190 }
11176 11191
11177 /** 11192 /**
11178 * A date (year, month, day) with no time zone. 11193 * A date (year, month, day) with no time zone.
11194 *
11195 * Use [supported] to check if this is supported on the current platform.
11179 */ 11196 */
11197 @SupportedBrowser(SupportedBrowser.CHROME, '25')
11198 @Experimental()
11180 abstract class DateInputElement implements RangeInputElementBase { 11199 abstract class DateInputElement implements RangeInputElementBase {
11181 factory DateInputElement() => new InputElement(type: 'date'); 11200 factory DateInputElement() => new InputElement(type: 'date');
11182 11201
11183 /// @domName HTMLInputElement.valueAsDate 11202 /// @domName HTMLInputElement.valueAsDate
11184 Date valueAsDate; 11203 Date valueAsDate;
11185 11204
11186 /// @domName HTMLInputElement.readOnly 11205 /// @domName HTMLInputElement.readOnly
11187 bool readOnly; 11206 bool readOnly;
11188 11207
11189 /// @domName HTMLInputElement.required 11208 /// @domName HTMLInputElement.required
11190 bool required; 11209 bool required;
11210
11211 /// Returns true if this input type is supported on the current platform.
11212 static bool get supported {
11213 return (new InputElement(type: 'date')).type == 'date';
11214 }
11191 } 11215 }
11192 11216
11193 /** 11217 /**
11194 * A date consisting of a year and a month with no time zone. 11218 * A date consisting of a year and a month with no time zone.
11219 *
11220 * Use [supported] to check if this is supported on the current platform.
11195 */ 11221 */
11222 @SupportedBrowser(SupportedBrowser.CHROME, '25')
11223 @Experimental()
11196 abstract class MonthInputElement implements RangeInputElementBase { 11224 abstract class MonthInputElement implements RangeInputElementBase {
11197 factory MonthInputElement() => new InputElement(type: 'month'); 11225 factory MonthInputElement() => new InputElement(type: 'month');
11198 11226
11199 /// @domName HTMLInputElement.valueAsDate 11227 /// @domName HTMLInputElement.valueAsDate
11200 Date valueAsDate; 11228 Date valueAsDate;
11201 11229
11202 /// @domName HTMLInputElement.readOnly 11230 /// @domName HTMLInputElement.readOnly
11203 bool readOnly; 11231 bool readOnly;
11204 11232
11205 /// @domName HTMLInputElement.required 11233 /// @domName HTMLInputElement.required
11206 bool required; 11234 bool required;
11235
11236 /// Returns true if this input type is supported on the current platform.
11237 static bool get supported {
11238 return (new InputElement(type: 'month')).type == 'month';
11239 }
11207 } 11240 }
11208 11241
11209 /** 11242 /**
11210 * A date consisting of a week-year number and a week number with no time zone. 11243 * A date consisting of a week-year number and a week number with no time zone.
11244 *
11245 * Use [supported] to check if this is supported on the current platform.
11211 */ 11246 */
11247 @SupportedBrowser(SupportedBrowser.CHROME, '25')
11248 @Experimental()
11212 abstract class WeekInputElement implements RangeInputElementBase { 11249 abstract class WeekInputElement implements RangeInputElementBase {
11213 factory WeekInputElement() => new InputElement(type: 'week'); 11250 factory WeekInputElement() => new InputElement(type: 'week');
11214 11251
11215 /// @domName HTMLInputElement.valueAsDate 11252 /// @domName HTMLInputElement.valueAsDate
11216 Date valueAsDate; 11253 Date valueAsDate;
11217 11254
11218 /// @domName HTMLInputElement.readOnly 11255 /// @domName HTMLInputElement.readOnly
11219 bool readOnly; 11256 bool readOnly;
11220 11257
11221 /// @domName HTMLInputElement.required 11258 /// @domName HTMLInputElement.required
11222 bool required; 11259 bool required;
11260
11261 /// Returns true if this input type is supported on the current platform.
11262 static bool get supported {
11263 return (new InputElement(type: 'week')).type == 'week';
11264 }
11223 } 11265 }
11224 11266
11225 /** 11267 /**
11226 * A time (hour, minute, seconds, fractional seconds) with no time zone. 11268 * A time (hour, minute, seconds, fractional seconds) with no time zone.
11269 *
11270 * Use [supported] to check if this is supported on the current platform.
11227 */ 11271 */
11272 @SupportedBrowser(SupportedBrowser.CHROME)
11273 @Experimental()
11228 abstract class TimeInputElement implements RangeInputElementBase { 11274 abstract class TimeInputElement implements RangeInputElementBase {
11229 factory TimeInputElement() => new InputElement(type: 'time'); 11275 factory TimeInputElement() => new InputElement(type: 'time');
11230 11276
11231 /// @domName HTMLInputElement.valueAsDate 11277 /// @domName HTMLInputElement.valueAsDate
11232 Date valueAsDate; 11278 Date valueAsDate;
11233 11279
11234 /// @domName HTMLInputElement.readOnly 11280 /// @domName HTMLInputElement.readOnly
11235 bool readOnly; 11281 bool readOnly;
11236 11282
11237 /// @domName HTMLInputElement.required 11283 /// @domName HTMLInputElement.required
11238 bool required; 11284 bool required;
11285
11286 /// Returns true if this input type is supported on the current platform.
11287 static bool get supported {
11288 return (new InputElement(type: 'time')).type == 'time';
11289 }
11239 } 11290 }
11240 11291
11241 /** 11292 /**
11242 * A date and time (year, month, day, hour, minute, second, fraction of a 11293 * A date and time (year, month, day, hour, minute, second, fraction of a
11243 * second) with no time zone. 11294 * second) with no time zone.
11295 *
11296 * Use [supported] to check if this is supported on the current platform.
11244 */ 11297 */
11298 @SupportedBrowser(SupportedBrowser.CHROME, '25')
11299 @Experimental()
11245 abstract class LocalDateTimeInputElement implements RangeInputElementBase { 11300 abstract class LocalDateTimeInputElement implements RangeInputElementBase {
11246 factory LocalDateTimeInputElement() => 11301 factory LocalDateTimeInputElement() =>
11247 new InputElement(type: 'datetime-local'); 11302 new InputElement(type: 'datetime-local');
11248 11303
11249 /// @domName HTMLInputElement.readOnly 11304 /// @domName HTMLInputElement.readOnly
11250 bool readOnly; 11305 bool readOnly;
11251 11306
11252 /// @domName HTMLInputElement.required 11307 /// @domName HTMLInputElement.required
11253 bool required; 11308 bool required;
11309
11310 /// Returns true if this input type is supported on the current platform.
11311 static bool get supported {
11312 return (new InputElement(type: 'datetime-local')).type == 'datetime-local';
11313 }
11254 } 11314 }
11255 11315
11256 /** 11316 /**
11257 * A numeric editor control. 11317 * A numeric editor control.
11258 */ 11318 */
11319 @SupportedBrowser(SupportedBrowser.CHROME)
11320 @SupportedBrowser(SupportedBrowser.IE)
11321 @SupportedBrowser(SupportedBrowser.SAFARI)
11322 @Experimental()
11259 abstract class NumberInputElement implements RangeInputElementBase { 11323 abstract class NumberInputElement implements RangeInputElementBase {
11260 factory NumberInputElement() => new InputElement(type: 'number'); 11324 factory NumberInputElement() => new InputElement(type: 'number');
11261 11325
11262 /// @domName HTMLInputElement.placeholder 11326 /// @domName HTMLInputElement.placeholder
11263 String placeholder; 11327 String placeholder;
11264 11328
11265 /// @domName HTMLInputElement.readOnly 11329 /// @domName HTMLInputElement.readOnly
11266 bool readOnly; 11330 bool readOnly;
11267 11331
11268 /// @domName HTMLInputElement.required 11332 /// @domName HTMLInputElement.required
11269 bool required; 11333 bool required;
11334
11335 /// Returns true if this input type is supported on the current platform.
11336 static bool get supported {
11337 return (new InputElement(type: 'number')).type == 'number';
11338 }
11270 } 11339 }
11271 11340
11272 /** 11341 /**
11273 * Similar to [NumberInputElement] but the browser may provide more optimal 11342 * Similar to [NumberInputElement] but the browser may provide more optimal
11274 * styling (such as a slider control). 11343 * styling (such as a slider control).
11344 *
11345 * Use [supported] to check if this is supported on the current platform.
11275 */ 11346 */
11347 @SupportedBrowser(SupportedBrowser.CHROME)
11348 @SupportedBrowser(SupportedBrowser.IE, '10')
11349 @Experimental()
11276 abstract class RangeInputElement implements RangeInputElementBase { 11350 abstract class RangeInputElement implements RangeInputElementBase {
11277 factory RangeInputElement() => new InputElement(type: 'range'); 11351 factory RangeInputElement() => new InputElement(type: 'range');
11352
11353 /// Returns true if this input type is supported on the current platform.
11354 static bool get supported {
11355 return (new InputElement(type: 'range')).type == 'range';
11356 }
11278 } 11357 }
11279 11358
11280 /** 11359 /**
11281 * A boolean editor control. 11360 * A boolean editor control.
11282 * 11361 *
11283 * Note that if [indeterminate] is set then this control is in a third 11362 * Note that if [indeterminate] is set then this control is in a third
11284 * indeterminate state. 11363 * indeterminate state.
11285 */ 11364 */
11286 abstract class CheckboxInputElement implements InputElementBase { 11365 abstract class CheckboxInputElement implements InputElementBase {
11287 factory CheckboxInputElement() => new InputElement(type: 'checkbox'); 11366 factory CheckboxInputElement() => new InputElement(type: 'checkbox');
(...skipping 1944 matching lines...) Expand 10 before | Expand all | Expand 10 after
13232 @SupportedBrowser(SupportedBrowser.FIREFOX) 13311 @SupportedBrowser(SupportedBrowser.FIREFOX)
13233 @SupportedBrowser(SupportedBrowser.SAFARI) 13312 @SupportedBrowser(SupportedBrowser.SAFARI)
13234 @Experimental() 13313 @Experimental()
13235 class MutationObserver native "*MutationObserver" { 13314 class MutationObserver native "*MutationObserver" {
13236 13315
13237 ///@docsEditable true 13316 ///@docsEditable true
13238 factory MutationObserver(MutationCallback callback) => MutationObserver._creat e(callback); 13317 factory MutationObserver(MutationCallback callback) => MutationObserver._creat e(callback);
13239 static MutationObserver _create(MutationCallback callback) { 13318 static MutationObserver _create(MutationCallback callback) {
13240 // Dummy statement to mark types as instantiated. 13319 // Dummy statement to mark types as instantiated.
13241 JS('MutationObserver|MutationRecord', '0'); 13320 JS('MutationObserver|MutationRecord', '0');
13321
13242 return JS('MutationObserver', 13322 return JS('MutationObserver',
13243 'new(window.MutationObserver||window.WebKitMutationObserver||' 13323 'new(window.MutationObserver||window.WebKitMutationObserver||'
13244 'window.MozMutationObserver)(#)', 13324 'window.MozMutationObserver)(#)',
13245 convertDartClosureToJS(callback, 2)); 13325 convertDartClosureToJS(callback, 2));
13246 } 13326 }
13247 13327
13248 /// @domName MutationObserver.disconnect; @docsEditable true 13328 /// @domName MutationObserver.disconnect; @docsEditable true
13249 void disconnect() native; 13329 void disconnect() native;
13250 13330
13251 /// @domName MutationObserver._observe; @docsEditable true 13331 /// @domName MutationObserver._observe; @docsEditable true
(...skipping 12006 matching lines...) Expand 10 before | Expand all | Expand 10 after
25258 T next() { 25338 T next() {
25259 if (!hasNext) { 25339 if (!hasNext) {
25260 throw new StateError("No more elements"); 25340 throw new StateError("No more elements");
25261 } 25341 }
25262 return _array[_pos++]; 25342 return _array[_pos++];
25263 } 25343 }
25264 25344
25265 final List<T> _array; 25345 final List<T> _array;
25266 int _pos; 25346 int _pos;
25267 } 25347 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | sdk/lib/html/dartium/html_dartium.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698