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

Unified Diff: sdk/lib/html/dart2js/html_dart2js.dart

Issue 12929005: dart:typeddata for dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Revert status change Created 7 years, 9 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:
Download patch
Index: sdk/lib/html/dart2js/html_dart2js.dart
diff --git a/sdk/lib/html/dart2js/html_dart2js.dart b/sdk/lib/html/dart2js/html_dart2js.dart
index cc559ea315716c1da91f05c9f0ebf44e86732b90..2714ea8e44c47725870a61a697eb3399541cb0d8 100644
--- a/sdk/lib/html/dart2js/html_dart2js.dart
+++ b/sdk/lib/html/dart2js/html_dart2js.dart
@@ -8,9 +8,10 @@ import 'dart:indexed_db';
import 'dart:isolate';
import 'dart:json' as json;
import 'dart:math';
-import 'dart:web_sql';
+import 'dart:typeddata';
import 'dart:svg' as svg;
import 'dart:web_audio' as web_audio;
+import 'dart:web_sql';
import 'dart:_js_helper' show convertDartClosureToJS, Creates, JavaScriptIndexingBehavior, JSName, Null, Returns;
import 'dart:_isolate_helper' show IsolateNatives;
import 'dart:_foreign_helper' show JS;
@@ -392,88 +393,6 @@ class AreaElement extends Element native "*HTMLAreaElement" {
@DocsEditable
String target;
}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DomName('ArrayBuffer')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class ArrayBuffer native "*ArrayBuffer" {
-
- @DomName('ArrayBuffer.ArrayBuffer')
- @DocsEditable
- factory ArrayBuffer(int length) {
- return ArrayBuffer._create_1(length);
- }
- static ArrayBuffer _create_1(length) => JS('ArrayBuffer', 'new ArrayBuffer(#)', length);
-
- /// Checks if this type is supported on the current platform.
- static bool get supported => JS('bool', 'typeof window.ArrayBuffer != "undefined"');
-
- @DomName('ArrayBuffer.byteLength')
- @DocsEditable
- final int byteLength;
-
- @DomName('ArrayBuffer.slice')
- ArrayBuffer slice(int begin, [int end]) {
- // IE10 supports ArrayBuffers but does not have the slice method.
- if (JS('bool', '!!#.slice', this)) {
- if (?end) {
- return JS('ArrayBuffer', '#.slice(#, #)', this, begin, end);
- }
- return JS('ArrayBuffer', '#.slice(#)', this, begin);
- } else {
- var start = begin;
- // Negative values go from end.
- if (start < 0) {
- start = this.byteLength + start;
- }
- var finish = ?end ? min(end, byteLength) : byteLength;
- if (finish < 0) {
- finish = this.byteLength + finish;
- }
- var length = max(finish - start, 0);
-
- var clone = new Int8Array(length);
- var source = new Int8Array.fromBuffer(this, start);
- for (var i = 0; i < length; ++i) {
- clone[i] = source[i];
- }
- return clone.buffer;
- }
- }
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('ArrayBufferView')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class ArrayBufferView native "*ArrayBufferView" {
-
- @DomName('ArrayBufferView.buffer')
- @DocsEditable
- @Creates('ArrayBuffer')
- @Returns('ArrayBuffer|Null')
- final dynamic buffer;
-
- @DomName('ArrayBufferView.byteLength')
- @DocsEditable
- final int byteLength;
-
- @DomName('ArrayBufferView.byteOffset')
- @DocsEditable
- final int byteOffset;
-}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -1801,8 +1720,8 @@ class Crypto native "*Crypto" {
@DomName('Crypto.getRandomValues')
@DocsEditable
- @Creates('ArrayBufferView')
- @Returns('ArrayBufferView|Null')
+ @Creates('TypedData')
+ @Returns('TypedData|Null')
dynamic getRandomValues(/*ArrayBufferView*/ array) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
@@ -5893,94 +5812,6 @@ class DataTransferItemList native "*DataTransferItemList" {
@DocsEditable
-@DomName('DataView')
-class DataView extends ArrayBufferView native "*DataView" {
-
- @DomName('DataView.DataView')
- @DocsEditable
- factory DataView(/*ArrayBuffer*/ buffer, [int byteOffset, int byteLength]) {
- if (?byteLength) {
- return DataView._create_1(buffer, byteOffset, byteLength);
- }
- if (?byteOffset) {
- return DataView._create_2(buffer, byteOffset);
- }
- return DataView._create_3(buffer);
- }
- static DataView _create_1(buffer, byteOffset, byteLength) => JS('DataView', 'new DataView(#,#,#)', buffer, byteOffset, byteLength);
- static DataView _create_2(buffer, byteOffset) => JS('DataView', 'new DataView(#,#)', buffer, byteOffset);
- static DataView _create_3(buffer) => JS('DataView', 'new DataView(#)', buffer);
-
- @DomName('DataView.getFloat32')
- @DocsEditable
- num getFloat32(int byteOffset, {bool littleEndian}) native;
-
- @DomName('DataView.getFloat64')
- @DocsEditable
- num getFloat64(int byteOffset, {bool littleEndian}) native;
-
- @DomName('DataView.getInt16')
- @DocsEditable
- int getInt16(int byteOffset, {bool littleEndian}) native;
-
- @DomName('DataView.getInt32')
- @DocsEditable
- int getInt32(int byteOffset, {bool littleEndian}) native;
-
- @DomName('DataView.getInt8')
- @DocsEditable
- int getInt8(int byteOffset) native;
-
- @DomName('DataView.getUint16')
- @DocsEditable
- int getUint16(int byteOffset, {bool littleEndian}) native;
-
- @DomName('DataView.getUint32')
- @DocsEditable
- int getUint32(int byteOffset, {bool littleEndian}) native;
-
- @DomName('DataView.getUint8')
- @DocsEditable
- int getUint8(int byteOffset) native;
-
- @DomName('DataView.setFloat32')
- @DocsEditable
- void setFloat32(int byteOffset, num value, {bool littleEndian}) native;
-
- @DomName('DataView.setFloat64')
- @DocsEditable
- void setFloat64(int byteOffset, num value, {bool littleEndian}) native;
-
- @DomName('DataView.setInt16')
- @DocsEditable
- void setInt16(int byteOffset, int value, {bool littleEndian}) native;
-
- @DomName('DataView.setInt32')
- @DocsEditable
- void setInt32(int byteOffset, int value, {bool littleEndian}) native;
-
- @DomName('DataView.setInt8')
- @DocsEditable
- void setInt8(int byteOffset, int value) native;
-
- @DomName('DataView.setUint16')
- @DocsEditable
- void setUint16(int byteOffset, int value, {bool littleEndian}) native;
-
- @DomName('DataView.setUint32')
- @DocsEditable
- void setUint32(int byteOffset, int value, {bool littleEndian}) native;
-
- @DomName('DataView.setUint8')
- @DocsEditable
- void setUint8(int byteOffset, int value) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
@DomName('DedicatedWorkerContext')
class DedicatedWorkerContext extends WorkerContext native "*DedicatedWorkerContext" {
@@ -11027,7 +10858,7 @@ class FileReader extends EventTarget native "*FileReader" {
@DomName('FileReader.result')
@DocsEditable
- @Creates('String|ArrayBuffer|Null')
+ @Creates('String|ByteBuffer|Null')
final Object result;
@DomName('FileReader.abort')
@@ -11107,8 +10938,8 @@ class FileReaderSync native "*FileReaderSync" {
@DomName('FileReaderSync.readAsArrayBuffer')
@DocsEditable
- @Creates('ArrayBuffer')
- @Returns('ArrayBuffer|Null')
+ @Creates('ByteBuffer')
+ @Returns('ByteBuffer|Null')
dynamic readAsArrayBuffer(Blob blob) native;
@DomName('FileReaderSync.readAsBinaryString')
@@ -11325,222 +11156,328 @@ class FileWriterSync native "*FileWriterSync" {
@DocsEditable
-@DomName('Float32Array')
-class Float32Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<num> native "*Float32Array" {
+@DomName('FocusEvent')
+class FocusEvent extends UIEvent native "*FocusEvent" {
- @DomName('Float32Array.Float32Array')
+ EventTarget get relatedTarget => _convertNativeToDart_EventTarget(this._get_relatedTarget);
+ @JSName('relatedTarget')
+ @DomName('FocusEvent.relatedTarget')
@DocsEditable
- factory Float32Array(int length) =>
- _TypedArrayFactoryProvider.createFloat32Array(length);
+ final dynamic _get_relatedTarget;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('Float32Array.fromList')
- @DocsEditable
- factory Float32Array.fromList(List<num> list) =>
- _TypedArrayFactoryProvider.createFloat32Array_fromList(list);
- @DomName('Float32Array.fromBuffer')
+@DocsEditable
+@DomName('FormData')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.IE, '10')
+@SupportedBrowser(SupportedBrowser.SAFARI)
+class FormData native "*FormData" {
+
+ @DomName('DOMFormData.DOMFormData')
@DocsEditable
- factory Float32Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) =>
- _TypedArrayFactoryProvider.createFloat32Array_fromBuffer(buffer, byteOffset, length);
+ factory FormData([FormElement form]) {
+ if (?form) {
+ return FormData._create_1(form);
+ }
+ return FormData._create_2();
+ }
+ static FormData _create_1(form) => JS('FormData', 'new FormData(#)', form);
+ static FormData _create_2() => JS('FormData', 'new FormData()');
- static const int BYTES_PER_ELEMENT = 4;
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => JS('bool', '!!(window.FormData)');
- @DomName('Float32Array.length')
+ @DomName('DOMFormData.append')
@DocsEditable
- int get length => JS("int", "#.length", this);
-
- num operator[](int index) => JS("num", "#[#]", this, index);
+ void append(String name, value, [String filename]) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void operator[]=(int index, num value) { JS("void", "#[#] = #", this, index, value); } // -- start List<num> mixins.
- // num is the element type.
- // From Iterable<num>:
+@DocsEditable
+@DomName('HTMLFormElement')
+class FormElement extends Element native "*HTMLFormElement" {
- Iterator<num> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<num>(this);
- }
+ @DomName('HTMLFormElement.HTMLFormElement')
+ @DocsEditable
+ factory FormElement() => document.$dom_createElement("form");
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, num)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
+ @DomName('HTMLFormElement.acceptCharset')
+ @DocsEditable
+ String acceptCharset;
- bool contains(num element) => IterableMixinWorkaround.contains(this, element);
+ @DomName('HTMLFormElement.action')
+ @DocsEditable
+ String action;
- void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
+ @DomName('HTMLFormElement.autocomplete')
+ @DocsEditable
+ String autocomplete;
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
+ @DomName('HTMLFormElement.encoding')
+ @DocsEditable
+ String encoding;
- Iterable map(f(num element)) =>
- IterableMixinWorkaround.mapList(this, f);
+ @DomName('HTMLFormElement.enctype')
+ @DocsEditable
+ String enctype;
- Iterable<num> where(bool f(num element)) =>
- IterableMixinWorkaround.where(this, f);
+ @DomName('HTMLFormElement.length')
+ @DocsEditable
+ final int length;
- Iterable expand(Iterable f(num element)) =>
- IterableMixinWorkaround.expand(this, f);
+ @DomName('HTMLFormElement.method')
+ @DocsEditable
+ String method;
- bool every(bool f(num element)) => IterableMixinWorkaround.every(this, f);
+ @DomName('HTMLFormElement.name')
+ @DocsEditable
+ String name;
- bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f);
+ @DomName('HTMLFormElement.noValidate')
+ @DocsEditable
+ bool noValidate;
- List<num> toList({ bool growable: true }) =>
- new List<num>.from(this, growable: growable);
+ @DomName('HTMLFormElement.target')
+ @DocsEditable
+ String target;
- Set<num> toSet() => new Set<num>.from(this);
+ @DomName('HTMLFormElement.checkValidity')
+ @DocsEditable
+ bool checkValidity() native;
- bool get isEmpty => this.length == 0;
+ @DomName('HTMLFormElement.reset')
+ @DocsEditable
+ void reset() native;
- Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n);
+ @DomName('HTMLFormElement.submit')
+ @DocsEditable
+ void submit() native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- Iterable<num> takeWhile(bool test(num value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
- Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+@DocsEditable
+@DomName('Gamepad')
+class Gamepad native "*Gamepad" {
- Iterable<num> skipWhile(bool test(num value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
+ @DomName('Gamepad.axes')
+ @DocsEditable
+ final List<num> axes;
- num firstWhere(bool test(num value), { num orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
+ @DomName('Gamepad.buttons')
+ @DocsEditable
+ final List<num> buttons;
- num lastWhere(bool test(num value), {num orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
+ @DomName('Gamepad.id')
+ @DocsEditable
+ final String id;
- num singleWhere(bool test(num value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
+ @DomName('Gamepad.index')
+ @DocsEditable
+ final int index;
- num elementAt(int index) {
- return this[index];
- }
+ @DomName('Gamepad.timestamp')
+ @DocsEditable
+ final int timestamp;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- // From Collection<num>:
- void add(num value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+@DocsEditable
+@DomName('Geolocation')
+class Geolocation native "*Geolocation" {
- void addLast(num value) {
- throw new UnsupportedError("Cannot add to immutable List.");
+ @DomName('Geolocation.getCurrentPosition')
+ Future<Geoposition> getCurrentPosition({bool enableHighAccuracy,
+ Duration timeout, Duration maximumAge}) {
+ var options = {};
+ if (enableHighAccuracy != null) {
+ options['enableHighAccuracy'] = enableHighAccuracy;
+ }
+ if (timeout != null) {
+ options['timeout'] = timeout.inMilliseconds;
+ }
+ if (maximumAge != null) {
+ options['maximumAge'] = maximumAge.inMilliseconds;
+ }
+ var completer = new Completer<Geoposition>();
+ try {
+ $dom_getCurrentPosition(
+ (position) {
+ completer.complete(_ensurePosition(position));
+ },
+ (error) {
+ completer.completeError(error);
+ },
+ options);
+ } catch (e, stacktrace) {
+ completer.completeError(e, stacktrace);
+ }
+ return completer.future;
}
- void addAll(Iterable<num> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('Geolocation.watchPosition')
+ Stream<Geoposition> watchPosition({bool enableHighAccuracy,
+ Duration timeout, Duration maximumAge}) {
- // From List<num>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
+ var options = {};
+ if (enableHighAccuracy != null) {
+ options['enableHighAccuracy'] = enableHighAccuracy;
+ }
+ if (timeout != null) {
+ options['timeout'] = timeout.inMilliseconds;
+ }
+ if (maximumAge != null) {
+ options['maximumAge'] = maximumAge.inMilliseconds;
+ }
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
+ int watchId;
+ var controller;
+ controller = new StreamController<Geoposition>(
+ onSubscriptionStateChange: () {
+ if (controller.hasSubscribers) {
+ assert(watchId == null);
+ watchId = $dom_watchPosition(
+ (position) {
+ controller.add(_ensurePosition(position));
+ },
+ (error) {
+ controller.addError(error);
+ },
+ options);
+ } else {
+ assert(watchId != null);
+ $dom_clearWatch(watchId);
+ }
+ });
- Iterable<num> get reversed {
- return IterableMixinWorkaround.reversedList(this);
+ return controller.stream;
}
- void sort([int compare(num a, num b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
+ Geoposition _ensurePosition(domPosition) {
+ try {
+ // Firefox may throw on this.
+ if (domPosition is Geoposition) {
+ return domPosition;
+ }
+ } catch(e) {}
+ return new _GeopositionWrapper(domPosition);
}
- int indexOf(num element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
- int lastIndexOf(num element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
+ @JSName('clearWatch')
+ @DomName('Geolocation.clearWatch')
+ @DocsEditable
+ void $dom_clearWatch(int watchID) native;
- num get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
+ @JSName('getCurrentPosition')
+ @DomName('Geolocation.getCurrentPosition')
+ @DocsEditable
+ void $dom_getCurrentPosition(_PositionCallback successCallback, [_PositionErrorCallback errorCallback, Object options]) native;
- num get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
+ @JSName('watchPosition')
+ @DomName('Geolocation.watchPosition')
+ @DocsEditable
+ int $dom_watchPosition(_PositionCallback successCallback, [_PositionErrorCallback errorCallback, Object options]) native;
+}
- num get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
+/**
+ * Wrapper for Firefox- it returns an object which we cannot map correctly.
+ * Basically Firefox was returning a [xpconnect wrapped nsIDOMGeoPosition] but
+ * which has further oddities.
+ */
+class _GeopositionWrapper implements Geoposition {
+ var _ptr;
+ _GeopositionWrapper(this._ptr);
- num min([int compare(num a, num b)]) =>
- IterableMixinWorkaround.min(this, compare);
+ Coordinates get coords => JS('Coordinates', '#.coords', _ptr);
+ int get timestamp => JS('int', '#.timestamp', _ptr);
+}
- num max([int compare(num a, num b)]) =>
- IterableMixinWorkaround.max(this, compare);
- num removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- num removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+@DocsEditable
+@DomName('Geoposition')
+class Geoposition native "*Geoposition" {
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('Geoposition.coords')
+ @DocsEditable
+ final Coordinates coords;
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('Geoposition.timestamp')
+ @DocsEditable
+ final int timestamp;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void removeWhere(bool test(num element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
- void retainWhere(bool test(num element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+@DocsEditable
+/**
+ * An `<hr>` tag.
+ */
+@DomName('HTMLHRElement')
+class HRElement extends Element native "*HTMLHRElement" {
- void setRange(int start, int rangeLength, List<num> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
+ @DomName('HTMLHRElement.HTMLHRElement')
+ @DocsEditable
+ factory HRElement() => document.$dom_createElement("hr");
+}
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
+// WARNING: Do not edit - generated code.
- void insertRange(int start, int rangeLength, [num initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
+@DomName('HashChangeEvent')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.SAFARI)
- List<num> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <num>[]);
+class HashChangeEvent extends Event native "*HashChangeEvent" {
+ factory HashChangeEvent(String type,
+ {bool canBubble: true, bool cancelable: true, String oldUrl,
+ String newUrl}) {
+ var event = document.$dom_createEvent("HashChangeEvent");
+ event.$dom_initHashChangeEvent(type, canBubble, cancelable, oldUrl, newUrl);
+ return event;
+ }
- Map<int, num> asMap() =>
- IterableMixinWorkaround.asMapList(this);
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => Device.isEventTypeSupported('HashChangeEvent');
- // -- end List<num> mixins.
+ @JSName('newURL')
+ @DomName('HashChangeEvent.newURL')
+ @DocsEditable
+ final String newUrl;
- @JSName('set')
- @DomName('Float32Array.set')
+ @JSName('oldURL')
+ @DomName('HashChangeEvent.oldURL')
@DocsEditable
- void setElements(Object array, [int offset]) native;
+ final String oldUrl;
- @DomName('Float32Array.subarray')
+ @JSName('initHashChangeEvent')
+ @DomName('HashChangeEvent.initHashChangeEvent')
@DocsEditable
- @Returns('Float32Array')
- @Creates('Float32Array')
- List<double> subarray(int start, [int end]) native;
+ void $dom_initHashChangeEvent(String type, bool canBubble, bool cancelable, String oldURL, String newURL) native;
+
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -11548,118 +11485,209 @@ class Float32Array extends ArrayBufferView implements JavaScriptIndexingBehavior
@DocsEditable
-@DomName('Float64Array')
-class Float64Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<num> native "*Float64Array" {
-
- @DomName('Float64Array.Float64Array')
- @DocsEditable
- factory Float64Array(int length) =>
- _TypedArrayFactoryProvider.createFloat64Array(length);
+@DomName('HTMLHeadElement')
+class HeadElement extends Element native "*HTMLHeadElement" {
- @DomName('Float64Array.fromList')
+ @DomName('HTMLHeadElement.HTMLHeadElement')
@DocsEditable
- factory Float64Array.fromList(List<num> list) =>
- _TypedArrayFactoryProvider.createFloat64Array_fromList(list);
+ factory HeadElement() => document.$dom_createElement("head");
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('Float64Array.fromBuffer')
- @DocsEditable
- factory Float64Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) =>
- _TypedArrayFactoryProvider.createFloat64Array_fromBuffer(buffer, byteOffset, length);
- static const int BYTES_PER_ELEMENT = 8;
+@DocsEditable
+@DomName('HTMLHeadingElement')
+class HeadingElement extends Element native "*HTMLHeadingElement" {
- @DomName('Float64Array.length')
+ @DomName('HTMLHeadingElement.HTMLHeadingElement')
@DocsEditable
- int get length => JS("int", "#.length", this);
-
- num operator[](int index) => JS("num", "#[#]", this, index);
+ factory HeadingElement.h1() => document.$dom_createElement("h1");
- void operator[]=(int index, num value) { JS("void", "#[#] = #", this, index, value); } // -- start List<num> mixins.
- // num is the element type.
+ @DomName('HTMLHeadingElement.HTMLHeadingElement')
+ @DocsEditable
+ factory HeadingElement.h2() => document.$dom_createElement("h2");
- // From Iterable<num>:
+ @DomName('HTMLHeadingElement.HTMLHeadingElement')
+ @DocsEditable
+ factory HeadingElement.h3() => document.$dom_createElement("h3");
- Iterator<num> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<num>(this);
- }
+ @DomName('HTMLHeadingElement.HTMLHeadingElement')
+ @DocsEditable
+ factory HeadingElement.h4() => document.$dom_createElement("h4");
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, num)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
+ @DomName('HTMLHeadingElement.HTMLHeadingElement')
+ @DocsEditable
+ factory HeadingElement.h5() => document.$dom_createElement("h5");
- bool contains(num element) => IterableMixinWorkaround.contains(this, element);
+ @DomName('HTMLHeadingElement.HTMLHeadingElement')
+ @DocsEditable
+ factory HeadingElement.h6() => document.$dom_createElement("h6");
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void forEach(void f(num element)) => IterableMixinWorkaround.forEach(this, f);
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
+@DomName('History')
+class History implements HistoryBase native "*History" {
- Iterable map(f(num element)) =>
- IterableMixinWorkaround.mapList(this, f);
+ /**
+ * Checks if the State APIs are supported on the current platform.
+ *
+ * See also:
+ *
+ * * [pushState]
+ * * [replaceState]
+ * * [state]
+ */
+ static bool get supportsState => JS('bool', '!!window.history.pushState');
- Iterable<num> where(bool f(num element)) =>
- IterableMixinWorkaround.where(this, f);
+ @DomName('History.length')
+ @DocsEditable
+ final int length;
- Iterable expand(Iterable f(num element)) =>
- IterableMixinWorkaround.expand(this, f);
+ dynamic get state => _convertNativeToDart_SerializedScriptValue(this._get_state);
+ @JSName('state')
+ @DomName('History.state')
+ @DocsEditable
+ @annotation_Creates_SerializedScriptValue
+ @annotation_Returns_SerializedScriptValue
+ final dynamic _get_state;
- bool every(bool f(num element)) => IterableMixinWorkaround.every(this, f);
+ @DomName('History.back')
+ @DocsEditable
+ void back() native;
- bool any(bool f(num element)) => IterableMixinWorkaround.any(this, f);
+ @DomName('History.forward')
+ @DocsEditable
+ void forward() native;
- List<num> toList({ bool growable: true }) =>
- new List<num>.from(this, growable: growable);
+ @DomName('History.go')
+ @DocsEditable
+ void go(int distance) native;
- Set<num> toSet() => new Set<num>.from(this);
+ @DomName('History.pushState')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ void pushState(Object data, String title, [String url]) native;
+
+ @DomName('History.replaceState')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ void replaceState(Object data, String title, [String url]) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('HTMLAllCollection')
+class HtmlAllCollection implements JavaScriptIndexingBehavior, List<Node> native "*HTMLAllCollection" {
+
+ @DomName('HTMLAllCollection.length')
+ @DocsEditable
+ int get length => JS("int", "#.length", this);
+
+ Node operator[](int index) => JS("Node", "#[#]", this, index);
+
+ void operator[]=(int index, Node value) {
+ throw new UnsupportedError("Cannot assign element of immutable List.");
+ }
+ // -- start List<Node> mixins.
+ // Node is the element type.
+
+ // From Iterable<Node>:
+
+ Iterator<Node> get iterator {
+ // Note: NodeLists are not fixed size. And most probably length shouldn't
+ // be cached in both iterator _and_ forEach method. For now caching it
+ // for consistency.
+ return new FixedSizeListIterator<Node>(this);
+ }
+
+ dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Node)) {
+ return IterableMixinWorkaround.reduce(this, initialValue, combine);
+ }
+
+ bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
+
+ void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
+
+ String join([String separator]) =>
+ IterableMixinWorkaround.joinList(this, separator);
+
+ Iterable map(f(Node element)) =>
+ IterableMixinWorkaround.mapList(this, f);
+
+ Iterable<Node> where(bool f(Node element)) =>
+ IterableMixinWorkaround.where(this, f);
+
+ Iterable expand(Iterable f(Node element)) =>
+ IterableMixinWorkaround.expand(this, f);
+
+ bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
+
+ bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
+
+ List<Node> toList({ bool growable: true }) =>
+ new List<Node>.from(this, growable: growable);
+
+ Set<Node> toSet() => new Set<Node>.from(this);
bool get isEmpty => this.length == 0;
- Iterable<num> take(int n) => IterableMixinWorkaround.takeList(this, n);
+ Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
- Iterable<num> takeWhile(bool test(num value)) {
+ Iterable<Node> takeWhile(bool test(Node value)) {
return IterableMixinWorkaround.takeWhile(this, test);
}
- Iterable<num> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+ Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
- Iterable<num> skipWhile(bool test(num value)) {
+ Iterable<Node> skipWhile(bool test(Node value)) {
return IterableMixinWorkaround.skipWhile(this, test);
}
- num firstWhere(bool test(num value), { num orElse() }) {
+ Node firstWhere(bool test(Node value), { Node orElse() }) {
return IterableMixinWorkaround.firstWhere(this, test, orElse);
}
- num lastWhere(bool test(num value), {num orElse()}) {
+ Node lastWhere(bool test(Node value), {Node orElse()}) {
return IterableMixinWorkaround.lastWhereList(this, test, orElse);
}
- num singleWhere(bool test(num value)) {
+ Node singleWhere(bool test(Node value)) {
return IterableMixinWorkaround.singleWhere(this, test);
}
- num elementAt(int index) {
+ Node elementAt(int index) {
return this[index];
}
- // From Collection<num>:
+ // From Collection<Node>:
- void add(num value) {
+ void add(Node value) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- void addLast(num value) {
+ void addLast(Node value) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- void addAll(Iterable<num> iterable) {
+ void addAll(Iterable<Node> iterable) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- // From List<num>:
+ // From List<Node>:
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
@@ -11668,49 +11696,49 @@ class Float64Array extends ArrayBufferView implements JavaScriptIndexingBehavior
throw new UnsupportedError("Cannot clear immutable List.");
}
- Iterable<num> get reversed {
+ Iterable<Node> get reversed {
return IterableMixinWorkaround.reversedList(this);
}
- void sort([int compare(num a, num b)]) {
+ void sort([int compare(Node a, Node b)]) {
throw new UnsupportedError("Cannot sort immutable List.");
}
- int indexOf(num element, [int start = 0]) =>
+ int indexOf(Node element, [int start = 0]) =>
Lists.indexOf(this, element, start, this.length);
- int lastIndexOf(num element, [int start]) {
+ int lastIndexOf(Node element, [int start]) {
if (start == null) start = length - 1;
return Lists.lastIndexOf(this, element, start);
}
- num get first {
+ Node get first {
if (this.length > 0) return this[0];
throw new StateError("No elements");
}
- num get last {
+ Node get last {
if (this.length > 0) return this[this.length - 1];
throw new StateError("No elements");
}
- num get single {
+ Node get single {
if (length == 1) return this[0];
if (length == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
- num min([int compare(num a, num b)]) =>
+ Node min([int compare(Node a, Node b)]) =>
IterableMixinWorkaround.min(this, compare);
- num max([int compare(num a, num b)]) =>
+ Node max([int compare(Node a, Node b)]) =>
IterableMixinWorkaround.max(this, compare);
- num removeAt(int pos) {
+ Node removeAt(int pos) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- num removeLast() {
+ Node removeLast() {
throw new UnsupportedError("Cannot remove from immutable List.");
}
@@ -11726,15 +11754,15 @@ class Float64Array extends ArrayBufferView implements JavaScriptIndexingBehavior
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void removeWhere(bool test(num element)) {
+ void removeWhere(bool test(Node element)) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void retainWhere(bool test(num element)) {
+ void retainWhere(bool test(Node element)) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void setRange(int start, int rangeLength, List<num> from, [int startFrom]) {
+ void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
throw new UnsupportedError("Cannot setRange on immutable List.");
}
@@ -11742,28 +11770,31 @@ class Float64Array extends ArrayBufferView implements JavaScriptIndexingBehavior
throw new UnsupportedError("Cannot removeRange on immutable List.");
}
- void insertRange(int start, int rangeLength, [num initialValue]) {
+ void insertRange(int start, int rangeLength, [Node initialValue]) {
throw new UnsupportedError("Cannot insertRange on immutable List.");
}
- List<num> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <num>[]);
+ List<Node> getRange(int start, int rangeLength) =>
+ Lists.getRange(this, start, rangeLength, <Node>[]);
- Map<int, num> asMap() =>
+ Map<int, Node> asMap() =>
IterableMixinWorkaround.asMapList(this);
- // -- end List<num> mixins.
+ // -- end List<Node> mixins.
+
+ @DomName('HTMLAllCollection.item')
+ @DocsEditable
+ Node item(int index) native;
- @JSName('set')
- @DomName('Float64Array.set')
+ @DomName('HTMLAllCollection.namedItem')
@DocsEditable
- void setElements(Object array, [int offset]) native;
+ Node namedItem(String name) native;
- @DomName('Float64Array.subarray')
+ @DomName('HTMLAllCollection.tags')
@DocsEditable
- @Returns('Float64Array')
- @Creates('Float64Array')
- List<double> subarray(int start, [int end]) native;
+ @Returns('NodeList')
+ @Creates('NodeList')
+ List<Node> tags(String name) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -11771,328 +11802,340 @@ class Float64Array extends ArrayBufferView implements JavaScriptIndexingBehavior
@DocsEditable
-@DomName('FocusEvent')
-class FocusEvent extends UIEvent native "*FocusEvent" {
+@DomName('HTMLCollection')
+class HtmlCollection implements JavaScriptIndexingBehavior, List<Node> native "*HTMLCollection" {
- EventTarget get relatedTarget => _convertNativeToDart_EventTarget(this._get_relatedTarget);
- @JSName('relatedTarget')
- @DomName('FocusEvent.relatedTarget')
+ @DomName('HTMLCollection.length')
@DocsEditable
- final dynamic _get_relatedTarget;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ int get length => JS("int", "#.length", this);
+ Node operator[](int index) => JS("Node", "#[#]", this, index);
-@DocsEditable
-@DomName('FormData')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class FormData native "*FormData" {
+ void operator[]=(int index, Node value) {
+ throw new UnsupportedError("Cannot assign element of immutable List.");
+ }
+ // -- start List<Node> mixins.
+ // Node is the element type.
- @DomName('DOMFormData.DOMFormData')
- @DocsEditable
- factory FormData([FormElement form]) {
- if (?form) {
- return FormData._create_1(form);
- }
- return FormData._create_2();
+ // From Iterable<Node>:
+
+ Iterator<Node> get iterator {
+ // Note: NodeLists are not fixed size. And most probably length shouldn't
+ // be cached in both iterator _and_ forEach method. For now caching it
+ // for consistency.
+ return new FixedSizeListIterator<Node>(this);
}
- static FormData _create_1(form) => JS('FormData', 'new FormData(#)', form);
- static FormData _create_2() => JS('FormData', 'new FormData()');
- /// Checks if this type is supported on the current platform.
- static bool get supported => JS('bool', '!!(window.FormData)');
+ dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Node)) {
+ return IterableMixinWorkaround.reduce(this, initialValue, combine);
+ }
- @DomName('DOMFormData.append')
- @DocsEditable
- void append(String name, value, [String filename]) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
+ void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
-@DocsEditable
-@DomName('HTMLFormElement')
-class FormElement extends Element native "*HTMLFormElement" {
+ String join([String separator]) =>
+ IterableMixinWorkaround.joinList(this, separator);
- @DomName('HTMLFormElement.HTMLFormElement')
- @DocsEditable
- factory FormElement() => document.$dom_createElement("form");
+ Iterable map(f(Node element)) =>
+ IterableMixinWorkaround.mapList(this, f);
- @DomName('HTMLFormElement.acceptCharset')
- @DocsEditable
- String acceptCharset;
+ Iterable<Node> where(bool f(Node element)) =>
+ IterableMixinWorkaround.where(this, f);
- @DomName('HTMLFormElement.action')
- @DocsEditable
- String action;
+ Iterable expand(Iterable f(Node element)) =>
+ IterableMixinWorkaround.expand(this, f);
- @DomName('HTMLFormElement.autocomplete')
- @DocsEditable
- String autocomplete;
+ bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
- @DomName('HTMLFormElement.encoding')
- @DocsEditable
- String encoding;
+ bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
- @DomName('HTMLFormElement.enctype')
- @DocsEditable
- String enctype;
+ List<Node> toList({ bool growable: true }) =>
+ new List<Node>.from(this, growable: growable);
- @DomName('HTMLFormElement.length')
- @DocsEditable
- final int length;
+ Set<Node> toSet() => new Set<Node>.from(this);
- @DomName('HTMLFormElement.method')
- @DocsEditable
- String method;
+ bool get isEmpty => this.length == 0;
- @DomName('HTMLFormElement.name')
- @DocsEditable
- String name;
+ Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
- @DomName('HTMLFormElement.noValidate')
- @DocsEditable
- bool noValidate;
+ Iterable<Node> takeWhile(bool test(Node value)) {
+ return IterableMixinWorkaround.takeWhile(this, test);
+ }
- @DomName('HTMLFormElement.target')
- @DocsEditable
- String target;
+ Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
- @DomName('HTMLFormElement.checkValidity')
- @DocsEditable
- bool checkValidity() native;
+ Iterable<Node> skipWhile(bool test(Node value)) {
+ return IterableMixinWorkaround.skipWhile(this, test);
+ }
- @DomName('HTMLFormElement.reset')
- @DocsEditable
- void reset() native;
+ Node firstWhere(bool test(Node value), { Node orElse() }) {
+ return IterableMixinWorkaround.firstWhere(this, test, orElse);
+ }
- @DomName('HTMLFormElement.submit')
- @DocsEditable
- void submit() native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ Node lastWhere(bool test(Node value), {Node orElse()}) {
+ return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+ }
+ Node singleWhere(bool test(Node value)) {
+ return IterableMixinWorkaround.singleWhere(this, test);
+ }
-@DocsEditable
-@DomName('Gamepad')
-class Gamepad native "*Gamepad" {
+ Node elementAt(int index) {
+ return this[index];
+ }
- @DomName('Gamepad.axes')
- @DocsEditable
- final List<num> axes;
+ // From Collection<Node>:
- @DomName('Gamepad.buttons')
- @DocsEditable
- final List<num> buttons;
+ void add(Node value) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('Gamepad.id')
- @DocsEditable
- final String id;
+ void addLast(Node value) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('Gamepad.index')
- @DocsEditable
- final int index;
+ void addAll(Iterable<Node> iterable) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('Gamepad.timestamp')
- @DocsEditable
- final int timestamp;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ // From List<Node>:
+ void set length(int value) {
+ throw new UnsupportedError("Cannot resize immutable List.");
+ }
+ void clear() {
+ throw new UnsupportedError("Cannot clear immutable List.");
+ }
-@DocsEditable
-@DomName('Geolocation')
-class Geolocation native "*Geolocation" {
+ Iterable<Node> get reversed {
+ return IterableMixinWorkaround.reversedList(this);
+ }
- @DomName('Geolocation.getCurrentPosition')
- Future<Geoposition> getCurrentPosition({bool enableHighAccuracy,
- Duration timeout, Duration maximumAge}) {
- var options = {};
- if (enableHighAccuracy != null) {
- options['enableHighAccuracy'] = enableHighAccuracy;
- }
- if (timeout != null) {
- options['timeout'] = timeout.inMilliseconds;
- }
- if (maximumAge != null) {
- options['maximumAge'] = maximumAge.inMilliseconds;
- }
- var completer = new Completer<Geoposition>();
- try {
- $dom_getCurrentPosition(
- (position) {
- completer.complete(_ensurePosition(position));
- },
- (error) {
- completer.completeError(error);
- },
- options);
- } catch (e, stacktrace) {
- completer.completeError(e, stacktrace);
- }
- return completer.future;
+ void sort([int compare(Node a, Node b)]) {
+ throw new UnsupportedError("Cannot sort immutable List.");
}
- @DomName('Geolocation.watchPosition')
- Stream<Geoposition> watchPosition({bool enableHighAccuracy,
- Duration timeout, Duration maximumAge}) {
+ int indexOf(Node element, [int start = 0]) =>
+ Lists.indexOf(this, element, start, this.length);
- var options = {};
- if (enableHighAccuracy != null) {
- options['enableHighAccuracy'] = enableHighAccuracy;
- }
- if (timeout != null) {
- options['timeout'] = timeout.inMilliseconds;
- }
- if (maximumAge != null) {
- options['maximumAge'] = maximumAge.inMilliseconds;
- }
+ int lastIndexOf(Node element, [int start]) {
+ if (start == null) start = length - 1;
+ return Lists.lastIndexOf(this, element, start);
+ }
- int watchId;
- var controller;
- controller = new StreamController<Geoposition>(
- onSubscriptionStateChange: () {
- if (controller.hasSubscribers) {
- assert(watchId == null);
- watchId = $dom_watchPosition(
- (position) {
- controller.add(_ensurePosition(position));
- },
- (error) {
- controller.addError(error);
- },
- options);
- } else {
- assert(watchId != null);
- $dom_clearWatch(watchId);
- }
- });
+ Node get first {
+ if (this.length > 0) return this[0];
+ throw new StateError("No elements");
+ }
- return controller.stream;
+ Node get last {
+ if (this.length > 0) return this[this.length - 1];
+ throw new StateError("No elements");
}
- Geoposition _ensurePosition(domPosition) {
- try {
- // Firefox may throw on this.
- if (domPosition is Geoposition) {
- return domPosition;
- }
- } catch(e) {}
- return new _GeopositionWrapper(domPosition);
+ Node get single {
+ if (length == 1) return this[0];
+ if (length == 0) throw new StateError("No elements");
+ throw new StateError("More than one element");
}
+ Node min([int compare(Node a, Node b)]) =>
+ IterableMixinWorkaround.min(this, compare);
- @JSName('clearWatch')
- @DomName('Geolocation.clearWatch')
- @DocsEditable
- void $dom_clearWatch(int watchID) native;
+ Node max([int compare(Node a, Node b)]) =>
+ IterableMixinWorkaround.max(this, compare);
- @JSName('getCurrentPosition')
- @DomName('Geolocation.getCurrentPosition')
- @DocsEditable
- void $dom_getCurrentPosition(_PositionCallback successCallback, [_PositionErrorCallback errorCallback, Object options]) native;
+ Node removeAt(int pos) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @JSName('watchPosition')
- @DomName('Geolocation.watchPosition')
- @DocsEditable
- int $dom_watchPosition(_PositionCallback successCallback, [_PositionErrorCallback errorCallback, Object options]) native;
-}
+ Node removeLast() {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
-/**
- * Wrapper for Firefox- it returns an object which we cannot map correctly.
- * Basically Firefox was returning a [xpconnect wrapped nsIDOMGeoPosition] but
- * which has further oddities.
- */
-class _GeopositionWrapper implements Geoposition {
- var _ptr;
- _GeopositionWrapper(this._ptr);
+ void remove(Object object) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- Coordinates get coords => JS('Coordinates', '#.coords', _ptr);
- int get timestamp => JS('int', '#.timestamp', _ptr);
-}
+ void removeAll(Iterable elements) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+
+ void retainAll(Iterable elements) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+ void removeWhere(bool test(Node element)) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ void retainWhere(bool test(Node element)) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+ void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
+ throw new UnsupportedError("Cannot setRange on immutable List.");
+ }
-@DocsEditable
-@DomName('Geoposition')
-class Geoposition native "*Geoposition" {
+ void removeRange(int start, int rangeLength) {
+ throw new UnsupportedError("Cannot removeRange on immutable List.");
+ }
- @DomName('Geoposition.coords')
+ void insertRange(int start, int rangeLength, [Node initialValue]) {
+ throw new UnsupportedError("Cannot insertRange on immutable List.");
+ }
+
+ List<Node> getRange(int start, int rangeLength) =>
+ Lists.getRange(this, start, rangeLength, <Node>[]);
+
+ Map<int, Node> asMap() =>
+ IterableMixinWorkaround.asMapList(this);
+
+ // -- end List<Node> mixins.
+
+ @DomName('HTMLCollection.item')
@DocsEditable
- final Coordinates coords;
+ Node item(int index) native;
- @DomName('Geoposition.timestamp')
+ @DomName('HTMLCollection.namedItem')
@DocsEditable
- final int timestamp;
+ Node namedItem(String name) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// WARNING: Do not edit - generated code.
+
-@DocsEditable
-/**
- * An `<hr>` tag.
- */
-@DomName('HTMLHRElement')
-class HRElement extends Element native "*HTMLHRElement" {
+@DomName('HTMLDocument')
+class HtmlDocument extends Document native "*HTMLDocument" {
- @DomName('HTMLHRElement.HTMLHRElement')
+ @DomName('HTMLDocument.activeElement')
@DocsEditable
- factory HRElement() => document.$dom_createElement("hr");
-}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ final Element activeElement;
-// WARNING: Do not edit - generated code.
+ @DomName('Document.body')
+ BodyElement get body => document.$dom_body;
-@DomName('HashChangeEvent')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
+ @DomName('Document.body')
+ void set body(BodyElement value) {
+ document.$dom_body = value;
+ }
-class HashChangeEvent extends Event native "*HashChangeEvent" {
- factory HashChangeEvent(String type,
- {bool canBubble: true, bool cancelable: true, String oldUrl,
- String newUrl}) {
- var event = document.$dom_createEvent("HashChangeEvent");
- event.$dom_initHashChangeEvent(type, canBubble, cancelable, oldUrl, newUrl);
- return event;
+ @DomName('Document.caretRangeFromPoint')
+ Range caretRangeFromPoint(int x, int y) {
+ return document.$dom_caretRangeFromPoint(x, y);
}
- /// Checks if this type is supported on the current platform.
- static bool get supported => Device.isEventTypeSupported('HashChangeEvent');
+ @DomName('Document.elementFromPoint')
+ Element elementFromPoint(int x, int y) {
+ return document.$dom_elementFromPoint(x, y);
+ }
- @JSName('newURL')
- @DomName('HashChangeEvent.newURL')
- @DocsEditable
- final String newUrl;
+ /**
+ * Checks if the getCssCanvasContext API is supported on the current platform.
+ *
+ * See also:
+ *
+ * * [getCssCanvasContext]
+ */
+ static bool get supportsCssCanvasContext =>
+ JS('bool', '!!(document.getCSSCanvasContext)');
- @JSName('oldURL')
- @DomName('HashChangeEvent.oldURL')
- @DocsEditable
- final String oldUrl;
- @JSName('initHashChangeEvent')
- @DomName('HashChangeEvent.initHashChangeEvent')
- @DocsEditable
- void $dom_initHashChangeEvent(String type, bool canBubble, bool cancelable, String oldURL, String newURL) native;
+ /**
+ * Gets a CanvasRenderingContext which can be used as the CSS background of an
+ * element.
+ *
+ * CSS:
+ *
+ * background: -webkit-canvas(backgroundCanvas)
+ *
+ * Generate the canvas:
+ *
+ * var context = document.getCssCanvasContext('2d', 'backgroundCanvas',
+ * 100, 100);
+ * context.fillStyle = 'red';
+ * context.fillRect(0, 0, 100, 100);
+ *
+ * See also:
+ *
+ * * [supportsCssCanvasContext]
+ * * [CanvasElement.getContext]
+ */
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ @DomName('Document.getCSSCanvasContext')
+ CanvasRenderingContext getCssCanvasContext(String contextId, String name,
+ int width, int height) {
+ return document.$dom_getCssCanvasContext(contextId, name, width, height);
+ }
+
+ @DomName('Document.head')
+ HeadElement get head => document.$dom_head;
+
+ @DomName('Document.lastModified')
+ String get lastModified => document.$dom_lastModified;
+
+ @DomName('Document.preferredStylesheetSet')
+ String get preferredStylesheetSet => document.$dom_preferredStylesheetSet;
+
+ @DomName('Document.referrer')
+ String get referrer => document.$dom_referrer;
+
+ @DomName('Document.selectedStylesheetSet')
+ String get selectedStylesheetSet => document.$dom_selectedStylesheetSet;
+ void set selectedStylesheetSet(String value) {
+ document.$dom_selectedStylesheetSet = value;
+ }
+
+ @DomName('Document.styleSheets')
+ List<StyleSheet> get styleSheets => document.$dom_styleSheets;
+
+ @DomName('Document.title')
+ String get title => document.$dom_title;
+
+ @DomName('Document.title')
+ void set title(String value) {
+ document.$dom_title = value;
+ }
+
+ @DomName('Document.webkitCancelFullScreen')
+ void webkitCancelFullScreen() {
+ document.$dom_webkitCancelFullScreen();
+ }
+
+ @DomName('Document.webkitExitFullscreen')
+ void webkitExitFullscreen() {
+ document.$dom_webkitExitFullscreen();
+ }
+
+ @DomName('Document.webkitExitPointerLock')
+ void webkitExitPointerLock() {
+ document.$dom_webkitExitPointerLock();
+ }
+
+ @DomName('Document.webkitFullscreenElement')
+ Element get webkitFullscreenElement => document.$dom_webkitFullscreenElement;
+
+ @DomName('Document.webkitFullscreenEnabled')
+ bool get webkitFullscreenEnabled => document.$dom_webkitFullscreenEnabled;
+
+ @DomName('Document.webkitHidden')
+ bool get webkitHidden => document.$dom_webkitHidden;
+
+ @DomName('Document.webkitIsFullScreen')
+ bool get webkitIsFullScreen => document.$dom_webkitIsFullScreen;
+
+ @DomName('Document.webkitPointerLockElement')
+ Element get webkitPointerLockElement =>
+ document.$dom_webkitPointerLockElement;
+ @DomName('Document.webkitVisibilityState')
+ String get webkitVisibilityState => document.$dom_webkitVisibilityState;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -12100,12 +12143,12 @@ class HashChangeEvent extends Event native "*HashChangeEvent" {
@DocsEditable
-@DomName('HTMLHeadElement')
-class HeadElement extends Element native "*HTMLHeadElement" {
+@DomName('HTMLHtmlElement')
+class HtmlElement extends Element native "*HTMLHtmlElement" {
- @DomName('HTMLHeadElement.HTMLHeadElement')
+ @DomName('HTMLHtmlElement.HTMLHtmlElement')
@DocsEditable
- factory HeadElement() => document.$dom_createElement("head");
+ factory HtmlElement() => document.$dom_createElement("html");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -12113,3234 +12156,497 @@ class HeadElement extends Element native "*HTMLHeadElement" {
@DocsEditable
-@DomName('HTMLHeadingElement')
-class HeadingElement extends Element native "*HTMLHeadingElement" {
-
- @DomName('HTMLHeadingElement.HTMLHeadingElement')
- @DocsEditable
- factory HeadingElement.h1() => document.$dom_createElement("h1");
-
- @DomName('HTMLHeadingElement.HTMLHeadingElement')
- @DocsEditable
- factory HeadingElement.h2() => document.$dom_createElement("h2");
-
- @DomName('HTMLHeadingElement.HTMLHeadingElement')
- @DocsEditable
- factory HeadingElement.h3() => document.$dom_createElement("h3");
+@DomName('HTMLFormControlsCollection')
+class HtmlFormControlsCollection extends HtmlCollection native "*HTMLFormControlsCollection" {
- @DomName('HTMLHeadingElement.HTMLHeadingElement')
+ @DomName('HTMLFormControlsCollection.namedItem')
@DocsEditable
- factory HeadingElement.h4() => document.$dom_createElement("h4");
+ Node namedItem(String name) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('HTMLHeadingElement.HTMLHeadingElement')
- @DocsEditable
- factory HeadingElement.h5() => document.$dom_createElement("h5");
- @DomName('HTMLHeadingElement.HTMLHeadingElement')
- @DocsEditable
- factory HeadingElement.h6() => document.$dom_createElement("h6");
+@DocsEditable
+@DomName('HTMLOptionsCollection')
+class HtmlOptionsCollection extends HtmlCollection native "*HTMLOptionsCollection" {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DomName('History')
-class History implements HistoryBase native "*History" {
+/**
+ * A utility for retrieving data from a URL.
+ *
+ * HttpRequest can be used to obtain data from http, ftp, and file
+ * protocols.
+ *
+ * For example, suppose we're developing these API docs, and we
+ * wish to retrieve the HTML of the top-level page and print it out.
+ * The easiest way to do that would be:
+ *
+ * var httpRequest = HttpRequest.get('http://api.dartlang.org',
+ * (request) => print(request.responseText));
+ *
+ * **Important**: With the default behavior of this class, your
+ * code making the request should be served from the same origin (domain name,
+ * port, and application layer protocol) as the URL you are trying to access
+ * with HttpRequest. However, there are ways to
+ * [get around this restriction](http://www.dartlang.org/articles/json-web-service/#note-on-jsonp).
+ *
+ * See also:
+ *
+ * * [Dart article on using HttpRequests](http://www.dartlang.org/articles/json-web-service/#getting-data)
+ * * [JS XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest)
+ * * [Using XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest)
+ */
+@DomName('XMLHttpRequest')
+class HttpRequest extends EventTarget native "*XMLHttpRequest" {
/**
- * Checks if the State APIs are supported on the current platform.
+ * Creates a URL get request for the specified [url].
+ *
+ * The server response must be a `text/` mime type for this request to
+ * succeed.
+ *
+ * This is similar to [request] but specialized for HTTP GET requests which
+ * return text content.
*
* See also:
*
- * * [pushState]
- * * [replaceState]
- * * [state]
+ * * [request]
*/
- static bool get supportsState => JS('bool', '!!window.history.pushState');
-
- @DomName('History.length')
- @DocsEditable
- final int length;
+ static Future<String> getString(String url,
+ {bool withCredentials, void onProgress(ProgressEvent e)}) {
+ return request(url, withCredentials: withCredentials,
+ onProgress: onProgress).then((xhr) => xhr.responseText);
+ }
- dynamic get state => _convertNativeToDart_SerializedScriptValue(this._get_state);
- @JSName('state')
- @DomName('History.state')
- @DocsEditable
- @annotation_Creates_SerializedScriptValue
- @annotation_Returns_SerializedScriptValue
- final dynamic _get_state;
+ /**
+ * Creates a URL request for the specified [url].
+ *
+ * By default this will do an HTTP GET request, this can be overridden with
+ * [method].
+ *
+ * The Future is completed when the response is available.
+ *
+ * The [withCredentials] parameter specified that credentials such as a cookie
+ * (already) set in the header or
+ * [authorization headers](http://tools.ietf.org/html/rfc1945#section-10.2)
+ * should be specified for the request. Details to keep in mind when using
+ * credentials:
+ *
+ * * Using credentials is only useful for cross-origin requests.
+ * * The `Access-Control-Allow-Origin` header of `url` cannot contain a wildcard (*).
+ * * The `Access-Control-Allow-Credentials` header of `url` must be set to true.
+ * * If `Access-Control-Expose-Headers` has not been set to true, only a subset of all the response headers will be returned when calling [getAllRequestHeaders].
+ *
+ * Note that requests for file:// URIs are only supported by Chrome extensions
+ * with appropriate permissions in their manifest. Requests to file:// URIs
+ * will also never fail- the Future will always complete successfully, even
+ * when the file cannot be found.
+ *
+ * See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access_authentication).
+ */
+ static Future<HttpRequest> request(String url,
+ {String method, bool withCredentials, String responseType, sendData,
+ void onProgress(ProgressEvent e)}) {
+ var completer = new Completer<HttpRequest>();
- @DomName('History.back')
- @DocsEditable
- void back() native;
+ var xhr = new HttpRequest();
+ if (method == null) {
+ method = 'GET';
+ }
+ xhr.open(method, url, async: true);
- @DomName('History.forward')
- @DocsEditable
- void forward() native;
+ if (withCredentials != null) {
+ xhr.withCredentials = withCredentials;
+ }
- @DomName('History.go')
- @DocsEditable
- void go(int distance) native;
+ if (responseType != null) {
+ xhr.responseType = responseType;
+ }
- @DomName('History.pushState')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.FIREFOX)
- @SupportedBrowser(SupportedBrowser.IE, '10')
- @SupportedBrowser(SupportedBrowser.SAFARI)
- void pushState(Object data, String title, [String url]) native;
-
- @DomName('History.replaceState')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.FIREFOX)
- @SupportedBrowser(SupportedBrowser.IE, '10')
- @SupportedBrowser(SupportedBrowser.SAFARI)
- void replaceState(Object data, String title, [String url]) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('HTMLAllCollection')
-class HtmlAllCollection implements JavaScriptIndexingBehavior, List<Node> native "*HTMLAllCollection" {
-
- @DomName('HTMLAllCollection.length')
- @DocsEditable
- int get length => JS("int", "#.length", this);
-
- Node operator[](int index) => JS("Node", "#[#]", this, index);
-
- void operator[]=(int index, Node value) {
- throw new UnsupportedError("Cannot assign element of immutable List.");
- }
- // -- start List<Node> mixins.
- // Node is the element type.
-
- // From Iterable<Node>:
-
- Iterator<Node> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<Node>(this);
- }
-
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Node)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
-
- bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
-
- void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
-
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
-
- Iterable map(f(Node element)) =>
- IterableMixinWorkaround.mapList(this, f);
-
- Iterable<Node> where(bool f(Node element)) =>
- IterableMixinWorkaround.where(this, f);
-
- Iterable expand(Iterable f(Node element)) =>
- IterableMixinWorkaround.expand(this, f);
-
- bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
-
- bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
-
- List<Node> toList({ bool growable: true }) =>
- new List<Node>.from(this, growable: growable);
-
- Set<Node> toSet() => new Set<Node>.from(this);
-
- bool get isEmpty => this.length == 0;
-
- Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
- Iterable<Node> takeWhile(bool test(Node value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
-
- Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
- Iterable<Node> skipWhile(bool test(Node value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
-
- Node firstWhere(bool test(Node value), { Node orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
-
- Node lastWhere(bool test(Node value), {Node orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
-
- Node singleWhere(bool test(Node value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
-
- Node elementAt(int index) {
- return this[index];
- }
-
- // From Collection<Node>:
-
- void add(Node value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addLast(Node value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addAll(Iterable<Node> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- // From List<Node>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
-
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
-
- Iterable<Node> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
-
- void sort([int compare(Node a, Node b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
-
- int indexOf(Node element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
-
- int lastIndexOf(Node element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
-
- Node get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
-
- Node get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
-
- Node get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
-
- Node min([int compare(Node a, Node b)]) =>
- IterableMixinWorkaround.min(this, compare);
-
- Node max([int compare(Node a, Node b)]) =>
- IterableMixinWorkaround.max(this, compare);
-
- Node removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- Node removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void removeWhere(bool test(Node element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void retainWhere(bool test(Node element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
-
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
-
- void insertRange(int start, int rangeLength, [Node initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
-
- List<Node> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <Node>[]);
-
- Map<int, Node> asMap() =>
- IterableMixinWorkaround.asMapList(this);
-
- // -- end List<Node> mixins.
-
- @DomName('HTMLAllCollection.item')
- @DocsEditable
- Node item(int index) native;
-
- @DomName('HTMLAllCollection.namedItem')
- @DocsEditable
- Node namedItem(String name) native;
-
- @DomName('HTMLAllCollection.tags')
- @DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- List<Node> tags(String name) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('HTMLCollection')
-class HtmlCollection implements JavaScriptIndexingBehavior, List<Node> native "*HTMLCollection" {
-
- @DomName('HTMLCollection.length')
- @DocsEditable
- int get length => JS("int", "#.length", this);
-
- Node operator[](int index) => JS("Node", "#[#]", this, index);
-
- void operator[]=(int index, Node value) {
- throw new UnsupportedError("Cannot assign element of immutable List.");
- }
- // -- start List<Node> mixins.
- // Node is the element type.
-
- // From Iterable<Node>:
-
- Iterator<Node> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<Node>(this);
- }
-
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Node)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
-
- bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
-
- void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
-
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
-
- Iterable map(f(Node element)) =>
- IterableMixinWorkaround.mapList(this, f);
-
- Iterable<Node> where(bool f(Node element)) =>
- IterableMixinWorkaround.where(this, f);
-
- Iterable expand(Iterable f(Node element)) =>
- IterableMixinWorkaround.expand(this, f);
-
- bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
-
- bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
-
- List<Node> toList({ bool growable: true }) =>
- new List<Node>.from(this, growable: growable);
-
- Set<Node> toSet() => new Set<Node>.from(this);
-
- bool get isEmpty => this.length == 0;
-
- Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
- Iterable<Node> takeWhile(bool test(Node value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
-
- Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
- Iterable<Node> skipWhile(bool test(Node value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
-
- Node firstWhere(bool test(Node value), { Node orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
-
- Node lastWhere(bool test(Node value), {Node orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
-
- Node singleWhere(bool test(Node value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
-
- Node elementAt(int index) {
- return this[index];
- }
-
- // From Collection<Node>:
-
- void add(Node value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addLast(Node value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addAll(Iterable<Node> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- // From List<Node>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
-
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
-
- Iterable<Node> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
-
- void sort([int compare(Node a, Node b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
-
- int indexOf(Node element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
-
- int lastIndexOf(Node element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
-
- Node get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
-
- Node get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
-
- Node get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
-
- Node min([int compare(Node a, Node b)]) =>
- IterableMixinWorkaround.min(this, compare);
-
- Node max([int compare(Node a, Node b)]) =>
- IterableMixinWorkaround.max(this, compare);
-
- Node removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- Node removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void removeWhere(bool test(Node element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void retainWhere(bool test(Node element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
-
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
-
- void insertRange(int start, int rangeLength, [Node initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
-
- List<Node> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <Node>[]);
-
- Map<int, Node> asMap() =>
- IterableMixinWorkaround.asMapList(this);
-
- // -- end List<Node> mixins.
-
- @DomName('HTMLCollection.item')
- @DocsEditable
- Node item(int index) native;
-
- @DomName('HTMLCollection.namedItem')
- @DocsEditable
- Node namedItem(String name) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-@DomName('HTMLDocument')
-class HtmlDocument extends Document native "*HTMLDocument" {
-
- @DomName('HTMLDocument.activeElement')
- @DocsEditable
- final Element activeElement;
-
- @DomName('Document.body')
- BodyElement get body => document.$dom_body;
-
- @DomName('Document.body')
- void set body(BodyElement value) {
- document.$dom_body = value;
- }
-
- @DomName('Document.caretRangeFromPoint')
- Range caretRangeFromPoint(int x, int y) {
- return document.$dom_caretRangeFromPoint(x, y);
- }
-
- @DomName('Document.elementFromPoint')
- Element elementFromPoint(int x, int y) {
- return document.$dom_elementFromPoint(x, y);
- }
-
- /**
- * Checks if the getCssCanvasContext API is supported on the current platform.
- *
- * See also:
- *
- * * [getCssCanvasContext]
- */
- static bool get supportsCssCanvasContext =>
- JS('bool', '!!(document.getCSSCanvasContext)');
-
-
- /**
- * Gets a CanvasRenderingContext which can be used as the CSS background of an
- * element.
- *
- * CSS:
- *
- * background: -webkit-canvas(backgroundCanvas)
- *
- * Generate the canvas:
- *
- * var context = document.getCssCanvasContext('2d', 'backgroundCanvas',
- * 100, 100);
- * context.fillStyle = 'red';
- * context.fillRect(0, 0, 100, 100);
- *
- * See also:
- *
- * * [supportsCssCanvasContext]
- * * [CanvasElement.getContext]
- */
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- @DomName('Document.getCSSCanvasContext')
- CanvasRenderingContext getCssCanvasContext(String contextId, String name,
- int width, int height) {
- return document.$dom_getCssCanvasContext(contextId, name, width, height);
- }
-
- @DomName('Document.head')
- HeadElement get head => document.$dom_head;
-
- @DomName('Document.lastModified')
- String get lastModified => document.$dom_lastModified;
-
- @DomName('Document.preferredStylesheetSet')
- String get preferredStylesheetSet => document.$dom_preferredStylesheetSet;
-
- @DomName('Document.referrer')
- String get referrer => document.$dom_referrer;
-
- @DomName('Document.selectedStylesheetSet')
- String get selectedStylesheetSet => document.$dom_selectedStylesheetSet;
- void set selectedStylesheetSet(String value) {
- document.$dom_selectedStylesheetSet = value;
- }
-
- @DomName('Document.styleSheets')
- List<StyleSheet> get styleSheets => document.$dom_styleSheets;
-
- @DomName('Document.title')
- String get title => document.$dom_title;
-
- @DomName('Document.title')
- void set title(String value) {
- document.$dom_title = value;
- }
-
- @DomName('Document.webkitCancelFullScreen')
- void webkitCancelFullScreen() {
- document.$dom_webkitCancelFullScreen();
- }
-
- @DomName('Document.webkitExitFullscreen')
- void webkitExitFullscreen() {
- document.$dom_webkitExitFullscreen();
- }
-
- @DomName('Document.webkitExitPointerLock')
- void webkitExitPointerLock() {
- document.$dom_webkitExitPointerLock();
- }
-
- @DomName('Document.webkitFullscreenElement')
- Element get webkitFullscreenElement => document.$dom_webkitFullscreenElement;
-
- @DomName('Document.webkitFullscreenEnabled')
- bool get webkitFullscreenEnabled => document.$dom_webkitFullscreenEnabled;
-
- @DomName('Document.webkitHidden')
- bool get webkitHidden => document.$dom_webkitHidden;
-
- @DomName('Document.webkitIsFullScreen')
- bool get webkitIsFullScreen => document.$dom_webkitIsFullScreen;
-
- @DomName('Document.webkitPointerLockElement')
- Element get webkitPointerLockElement =>
- document.$dom_webkitPointerLockElement;
-
- @DomName('Document.webkitVisibilityState')
- String get webkitVisibilityState => document.$dom_webkitVisibilityState;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('HTMLHtmlElement')
-class HtmlElement extends Element native "*HTMLHtmlElement" {
-
- @DomName('HTMLHtmlElement.HTMLHtmlElement')
- @DocsEditable
- factory HtmlElement() => document.$dom_createElement("html");
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('HTMLFormControlsCollection')
-class HtmlFormControlsCollection extends HtmlCollection native "*HTMLFormControlsCollection" {
-
- @DomName('HTMLFormControlsCollection.namedItem')
- @DocsEditable
- Node namedItem(String name) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('HTMLOptionsCollection')
-class HtmlOptionsCollection extends HtmlCollection native "*HTMLOptionsCollection" {
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-/**
- * A utility for retrieving data from a URL.
- *
- * HttpRequest can be used to obtain data from http, ftp, and file
- * protocols.
- *
- * For example, suppose we're developing these API docs, and we
- * wish to retrieve the HTML of the top-level page and print it out.
- * The easiest way to do that would be:
- *
- * var httpRequest = HttpRequest.get('http://api.dartlang.org',
- * (request) => print(request.responseText));
- *
- * **Important**: With the default behavior of this class, your
- * code making the request should be served from the same origin (domain name,
- * port, and application layer protocol) as the URL you are trying to access
- * with HttpRequest. However, there are ways to
- * [get around this restriction](http://www.dartlang.org/articles/json-web-service/#note-on-jsonp).
- *
- * See also:
- *
- * * [Dart article on using HttpRequests](http://www.dartlang.org/articles/json-web-service/#getting-data)
- * * [JS XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest)
- * * [Using XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest)
- */
-@DomName('XMLHttpRequest')
-class HttpRequest extends EventTarget native "*XMLHttpRequest" {
-
- /**
- * Creates a URL get request for the specified [url].
- *
- * The server response must be a `text/` mime type for this request to
- * succeed.
- *
- * This is similar to [request] but specialized for HTTP GET requests which
- * return text content.
- *
- * See also:
- *
- * * [request]
- */
- static Future<String> getString(String url,
- {bool withCredentials, void onProgress(ProgressEvent e)}) {
- return request(url, withCredentials: withCredentials,
- onProgress: onProgress).then((xhr) => xhr.responseText);
- }
-
- /**
- * Creates a URL request for the specified [url].
- *
- * By default this will do an HTTP GET request, this can be overridden with
- * [method].
- *
- * The Future is completed when the response is available.
- *
- * The [withCredentials] parameter specified that credentials such as a cookie
- * (already) set in the header or
- * [authorization headers](http://tools.ietf.org/html/rfc1945#section-10.2)
- * should be specified for the request. Details to keep in mind when using
- * credentials:
- *
- * * Using credentials is only useful for cross-origin requests.
- * * The `Access-Control-Allow-Origin` header of `url` cannot contain a wildcard (*).
- * * The `Access-Control-Allow-Credentials` header of `url` must be set to true.
- * * If `Access-Control-Expose-Headers` has not been set to true, only a subset of all the response headers will be returned when calling [getAllRequestHeaders].
- *
- * Note that requests for file:// URIs are only supported by Chrome extensions
- * with appropriate permissions in their manifest. Requests to file:// URIs
- * will also never fail- the Future will always complete successfully, even
- * when the file cannot be found.
- *
- * See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access_authentication).
- */
- static Future<HttpRequest> request(String url,
- {String method, bool withCredentials, String responseType, sendData,
- void onProgress(ProgressEvent e)}) {
- var completer = new Completer<HttpRequest>();
-
- var xhr = new HttpRequest();
- if (method == null) {
- method = 'GET';
- }
- xhr.open(method, url, async: true);
-
- if (withCredentials != null) {
- xhr.withCredentials = withCredentials;
- }
-
- if (responseType != null) {
- xhr.responseType = responseType;
- }
-
- if (onProgress != null) {
- xhr.onProgress.listen(onProgress);
- }
-
- xhr.onLoad.listen((e) {
- // Note: file:// URIs have status of 0.
- if ((xhr.status >= 200 && xhr.status < 300) ||
- xhr.status == 0 || xhr.status == 304) {
- completer.complete(xhr);
- } else {
- completer.completeError(e);
- }
- });
-
- xhr.onError.listen((e) {
- completer.completeError(e);
- });
-
- if (sendData != null) {
- xhr.send(sendData);
- } else {
- xhr.send();
- }
-
- return completer.future;
- }
-
- /**
- * Checks to see if the Progress event is supported on the current platform.
- */
- static bool get supportsProgressEvent {
- var xhr = new HttpRequest();
- return JS('bool', '"onprogress" in #', xhr);
- }
-
- /**
- * Checks to see if the LoadEnd event is supported on the current platform.
- */
- static bool get supportsLoadEndEvent {
- var xhr = new HttpRequest();
- return JS('bool', '"onloadend" in #', xhr);
- }
-
-
- @DomName('XMLHttpRequest.abortEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> abortEvent = const EventStreamProvider<ProgressEvent>('abort');
-
- @DomName('XMLHttpRequest.errorEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> errorEvent = const EventStreamProvider<ProgressEvent>('error');
-
- @DomName('XMLHttpRequest.loadEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamProvider<ProgressEvent>('load');
-
- @DomName('XMLHttpRequest.loadendEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStreamProvider<ProgressEvent>('loadend');
-
- @DomName('XMLHttpRequest.loadstartEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventStreamProvider<ProgressEvent>('loadstart');
-
- @DomName('XMLHttpRequest.progressEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
-
- @DomName('XMLHttpRequest.readystatechangeEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> readyStateChangeEvent = const EventStreamProvider<ProgressEvent>('readystatechange');
-
- /**
- * General constructor for any type of request (GET, POST, etc).
- *
- * This call is used in conjunction with [open]:
- *
- * var request = new HttpRequest();
- * request.open('GET', 'http://dartlang.org')
- * request.on.load.add((event) => print('Request complete'));
- *
- * is the (more verbose) equivalent of
- *
- * var request = new HttpRequest.get('http://dartlang.org',
- * (event) => print('Request complete'));
- */
- @DomName('XMLHttpRequest.XMLHttpRequest')
- @DocsEditable
- factory HttpRequest() {
- return HttpRequest._create_1();
- }
- static HttpRequest _create_1() => JS('HttpRequest', 'new XMLHttpRequest()');
-
- static const int DONE = 4;
-
- static const int HEADERS_RECEIVED = 2;
-
- static const int LOADING = 3;
-
- static const int OPENED = 1;
-
- static const int UNSENT = 0;
-
- /**
- * Indicator of the current state of the request:
- *
- * <table>
- * <tr>
- * <td>Value</td>
- * <td>State</td>
- * <td>Meaning</td>
- * </tr>
- * <tr>
- * <td>0</td>
- * <td>unsent</td>
- * <td><code>open()</code> has not yet been called</td>
- * </tr>
- * <tr>
- * <td>1</td>
- * <td>opened</td>
- * <td><code>send()</code> has not yet been called</td>
- * </tr>
- * <tr>
- * <td>2</td>
- * <td>headers received</td>
- * <td><code>sent()</code> has been called; response headers and <code>status</code> are available</td>
- * </tr>
- * <tr>
- * <td>3</td> <td>loading</td> <td><code>responseText</code> holds some data</td>
- * </tr>
- * <tr>
- * <td>4</td> <td>done</td> <td>request is complete</td>
- * </tr>
- * </table>
- */
- @DomName('XMLHttpRequest.readyState')
- @DocsEditable
- final int readyState;
-
- /**
- * The data received as a reponse from the request.
- *
- * The data could be in the
- * form of a [String], [ArrayBuffer], [Document], [Blob], or json (also a
- * [String]). `null` indicates request failure.
- */
- @DomName('XMLHttpRequest.response')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.FIREFOX)
- @SupportedBrowser(SupportedBrowser.IE, '10')
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Creates('ArrayBuffer|Blob|Document|=Object|=List|String|num')
- final Object response;
-
- /**
- * The response in string form or `null on failure.
- */
- @DomName('XMLHttpRequest.responseText')
- @DocsEditable
- final String responseText;
-
- /**
- * [String] telling the server the desired response format.
- *
- * Default is `String`.
- * Other options are one of 'arraybuffer', 'blob', 'document', 'json',
- * 'text'. Some newer browsers will throw NS_ERROR_DOM_INVALID_ACCESS_ERR if
- * `responseType` is set while performing a synchronous request.
- *
- * See also: [MDN responseType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType)
- */
- @DomName('XMLHttpRequest.responseType')
- @DocsEditable
- String responseType;
-
- @JSName('responseXML')
- /**
- * The request response, or null on failure.
- *
- * The response is processed as
- * `text/xml` stream, unless responseType = 'document' and the request is
- * synchronous.
- */
- @DomName('XMLHttpRequest.responseXML')
- @DocsEditable
- final Document responseXml;
-
- /**
- * The http result code from the request (200, 404, etc).
- * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
- */
- @DomName('XMLHttpRequest.status')
- @DocsEditable
- final int status;
-
- /**
- * The request response string (such as \"200 OK\").
- * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
- */
- @DomName('XMLHttpRequest.statusText')
- @DocsEditable
- final String statusText;
-
- /**
- * [EventTarget] that can hold listeners to track the progress of the request.
- * The events fired will be members of [HttpRequestUploadEvents].
- */
- @DomName('XMLHttpRequest.upload')
- @DocsEditable
- final HttpRequestUpload upload;
-
- /**
- * True if cross-site requests should use credentials such as cookies
- * or authorization headers; false otherwise.
- *
- * This value is ignored for same-site requests.
- */
- @DomName('XMLHttpRequest.withCredentials')
- @DocsEditable
- bool withCredentials;
-
- /**
- * Stop the current request.
- *
- * The request can only be stopped if readyState is `HEADERS_RECIEVED` or
- * `LOADING`. If this method is not in the process of being sent, the method
- * has no effect.
- */
- @DomName('XMLHttpRequest.abort')
- @DocsEditable
- void abort() native;
-
- @JSName('addEventListener')
- @DomName('XMLHttpRequest.addEventListener')
- @DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
-
- @DomName('XMLHttpRequest.dispatchEvent')
- @DocsEditable
- bool dispatchEvent(Event evt) native;
-
- /**
- * Retrieve all the response headers from a request.
- *
- * `null` if no headers have been received. For multipart requests,
- * `getAllResponseHeaders` will return the response headers for the current
- * part of the request.
- *
- * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Responses)
- * for a list of common response headers.
- */
- @DomName('XMLHttpRequest.getAllResponseHeaders')
- @DocsEditable
- String getAllResponseHeaders() native;
-
- /**
- * Return the response header named `header`, or `null` if not found.
- *
- * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Responses)
- * for a list of common response headers.
- */
- @DomName('XMLHttpRequest.getResponseHeader')
- @DocsEditable
- String getResponseHeader(String header) native;
-
- /**
- * Specify the desired `url`, and `method` to use in making the request.
- *
- * By default the request is done asyncronously, with no user or password
- * authentication information. If `async` is false, the request will be send
- * synchronously.
- *
- * Calling `open` again on a currently active request is equivalent to
- * calling `abort`.
- */
- @DomName('XMLHttpRequest.open')
- @DocsEditable
- void open(String method, String url, {bool async, String user, String password}) native;
-
- /**
- * Specify a particular MIME type (such as `text/xml`) desired for the
- * response.
- *
- * This value must be set before the request has been sent. See also the list
- * of [common MIME types](http://en.wikipedia.org/wiki/Internet_media_type#List_of_common_media_types)
- */
- @DomName('XMLHttpRequest.overrideMimeType')
- @DocsEditable
- void overrideMimeType(String override) native;
-
- @JSName('removeEventListener')
- @DomName('XMLHttpRequest.removeEventListener')
- @DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
-
- /**
- * Send the request with any given `data`.
- *
- * See also:
- * [send() docs](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send())
- * from MDN.
- */
- @DomName('XMLHttpRequest.send')
- @DocsEditable
- void send([data]) native;
-
- @DomName('XMLHttpRequest.setRequestHeader')
- @DocsEditable
- void setRequestHeader(String header, String value) native;
-
- /**
- * Event listeners to be notified when request has been aborted,
- * generally due to calling `httpRequest.abort()`.
- */
- @DomName('XMLHttpRequest.onabort')
- @DocsEditable
- Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
-
- /**
- * Event listeners to be notified when a request has failed, such as when a
- * cross-domain error occurred or the file wasn't found on the server.
- */
- @DomName('XMLHttpRequest.onerror')
- @DocsEditable
- Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
-
- /**
- * Event listeners to be notified once the request has completed
- * *successfully*.
- */
- @DomName('XMLHttpRequest.onload')
- @DocsEditable
- Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
-
- /**
- * Event listeners to be notified once the request has completed (on
- * either success or failure).
- */
- @DomName('XMLHttpRequest.onloadend')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.FIREFOX)
- @SupportedBrowser(SupportedBrowser.IE, '10')
- @SupportedBrowser(SupportedBrowser.SAFARI)
- Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
-
- /**
- * Event listeners to be notified when the request starts, once
- * `httpRequest.send()` has been called.
- */
- @DomName('XMLHttpRequest.onloadstart')
- @DocsEditable
- Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
-
- /**
- * Event listeners to be notified when data for the request
- * is being sent or loaded.
- *
- * Progress events are fired every 50ms or for every byte transmitted,
- * whichever is less frequent.
- */
- @DomName('XMLHttpRequest.onprogress')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.FIREFOX)
- @SupportedBrowser(SupportedBrowser.IE, '10')
- @SupportedBrowser(SupportedBrowser.SAFARI)
- Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
-
- /**
- * Event listeners to be notified every time the [HttpRequest]
- * object's `readyState` changes values.
- */
- @DomName('XMLHttpRequest.onreadystatechange')
- @DocsEditable
- Stream<ProgressEvent> get onReadyStateChange => readyStateChangeEvent.forTarget(this);
-
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('XMLHttpRequestException')
-class HttpRequestException native "*XMLHttpRequestException" {
-
- static const int ABORT_ERR = 102;
-
- static const int NETWORK_ERR = 101;
-
- @DomName('XMLHttpRequestException.code')
- @DocsEditable
- final int code;
-
- @DomName('XMLHttpRequestException.message')
- @DocsEditable
- final String message;
-
- @DomName('XMLHttpRequestException.name')
- @DocsEditable
- final String name;
-
- @DomName('XMLHttpRequestException.toString')
- @DocsEditable
- String toString() native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('XMLHttpRequestProgressEvent')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Experimental
-class HttpRequestProgressEvent extends ProgressEvent native "*XMLHttpRequestProgressEvent" {
-
- /// Checks if this type is supported on the current platform.
- static bool get supported => Device.isEventTypeSupported('XMLHttpRequestProgressEvent');
-
- @DomName('XMLHttpRequestProgressEvent.position')
- @DocsEditable
- final int position;
-
- @DomName('XMLHttpRequestProgressEvent.totalSize')
- @DocsEditable
- final int totalSize;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('XMLHttpRequestUpload')
-class HttpRequestUpload extends EventTarget native "*XMLHttpRequestUpload" {
-
- @DomName('XMLHttpRequestUpload.abortEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> abortEvent = const EventStreamProvider<ProgressEvent>('abort');
-
- @DomName('XMLHttpRequestUpload.errorEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> errorEvent = const EventStreamProvider<ProgressEvent>('error');
-
- @DomName('XMLHttpRequestUpload.loadEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamProvider<ProgressEvent>('load');
-
- @DomName('XMLHttpRequestUpload.loadendEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStreamProvider<ProgressEvent>('loadend');
-
- @DomName('XMLHttpRequestUpload.loadstartEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventStreamProvider<ProgressEvent>('loadstart');
-
- @DomName('XMLHttpRequestUpload.progressEvent')
- @DocsEditable
- static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
-
- @JSName('addEventListener')
- @DomName('XMLHttpRequestUpload.addEventListener')
- @DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
-
- @DomName('XMLHttpRequestUpload.dispatchEvent')
- @DocsEditable
- bool dispatchEvent(Event evt) native;
-
- @JSName('removeEventListener')
- @DomName('XMLHttpRequestUpload.removeEventListener')
- @DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
-
- @DomName('XMLHttpRequestUpload.onabort')
- @DocsEditable
- Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
-
- @DomName('XMLHttpRequestUpload.onerror')
- @DocsEditable
- Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
-
- @DomName('XMLHttpRequestUpload.onload')
- @DocsEditable
- Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
-
- @DomName('XMLHttpRequestUpload.onloadend')
- @DocsEditable
- Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
-
- @DomName('XMLHttpRequestUpload.onloadstart')
- @DocsEditable
- Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
-
- @DomName('XMLHttpRequestUpload.onprogress')
- @DocsEditable
- Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('HTMLIFrameElement')
-class IFrameElement extends Element native "*HTMLIFrameElement" {
-
- @DomName('HTMLIFrameElement.HTMLIFrameElement')
- @DocsEditable
- factory IFrameElement() => document.$dom_createElement("iframe");
-
- WindowBase get contentWindow => _convertNativeToDart_Window(this._get_contentWindow);
- @JSName('contentWindow')
- @DomName('HTMLIFrameElement.contentWindow')
- @DocsEditable
- @Creates('Window|=Object')
- @Returns('Window|=Object')
- final dynamic _get_contentWindow;
-
- @DomName('HTMLIFrameElement.height')
- @DocsEditable
- String height;
-
- @DomName('HTMLIFrameElement.name')
- @DocsEditable
- String name;
-
- @DomName('HTMLIFrameElement.sandbox')
- @DocsEditable
- String sandbox;
-
- @DomName('HTMLIFrameElement.src')
- @DocsEditable
- String src;
-
- @DomName('HTMLIFrameElement.srcdoc')
- @DocsEditable
- String srcdoc;
-
- @DomName('HTMLIFrameElement.width')
- @DocsEditable
- String width;
-}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-@DomName('ImageData')
-
-class ImageData native "*ImageData" {
-
-
- @DomName('ImageData.data')
- @DocsEditable
- final List<int> data;
-
- @DomName('ImageData.height')
- @DocsEditable
- final int height;
-
- @DomName('ImageData.width')
- @DocsEditable
- final int width;
-
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('HTMLImageElement')
-class ImageElement extends Element native "*HTMLImageElement" {
-
- @DomName('HTMLImageElement.HTMLImageElement')
- @DocsEditable
- factory ImageElement({String src, int width, int height}) {
- var e = document.$dom_createElement("img");
- if (src != null) e.src = src;
- if (width != null) e.width = width;
- if (height != null) e.height = height;
- return e;
- }
-
- @DomName('HTMLImageElement.alt')
- @DocsEditable
- String alt;
-
- @DomName('HTMLImageElement.border')
- @DocsEditable
- String border;
-
- @DomName('HTMLImageElement.complete')
- @DocsEditable
- final bool complete;
-
- @DomName('HTMLImageElement.crossOrigin')
- @DocsEditable
- String crossOrigin;
-
- @DomName('HTMLImageElement.height')
- @DocsEditable
- int height;
-
- @DomName('HTMLImageElement.isMap')
- @DocsEditable
- bool isMap;
-
- @DomName('HTMLImageElement.lowsrc')
- @DocsEditable
- String lowsrc;
-
- @DomName('HTMLImageElement.naturalHeight')
- @DocsEditable
- final int naturalHeight;
-
- @DomName('HTMLImageElement.naturalWidth')
- @DocsEditable
- final int naturalWidth;
-
- @DomName('HTMLImageElement.src')
- @DocsEditable
- String src;
-
- @DomName('HTMLImageElement.useMap')
- @DocsEditable
- String useMap;
-
- @DomName('HTMLImageElement.width')
- @DocsEditable
- int width;
-
- @DomName('HTMLImageElement.x')
- @DocsEditable
- final int x;
-
- @DomName('HTMLImageElement.y')
- @DocsEditable
- final int y;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DomName('HTMLInputElement')
-class InputElement extends Element implements
- HiddenInputElement,
- SearchInputElement,
- TextInputElement,
- UrlInputElement,
- TelephoneInputElement,
- EmailInputElement,
- PasswordInputElement,
- DateInputElement,
- MonthInputElement,
- WeekInputElement,
- TimeInputElement,
- LocalDateTimeInputElement,
- NumberInputElement,
- RangeInputElement,
- CheckboxInputElement,
- RadioButtonInputElement,
- FileUploadInputElement,
- SubmitButtonInputElement,
- ImageButtonInputElement,
- ResetButtonInputElement,
- ButtonInputElement
- native "*HTMLInputElement" {
-
- factory InputElement({String type}) {
- var e = document.$dom_createElement("input");
- if (type != null) {
- try {
- // IE throws an exception for unknown types.
- e.type = type;
- } catch(_) {}
- }
- return e;
- }
-
- @DomName('HTMLInputElement.webkitSpeechChangeEvent')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- static const EventStreamProvider<Event> speechChangeEvent = const EventStreamProvider<Event>('webkitSpeechChange');
-
- @DomName('HTMLInputElement.accept')
- @DocsEditable
- String accept;
-
- @DomName('HTMLInputElement.alt')
- @DocsEditable
- String alt;
-
- @DomName('HTMLInputElement.autocomplete')
- @DocsEditable
- String autocomplete;
-
- @DomName('HTMLInputElement.autofocus')
- @DocsEditable
- bool autofocus;
-
- @DomName('HTMLInputElement.checked')
- @DocsEditable
- bool checked;
-
- @DomName('HTMLInputElement.defaultChecked')
- @DocsEditable
- bool defaultChecked;
-
- @DomName('HTMLInputElement.defaultValue')
- @DocsEditable
- String defaultValue;
-
- @DomName('HTMLInputElement.dirName')
- @DocsEditable
- String dirName;
-
- @DomName('HTMLInputElement.disabled')
- @DocsEditable
- bool disabled;
-
- @DomName('HTMLInputElement.files')
- @DocsEditable
- @Returns('FileList')
- @Creates('FileList')
- List<File> files;
-
- @DomName('HTMLInputElement.form')
- @DocsEditable
- final FormElement form;
-
- @DomName('HTMLInputElement.formAction')
- @DocsEditable
- String formAction;
-
- @DomName('HTMLInputElement.formEnctype')
- @DocsEditable
- String formEnctype;
-
- @DomName('HTMLInputElement.formMethod')
- @DocsEditable
- String formMethod;
-
- @DomName('HTMLInputElement.formNoValidate')
- @DocsEditable
- bool formNoValidate;
-
- @DomName('HTMLInputElement.formTarget')
- @DocsEditable
- String formTarget;
-
- @DomName('HTMLInputElement.height')
- @DocsEditable
- int height;
-
- @DomName('HTMLInputElement.incremental')
- @DocsEditable
- bool incremental;
-
- @DomName('HTMLInputElement.indeterminate')
- @DocsEditable
- bool indeterminate;
-
- @DomName('HTMLInputElement.labels')
- @DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- final List<Node> labels;
-
- @DomName('HTMLInputElement.list')
- @DocsEditable
- final Element list;
-
- @DomName('HTMLInputElement.max')
- @DocsEditable
- String max;
-
- @DomName('HTMLInputElement.maxLength')
- @DocsEditable
- int maxLength;
-
- @DomName('HTMLInputElement.min')
- @DocsEditable
- String min;
-
- @DomName('HTMLInputElement.multiple')
- @DocsEditable
- bool multiple;
-
- @DomName('HTMLInputElement.name')
- @DocsEditable
- String name;
-
- @DomName('HTMLInputElement.pattern')
- @DocsEditable
- String pattern;
-
- @DomName('HTMLInputElement.placeholder')
- @DocsEditable
- String placeholder;
-
- @DomName('HTMLInputElement.readOnly')
- @DocsEditable
- bool readOnly;
-
- @DomName('HTMLInputElement.required')
- @DocsEditable
- bool required;
-
- @DomName('HTMLInputElement.selectionDirection')
- @DocsEditable
- String selectionDirection;
-
- @DomName('HTMLInputElement.selectionEnd')
- @DocsEditable
- int selectionEnd;
-
- @DomName('HTMLInputElement.selectionStart')
- @DocsEditable
- int selectionStart;
-
- @DomName('HTMLInputElement.size')
- @DocsEditable
- int size;
-
- @DomName('HTMLInputElement.src')
- @DocsEditable
- String src;
-
- @DomName('HTMLInputElement.step')
- @DocsEditable
- String step;
-
- @DomName('HTMLInputElement.type')
- @DocsEditable
- String type;
-
- @DomName('HTMLInputElement.useMap')
- @DocsEditable
- String useMap;
-
- @DomName('HTMLInputElement.validationMessage')
- @DocsEditable
- final String validationMessage;
-
- @DomName('HTMLInputElement.validity')
- @DocsEditable
- final ValidityState validity;
-
- @DomName('HTMLInputElement.value')
- @DocsEditable
- String value;
-
- DateTime get valueAsDate => _convertNativeToDart_DateTime(this._get_valueAsDate);
- @JSName('valueAsDate')
- @DomName('HTMLInputElement.valueAsDate')
- @DocsEditable
- final dynamic _get_valueAsDate;
-
- void set valueAsDate(DateTime value) {
- this._set_valueAsDate = _convertDartToNative_DateTime(value);
- }
- void set _set_valueAsDate(/*dynamic*/ value) {
- JS("void", "#.valueAsDate = #", this, value);
- }
-
- @DomName('HTMLInputElement.valueAsNumber')
- @DocsEditable
- num valueAsNumber;
-
- @JSName('webkitEntries')
- @DomName('HTMLInputElement.webkitEntries')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- @Returns('_EntryArray')
- @Creates('_EntryArray')
- final List<Entry> entries;
-
- @JSName('webkitGrammar')
- @DomName('HTMLInputElement.webkitGrammar')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- bool grammar;
-
- @JSName('webkitSpeech')
- @DomName('HTMLInputElement.webkitSpeech')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- bool speech;
-
- @JSName('webkitdirectory')
- @DomName('HTMLInputElement.webkitdirectory')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- bool directory;
-
- @DomName('HTMLInputElement.width')
- @DocsEditable
- int width;
-
- @DomName('HTMLInputElement.willValidate')
- @DocsEditable
- final bool willValidate;
-
- @DomName('HTMLInputElement.checkValidity')
- @DocsEditable
- bool checkValidity() native;
-
- @DomName('HTMLInputElement.select')
- @DocsEditable
- void select() native;
-
- @DomName('HTMLInputElement.setCustomValidity')
- @DocsEditable
- void setCustomValidity(String error) native;
-
- @DomName('HTMLInputElement.setRangeText')
- @DocsEditable
- void setRangeText(String replacement, {int start, int end, String selectionMode}) native;
-
- @DomName('HTMLInputElement.setSelectionRange')
- @DocsEditable
- void setSelectionRange(int start, int end, [String direction]) native;
-
- @DomName('HTMLInputElement.stepDown')
- @DocsEditable
- void stepDown([int n]) native;
-
- @DomName('HTMLInputElement.stepUp')
- @DocsEditable
- void stepUp([int n]) native;
-
- @DomName('HTMLInputElement.onwebkitSpeechChange')
- @DocsEditable
- Stream<Event> get onSpeechChange => speechChangeEvent.forTarget(this);
-
-}
-
-
-// Interfaces representing the InputElement APIs which are supported
-// for the various types of InputElement.
-// From http://dev.w3.org/html5/spec/the-input-element.html#the-input-element.
-
-/**
- * Exposes the functionality common between all InputElement types.
- */
-abstract class InputElementBase implements Element {
- @DomName('HTMLInputElement.autofocus')
- bool autofocus;
-
- @DomName('HTMLInputElement.disabled')
- bool disabled;
-
- @DomName('HTMLInputElement.incremental')
- bool incremental;
-
- @DomName('HTMLInputElement.indeterminate')
- bool indeterminate;
-
- @DomName('HTMLInputElement.labels')
- List<Node> get labels;
-
- @DomName('HTMLInputElement.name')
- String name;
-
- @DomName('HTMLInputElement.validationMessage')
- String get validationMessage;
-
- @DomName('HTMLInputElement.validity')
- ValidityState get validity;
-
- @DomName('HTMLInputElement.value')
- String value;
-
- @DomName('HTMLInputElement.willValidate')
- bool get willValidate;
-
- @DomName('HTMLInputElement.checkValidity')
- bool checkValidity();
-
- @DomName('HTMLInputElement.setCustomValidity')
- void setCustomValidity(String error);
-}
-
-/**
- * Hidden input which is not intended to be seen or edited by the user.
- */
-abstract class HiddenInputElement implements Element {
- factory HiddenInputElement() => new InputElement(type: 'hidden');
-}
-
-
-/**
- * Base interface for all inputs which involve text editing.
- */
-abstract class TextInputElementBase implements InputElementBase {
- @DomName('HTMLInputElement.autocomplete')
- String autocomplete;
-
- @DomName('HTMLInputElement.maxLength')
- int maxLength;
-
- @DomName('HTMLInputElement.pattern')
- String pattern;
-
- @DomName('HTMLInputElement.placeholder')
- String placeholder;
-
- @DomName('HTMLInputElement.readOnly')
- bool readOnly;
-
- @DomName('HTMLInputElement.required')
- bool required;
-
- @DomName('HTMLInputElement.size')
- int size;
-
- @DomName('HTMLInputElement.select')
- void select();
-
- @DomName('HTMLInputElement.selectionDirection')
- String selectionDirection;
-
- @DomName('HTMLInputElement.selectionEnd')
- int selectionEnd;
-
- @DomName('HTMLInputElement.selectionStart')
- int selectionStart;
-
- @DomName('HTMLInputElement.setSelectionRange')
- void setSelectionRange(int start, int end, [String direction]);
-}
-
-/**
- * Similar to [TextInputElement], but on platforms where search is styled
- * differently this will get the search style.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-abstract class SearchInputElement implements TextInputElementBase {
- factory SearchInputElement() => new InputElement(type: 'search');
-
- @DomName('HTMLInputElement.dirName')
- String dirName;
-
- @DomName('HTMLInputElement.list')
- Element get list;
-
- /// Returns true if this input type is supported on the current platform.
- static bool get supported {
- return (new InputElement(type: 'search')).type == 'search';
- }
-}
-
-/**
- * A basic text input editor control.
- */
-abstract class TextInputElement implements TextInputElementBase {
- factory TextInputElement() => new InputElement(type: 'text');
-
- @DomName('HTMLInputElement.dirName')
- String dirName;
-
- @DomName('HTMLInputElement.list')
- Element get list;
-}
-
-/**
- * A control for editing an absolute URL.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-abstract class UrlInputElement implements TextInputElementBase {
- factory UrlInputElement() => new InputElement(type: 'url');
-
- @DomName('HTMLInputElement.list')
- Element get list;
-
- /// Returns true if this input type is supported on the current platform.
- static bool get supported {
- return (new InputElement(type: 'url')).type == 'url';
- }
-}
-
-/**
- * Represents a control for editing a telephone number.
- *
- * This provides a single line of text with minimal formatting help since
- * there is a wide variety of telephone numbers.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-abstract class TelephoneInputElement implements TextInputElementBase {
- factory TelephoneInputElement() => new InputElement(type: 'tel');
-
- @DomName('HTMLInputElement.list')
- Element get list;
-
- /// Returns true if this input type is supported on the current platform.
- static bool get supported {
- return (new InputElement(type: 'tel')).type == 'tel';
- }
-}
-
-/**
- * An e-mail address or list of e-mail addresses.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-abstract class EmailInputElement implements TextInputElementBase {
- factory EmailInputElement() => new InputElement(type: 'email');
-
- @DomName('HTMLInputElement.autocomplete')
- String autocomplete;
-
- @DomName('HTMLInputElement.autofocus')
- bool autofocus;
-
- @DomName('HTMLInputElement.list')
- Element get list;
-
- @DomName('HTMLInputElement.maxLength')
- int maxLength;
-
- @DomName('HTMLInputElement.multiple')
- bool multiple;
-
- @DomName('HTMLInputElement.pattern')
- String pattern;
-
- @DomName('HTMLInputElement.placeholder')
- String placeholder;
-
- @DomName('HTMLInputElement.readOnly')
- bool readOnly;
-
- @DomName('HTMLInputElement.required')
- bool required;
-
- @DomName('HTMLInputElement.size')
- int size;
-
- /// Returns true if this input type is supported on the current platform.
- static bool get supported {
- return (new InputElement(type: 'email')).type == 'email';
- }
-}
-
-/**
- * Text with no line breaks (sensitive information).
- */
-abstract class PasswordInputElement implements TextInputElementBase {
- factory PasswordInputElement() => new InputElement(type: 'password');
-}
-
-/**
- * Base interface for all input element types which involve ranges.
- */
-abstract class RangeInputElementBase implements InputElementBase {
-
- @DomName('HTMLInputElement.list')
- Element get list;
-
- @DomName('HTMLInputElement.max')
- String max;
-
- @DomName('HTMLInputElement.min')
- String min;
-
- @DomName('HTMLInputElement.step')
- String step;
-
- @DomName('HTMLInputElement.valueAsNumber')
- num valueAsNumber;
-
- @DomName('HTMLInputElement.stepDown')
- void stepDown([int n]);
-
- @DomName('HTMLInputElement.stepUp')
- void stepUp([int n]);
-}
-
-/**
- * A date (year, month, day) with no time zone.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Experimental
-abstract class DateInputElement implements RangeInputElementBase {
- factory DateInputElement() => new InputElement(type: 'date');
-
- @DomName('HTMLInputElement.valueAsDate')
- DateTime valueAsDate;
-
- @DomName('HTMLInputElement.readOnly')
- bool readOnly;
-
- @DomName('HTMLInputElement.required')
- bool required;
-
- /// Returns true if this input type is supported on the current platform.
- static bool get supported {
- return (new InputElement(type: 'date')).type == 'date';
- }
-}
-
-/**
- * A date consisting of a year and a month with no time zone.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Experimental
-abstract class MonthInputElement implements RangeInputElementBase {
- factory MonthInputElement() => new InputElement(type: 'month');
-
- @DomName('HTMLInputElement.valueAsDate')
- DateTime valueAsDate;
-
- @DomName('HTMLInputElement.readOnly')
- bool readOnly;
-
- @DomName('HTMLInputElement.required')
- bool required;
-
- /// Returns true if this input type is supported on the current platform.
- static bool get supported {
- return (new InputElement(type: 'month')).type == 'month';
- }
-}
-
-/**
- * A date consisting of a week-year number and a week number with no time zone.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Experimental
-abstract class WeekInputElement implements RangeInputElementBase {
- factory WeekInputElement() => new InputElement(type: 'week');
-
- @DomName('HTMLInputElement.valueAsDate')
- DateTime valueAsDate;
-
- @DomName('HTMLInputElement.readOnly')
- bool readOnly;
-
- @DomName('HTMLInputElement.required')
- bool required;
-
- /// Returns true if this input type is supported on the current platform.
- static bool get supported {
- return (new InputElement(type: 'week')).type == 'week';
- }
-}
-
-/**
- * A time (hour, minute, seconds, fractional seconds) with no time zone.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Experimental
-abstract class TimeInputElement implements RangeInputElementBase {
- factory TimeInputElement() => new InputElement(type: 'time');
-
- @DomName('HTMLInputElement.valueAsDate')
- DateTime valueAsDate;
-
- @DomName('HTMLInputElement.readOnly')
- bool readOnly;
-
- @DomName('HTMLInputElement.required')
- bool required;
-
- /// Returns true if this input type is supported on the current platform.
- static bool get supported {
- return (new InputElement(type: 'time')).type == 'time';
- }
-}
-
-/**
- * A date and time (year, month, day, hour, minute, second, fraction of a
- * second) with no time zone.
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Experimental
-abstract class LocalDateTimeInputElement implements RangeInputElementBase {
- factory LocalDateTimeInputElement() =>
- new InputElement(type: 'datetime-local');
-
- @DomName('HTMLInputElement.readOnly')
- bool readOnly;
-
- @DomName('HTMLInputElement.required')
- bool required;
-
- /// Returns true if this input type is supported on the current platform.
- static bool get supported {
- return (new InputElement(type: 'datetime-local')).type == 'datetime-local';
- }
-}
-
-/**
- * A numeric editor control.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.IE)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Experimental
-abstract class NumberInputElement implements RangeInputElementBase {
- factory NumberInputElement() => new InputElement(type: 'number');
-
- @DomName('HTMLInputElement.placeholder')
- String placeholder;
-
- @DomName('HTMLInputElement.readOnly')
- bool readOnly;
-
- @DomName('HTMLInputElement.required')
- bool required;
-
- /// Returns true if this input type is supported on the current platform.
- static bool get supported {
- return (new InputElement(type: 'number')).type == 'number';
- }
-}
-
-/**
- * Similar to [NumberInputElement] but the browser may provide more optimal
- * styling (such as a slider control).
- *
- * Use [supported] to check if this is supported on the current platform.
- */
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@Experimental
-abstract class RangeInputElement implements RangeInputElementBase {
- factory RangeInputElement() => new InputElement(type: 'range');
-
- /// Returns true if this input type is supported on the current platform.
- static bool get supported {
- return (new InputElement(type: 'range')).type == 'range';
- }
-}
-
-/**
- * A boolean editor control.
- *
- * Note that if [indeterminate] is set then this control is in a third
- * indeterminate state.
- */
-abstract class CheckboxInputElement implements InputElementBase {
- factory CheckboxInputElement() => new InputElement(type: 'checkbox');
-
- @DomName('HTMLInputElement.checked')
- bool checked;
-
- @DomName('HTMLInputElement.required')
- bool required;
-}
-
-
-/**
- * A control that when used with other [ReadioButtonInputElement] controls
- * forms a radio button group in which only one control can be checked at a
- * time.
- *
- * Radio buttons are considered to be in the same radio button group if:
- *
- * * They are all of type 'radio'.
- * * They all have either the same [FormElement] owner, or no owner.
- * * Their name attributes contain the same name.
- */
-abstract class RadioButtonInputElement implements InputElementBase {
- factory RadioButtonInputElement() => new InputElement(type: 'radio');
-
- @DomName('HTMLInputElement.checked')
- bool checked;
-
- @DomName('HTMLInputElement.required')
- bool required;
-}
-
-/**
- * A control for picking files from the user's computer.
- */
-abstract class FileUploadInputElement implements InputElementBase {
- factory FileUploadInputElement() => new InputElement(type: 'file');
-
- @DomName('HTMLInputElement.accept')
- String accept;
-
- @DomName('HTMLInputElement.multiple')
- bool multiple;
-
- @DomName('HTMLInputElement.required')
- bool required;
-
- @DomName('HTMLInputElement.files')
- List<File> files;
-}
-
-/**
- * A button, which when clicked, submits the form.
- */
-abstract class SubmitButtonInputElement implements InputElementBase {
- factory SubmitButtonInputElement() => new InputElement(type: 'submit');
-
- @DomName('HTMLInputElement.formAction')
- String formAction;
-
- @DomName('HTMLInputElement.formEnctype')
- String formEnctype;
-
- @DomName('HTMLInputElement.formMethod')
- String formMethod;
-
- @DomName('HTMLInputElement.formNoValidate')
- bool formNoValidate;
-
- @DomName('HTMLInputElement.formTarget')
- String formTarget;
-}
-
-/**
- * Either an image which the user can select a coordinate to or a form
- * submit button.
- */
-abstract class ImageButtonInputElement implements InputElementBase {
- factory ImageButtonInputElement() => new InputElement(type: 'image');
-
- @DomName('HTMLInputElement.alt')
- String alt;
-
- @DomName('HTMLInputElement.formAction')
- String formAction;
-
- @DomName('HTMLInputElement.formEnctype')
- String formEnctype;
-
- @DomName('HTMLInputElement.formMethod')
- String formMethod;
-
- @DomName('HTMLInputElement.formNoValidate')
- bool formNoValidate;
-
- @DomName('HTMLInputElement.formTarget')
- String formTarget;
-
- @DomName('HTMLInputElement.height')
- int height;
-
- @DomName('HTMLInputElement.src')
- String src;
-
- @DomName('HTMLInputElement.width')
- int width;
-}
-
-/**
- * A button, which when clicked, resets the form.
- */
-abstract class ResetButtonInputElement implements InputElementBase {
- factory ResetButtonInputElement() => new InputElement(type: 'reset');
-}
-
-/**
- * A button, with no default behavior.
- */
-abstract class ButtonInputElement implements InputElementBase {
- factory ButtonInputElement() => new InputElement(type: 'button');
-}
-
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('Int16Array')
-class Int16Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Int16Array" {
-
- @DomName('Int16Array.Int16Array')
- @DocsEditable
- factory Int16Array(int length) =>
- _TypedArrayFactoryProvider.createInt16Array(length);
-
- @DomName('Int16Array.fromList')
- @DocsEditable
- factory Int16Array.fromList(List<int> list) =>
- _TypedArrayFactoryProvider.createInt16Array_fromList(list);
-
- @DomName('Int16Array.fromBuffer')
- @DocsEditable
- factory Int16Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) =>
- _TypedArrayFactoryProvider.createInt16Array_fromBuffer(buffer, byteOffset, length);
-
- static const int BYTES_PER_ELEMENT = 2;
-
- @DomName('Int16Array.length')
- @DocsEditable
- int get length => JS("int", "#.length", this);
-
- int operator[](int index) => JS("int", "#[#]", this, index);
-
- void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); } // -- start List<int> mixins.
- // int is the element type.
-
- // From Iterable<int>:
-
- Iterator<int> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<int>(this);
- }
-
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
-
- bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
- void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
-
- Iterable map(f(int element)) =>
- IterableMixinWorkaround.mapList(this, f);
-
- Iterable<int> where(bool f(int element)) =>
- IterableMixinWorkaround.where(this, f);
-
- Iterable expand(Iterable f(int element)) =>
- IterableMixinWorkaround.expand(this, f);
-
- bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
- bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
- List<int> toList({ bool growable: true }) =>
- new List<int>.from(this, growable: growable);
-
- Set<int> toSet() => new Set<int>.from(this);
-
- bool get isEmpty => this.length == 0;
-
- Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
- Iterable<int> takeWhile(bool test(int value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
-
- Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
- Iterable<int> skipWhile(bool test(int value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
-
- int firstWhere(bool test(int value), { int orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
-
- int lastWhere(bool test(int value), {int orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
-
- int singleWhere(bool test(int value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
-
- int elementAt(int index) {
- return this[index];
- }
-
- // From Collection<int>:
-
- void add(int value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addLast(int value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addAll(Iterable<int> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- // From List<int>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
-
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
-
- Iterable<int> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
-
- void sort([int compare(int a, int b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
-
- int indexOf(int element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
-
- int lastIndexOf(int element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
-
- int get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
-
- int get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
-
- int get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
-
- int min([int compare(int a, int b)]) =>
- IterableMixinWorkaround.min(this, compare);
-
- int max([int compare(int a, int b)]) =>
- IterableMixinWorkaround.max(this, compare);
-
- int removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- int removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void removeWhere(bool test(int element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void retainWhere(bool test(int element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
-
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
-
- void insertRange(int start, int rangeLength, [int initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
-
- List<int> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <int>[]);
-
- Map<int, int> asMap() =>
- IterableMixinWorkaround.asMapList(this);
-
- // -- end List<int> mixins.
-
- @JSName('set')
- @DomName('Int16Array.set')
- @DocsEditable
- void setElements(Object array, [int offset]) native;
-
- @DomName('Int16Array.subarray')
- @DocsEditable
- @Returns('Int16Array')
- @Creates('Int16Array')
- List<int> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('Int32Array')
-class Int32Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Int32Array" {
-
- @DomName('Int32Array.Int32Array')
- @DocsEditable
- factory Int32Array(int length) =>
- _TypedArrayFactoryProvider.createInt32Array(length);
-
- @DomName('Int32Array.fromList')
- @DocsEditable
- factory Int32Array.fromList(List<int> list) =>
- _TypedArrayFactoryProvider.createInt32Array_fromList(list);
-
- @DomName('Int32Array.fromBuffer')
- @DocsEditable
- factory Int32Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) =>
- _TypedArrayFactoryProvider.createInt32Array_fromBuffer(buffer, byteOffset, length);
-
- static const int BYTES_PER_ELEMENT = 4;
-
- @DomName('Int32Array.length')
- @DocsEditable
- int get length => JS("int", "#.length", this);
-
- int operator[](int index) => JS("int", "#[#]", this, index);
-
- void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); } // -- start List<int> mixins.
- // int is the element type.
-
- // From Iterable<int>:
-
- Iterator<int> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<int>(this);
- }
-
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
-
- bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
- void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
-
- Iterable map(f(int element)) =>
- IterableMixinWorkaround.mapList(this, f);
-
- Iterable<int> where(bool f(int element)) =>
- IterableMixinWorkaround.where(this, f);
-
- Iterable expand(Iterable f(int element)) =>
- IterableMixinWorkaround.expand(this, f);
-
- bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
- bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
- List<int> toList({ bool growable: true }) =>
- new List<int>.from(this, growable: growable);
-
- Set<int> toSet() => new Set<int>.from(this);
-
- bool get isEmpty => this.length == 0;
-
- Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
- Iterable<int> takeWhile(bool test(int value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
-
- Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
- Iterable<int> skipWhile(bool test(int value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
-
- int firstWhere(bool test(int value), { int orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
-
- int lastWhere(bool test(int value), {int orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
-
- int singleWhere(bool test(int value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
-
- int elementAt(int index) {
- return this[index];
- }
-
- // From Collection<int>:
-
- void add(int value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addLast(int value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addAll(Iterable<int> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- // From List<int>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
-
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
-
- Iterable<int> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
-
- void sort([int compare(int a, int b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
-
- int indexOf(int element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
-
- int lastIndexOf(int element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
-
- int get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
-
- int get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
-
- int get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
-
- int min([int compare(int a, int b)]) =>
- IterableMixinWorkaround.min(this, compare);
-
- int max([int compare(int a, int b)]) =>
- IterableMixinWorkaround.max(this, compare);
-
- int removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- int removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void removeWhere(bool test(int element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void retainWhere(bool test(int element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
-
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
-
- void insertRange(int start, int rangeLength, [int initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
-
- List<int> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <int>[]);
-
- Map<int, int> asMap() =>
- IterableMixinWorkaround.asMapList(this);
-
- // -- end List<int> mixins.
-
- @JSName('set')
- @DomName('Int32Array.set')
- @DocsEditable
- void setElements(Object array, [int offset]) native;
-
- @DomName('Int32Array.subarray')
- @DocsEditable
- @Returns('Int32Array')
- @Creates('Int32Array')
- List<int> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('Int8Array')
-class Int8Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Int8Array" {
-
- @DomName('Int8Array.Int8Array')
- @DocsEditable
- factory Int8Array(int length) =>
- _TypedArrayFactoryProvider.createInt8Array(length);
-
- @DomName('Int8Array.fromList')
- @DocsEditable
- factory Int8Array.fromList(List<int> list) =>
- _TypedArrayFactoryProvider.createInt8Array_fromList(list);
-
- @DomName('Int8Array.fromBuffer')
- @DocsEditable
- factory Int8Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) =>
- _TypedArrayFactoryProvider.createInt8Array_fromBuffer(buffer, byteOffset, length);
-
- static const int BYTES_PER_ELEMENT = 1;
-
- @DomName('Int8Array.length')
- @DocsEditable
- int get length => JS("int", "#.length", this);
-
- int operator[](int index) => JS("int", "#[#]", this, index);
-
- void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); } // -- start List<int> mixins.
- // int is the element type.
-
- // From Iterable<int>:
-
- Iterator<int> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<int>(this);
- }
-
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
-
- bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
- void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
-
- Iterable map(f(int element)) =>
- IterableMixinWorkaround.mapList(this, f);
-
- Iterable<int> where(bool f(int element)) =>
- IterableMixinWorkaround.where(this, f);
-
- Iterable expand(Iterable f(int element)) =>
- IterableMixinWorkaround.expand(this, f);
-
- bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
- bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
- List<int> toList({ bool growable: true }) =>
- new List<int>.from(this, growable: growable);
-
- Set<int> toSet() => new Set<int>.from(this);
-
- bool get isEmpty => this.length == 0;
-
- Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
- Iterable<int> takeWhile(bool test(int value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
-
- Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
- Iterable<int> skipWhile(bool test(int value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
-
- int firstWhere(bool test(int value), { int orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
-
- int lastWhere(bool test(int value), {int orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
-
- int singleWhere(bool test(int value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
-
- int elementAt(int index) {
- return this[index];
- }
-
- // From Collection<int>:
-
- void add(int value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addLast(int value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addAll(Iterable<int> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- // From List<int>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
-
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
-
- Iterable<int> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
-
- void sort([int compare(int a, int b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
-
- int indexOf(int element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
-
- int lastIndexOf(int element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
-
- int get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
-
- int get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
-
- int get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
-
- int min([int compare(int a, int b)]) =>
- IterableMixinWorkaround.min(this, compare);
-
- int max([int compare(int a, int b)]) =>
- IterableMixinWorkaround.max(this, compare);
-
- int removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- int removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void removeWhere(bool test(int element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void retainWhere(bool test(int element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
-
- void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
-
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
-
- void insertRange(int start, int rangeLength, [int initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
-
- List<int> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <int>[]);
-
- Map<int, int> asMap() =>
- IterableMixinWorkaround.asMapList(this);
-
- // -- end List<int> mixins.
-
- @JSName('set')
- @DomName('Int8Array.set')
- @DocsEditable
- void setElements(Object array, [int offset]) native;
-
- @DomName('Int8Array.subarray')
- @DocsEditable
- @Returns('Int8Array')
- @Creates('Int8Array')
- List<int> subarray(int start, [int end]) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('JavaScriptCallFrame')
-class JavaScriptCallFrame native "*JavaScriptCallFrame" {
-
- static const int CATCH_SCOPE = 4;
-
- static const int CLOSURE_SCOPE = 3;
-
- static const int GLOBAL_SCOPE = 0;
-
- static const int LOCAL_SCOPE = 1;
-
- static const int WITH_SCOPE = 2;
-
- @DomName('JavaScriptCallFrame.caller')
- @DocsEditable
- final JavaScriptCallFrame caller;
-
- @DomName('JavaScriptCallFrame.column')
- @DocsEditable
- final int column;
-
- @DomName('JavaScriptCallFrame.functionName')
- @DocsEditable
- final String functionName;
-
- @DomName('JavaScriptCallFrame.line')
- @DocsEditable
- final int line;
-
- @DomName('JavaScriptCallFrame.scopeChain')
- @DocsEditable
- final List scopeChain;
-
- @DomName('JavaScriptCallFrame.sourceID')
- @DocsEditable
- final int sourceID;
-
- @DomName('JavaScriptCallFrame.thisObject')
- @DocsEditable
- final Object thisObject;
-
- @DomName('JavaScriptCallFrame.type')
- @DocsEditable
- final String type;
-
- @DomName('JavaScriptCallFrame.evaluate')
- @DocsEditable
- void evaluate(String script) native;
-
- @DomName('JavaScriptCallFrame.restart')
- @DocsEditable
- Object restart() native;
-
- @DomName('JavaScriptCallFrame.scopeType')
- @DocsEditable
- int scopeType(int scopeIndex) native;
-
- @DomName('JavaScriptCallFrame.setVariableValue')
- @DocsEditable
- Object setVariableValue(int scopeIndex, String variableName, Object newValue) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ if (onProgress != null) {
+ xhr.onProgress.listen(onProgress);
+ }
+ xhr.onLoad.listen((e) {
+ // Note: file:// URIs have status of 0.
+ if ((xhr.status >= 200 && xhr.status < 300) ||
+ xhr.status == 0 || xhr.status == 304) {
+ completer.complete(xhr);
+ } else {
+ completer.completeError(e);
+ }
+ });
-@DomName('KeyboardEvent')
-class KeyboardEvent extends UIEvent native "*KeyboardEvent" {
+ xhr.onError.listen((e) {
+ completer.completeError(e);
+ });
- factory KeyboardEvent(String type,
- {Window view, bool canBubble: true, bool cancelable: true,
- String keyIdentifier: "", int keyLocation: 1, bool ctrlKey: false,
- bool altKey: false, bool shiftKey: false, bool metaKey: false,
- bool altGraphKey: false}) {
- if (view == null) {
- view = window;
+ if (sendData != null) {
+ xhr.send(sendData);
+ } else {
+ xhr.send();
}
- final e = document.$dom_createEvent("KeyboardEvent");
- e.$dom_initKeyboardEvent(type, canBubble, cancelable, view, keyIdentifier,
- keyLocation, ctrlKey, altKey, shiftKey, metaKey, altGraphKey);
- return e;
+
+ return completer.future;
}
- @DomName('KeyboardEvent.initKeyboardEvent')
- void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable,
- Window view, String keyIdentifier, int keyLocation, bool ctrlKey,
- bool altKey, bool shiftKey, bool metaKey, bool altGraphKey) {
- if (JS('bool', 'typeof(#.initKeyEvent) == "function"', this)) {
- // initKeyEvent is only in Firefox (instead of initKeyboardEvent). It has
- // a slightly different signature, and allows you to specify keyCode and
- // charCode as the last two arguments, but we just set them as the default
- // since they can't be specified in other browsers.
- JS('void', '#.initKeyEvent(#, #, #, #, #, #, #, #, 0, 0)', this,
- type, canBubble, cancelable, view,
- ctrlKey, altKey, shiftKey, metaKey);
- } else {
- // initKeyboardEvent is for all other browsers.
- JS('void', '#.initKeyboardEvent(#, #, #, #, #, #, #, #, #, #, #)', this,
- type, canBubble, cancelable, view, keyIdentifier, keyLocation,
- ctrlKey, altKey, shiftKey, metaKey, altGraphKey);
- }
+ /**
+ * Checks to see if the Progress event is supported on the current platform.
+ */
+ static bool get supportsProgressEvent {
+ var xhr = new HttpRequest();
+ return JS('bool', '"onprogress" in #', xhr);
}
- @DomName('KeyboardEvent.keyCode')
- int get keyCode => $dom_keyCode;
+ /**
+ * Checks to see if the LoadEnd event is supported on the current platform.
+ */
+ static bool get supportsLoadEndEvent {
+ var xhr = new HttpRequest();
+ return JS('bool', '"onloadend" in #', xhr);
+ }
- @DomName('KeyboardEvent.charCode')
- int get charCode => $dom_charCode;
- @DomName('KeyboardEvent.altGraphKey')
+ @DomName('XMLHttpRequest.abortEvent')
@DocsEditable
- final bool altGraphKey;
+ static const EventStreamProvider<ProgressEvent> abortEvent = const EventStreamProvider<ProgressEvent>('abort');
- @DomName('KeyboardEvent.altKey')
+ @DomName('XMLHttpRequest.errorEvent')
@DocsEditable
- final bool altKey;
+ static const EventStreamProvider<ProgressEvent> errorEvent = const EventStreamProvider<ProgressEvent>('error');
- @DomName('KeyboardEvent.ctrlKey')
+ @DomName('XMLHttpRequest.loadEvent')
@DocsEditable
- final bool ctrlKey;
+ static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamProvider<ProgressEvent>('load');
- @JSName('keyIdentifier')
- @DomName('KeyboardEvent.keyIdentifier')
+ @DomName('XMLHttpRequest.loadendEvent')
@DocsEditable
- final String $dom_keyIdentifier;
+ static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStreamProvider<ProgressEvent>('loadend');
- @DomName('KeyboardEvent.keyLocation')
+ @DomName('XMLHttpRequest.loadstartEvent')
@DocsEditable
- final int keyLocation;
+ static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventStreamProvider<ProgressEvent>('loadstart');
- @DomName('KeyboardEvent.metaKey')
+ @DomName('XMLHttpRequest.progressEvent')
@DocsEditable
- final bool metaKey;
+ static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
- @DomName('KeyboardEvent.shiftKey')
+ @DomName('XMLHttpRequest.readystatechangeEvent')
@DocsEditable
- final bool shiftKey;
+ static const EventStreamProvider<ProgressEvent> readyStateChangeEvent = const EventStreamProvider<ProgressEvent>('readystatechange');
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ /**
+ * General constructor for any type of request (GET, POST, etc).
+ *
+ * This call is used in conjunction with [open]:
+ *
+ * var request = new HttpRequest();
+ * request.open('GET', 'http://dartlang.org')
+ * request.on.load.add((event) => print('Request complete'));
+ *
+ * is the (more verbose) equivalent of
+ *
+ * var request = new HttpRequest.get('http://dartlang.org',
+ * (event) => print('Request complete'));
+ */
+ @DomName('XMLHttpRequest.XMLHttpRequest')
+ @DocsEditable
+ factory HttpRequest() {
+ return HttpRequest._create_1();
+ }
+ static HttpRequest _create_1() => JS('HttpRequest', 'new XMLHttpRequest()');
+ static const int DONE = 4;
-@DocsEditable
-@DomName('HTMLKeygenElement')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Experimental
-class KeygenElement extends Element native "*HTMLKeygenElement" {
+ static const int HEADERS_RECEIVED = 2;
- @DomName('HTMLKeygenElement.HTMLKeygenElement')
+ static const int LOADING = 3;
+
+ static const int OPENED = 1;
+
+ static const int UNSENT = 0;
+
+ /**
+ * Indicator of the current state of the request:
+ *
+ * <table>
+ * <tr>
+ * <td>Value</td>
+ * <td>State</td>
+ * <td>Meaning</td>
+ * </tr>
+ * <tr>
+ * <td>0</td>
+ * <td>unsent</td>
+ * <td><code>open()</code> has not yet been called</td>
+ * </tr>
+ * <tr>
+ * <td>1</td>
+ * <td>opened</td>
+ * <td><code>send()</code> has not yet been called</td>
+ * </tr>
+ * <tr>
+ * <td>2</td>
+ * <td>headers received</td>
+ * <td><code>sent()</code> has been called; response headers and <code>status</code> are available</td>
+ * </tr>
+ * <tr>
+ * <td>3</td> <td>loading</td> <td><code>responseText</code> holds some data</td>
+ * </tr>
+ * <tr>
+ * <td>4</td> <td>done</td> <td>request is complete</td>
+ * </tr>
+ * </table>
+ */
+ @DomName('XMLHttpRequest.readyState')
@DocsEditable
- factory KeygenElement() => document.$dom_createElement("keygen");
+ final int readyState;
- /// Checks if this type is supported on the current platform.
- static bool get supported => Element.isTagSupported('keygen') && (new Element.tag('keygen') is KeygenElement);
+ /**
+ * The data received as a reponse from the request.
+ *
+ * The data could be in the
+ * form of a [String], [ArrayBuffer], [Document], [Blob], or json (also a
+ * [String]). `null` indicates request failure.
+ */
+ @DomName('XMLHttpRequest.response')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Creates('ByteBuffer|Blob|Document|=Object|=List|String|num')
+ final Object response;
- @DomName('HTMLKeygenElement.autofocus')
+ /**
+ * The response in string form or `null on failure.
+ */
+ @DomName('XMLHttpRequest.responseText')
@DocsEditable
- bool autofocus;
+ final String responseText;
- @DomName('HTMLKeygenElement.challenge')
+ /**
+ * [String] telling the server the desired response format.
+ *
+ * Default is `String`.
+ * Other options are one of 'arraybuffer', 'blob', 'document', 'json',
+ * 'text'. Some newer browsers will throw NS_ERROR_DOM_INVALID_ACCESS_ERR if
+ * `responseType` is set while performing a synchronous request.
+ *
+ * See also: [MDN responseType](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#responseType)
+ */
+ @DomName('XMLHttpRequest.responseType')
@DocsEditable
- String challenge;
+ String responseType;
- @DomName('HTMLKeygenElement.disabled')
+ @JSName('responseXML')
+ /**
+ * The request response, or null on failure.
+ *
+ * The response is processed as
+ * `text/xml` stream, unless responseType = 'document' and the request is
+ * synchronous.
+ */
+ @DomName('XMLHttpRequest.responseXML')
@DocsEditable
- bool disabled;
+ final Document responseXml;
- @DomName('HTMLKeygenElement.form')
+ /**
+ * The http result code from the request (200, 404, etc).
+ * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
+ */
+ @DomName('XMLHttpRequest.status')
@DocsEditable
- final FormElement form;
+ final int status;
- @DomName('HTMLKeygenElement.keytype')
+ /**
+ * The request response string (such as \"200 OK\").
+ * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_status_codes)
+ */
+ @DomName('XMLHttpRequest.statusText')
@DocsEditable
- String keytype;
+ final String statusText;
- @DomName('HTMLKeygenElement.labels')
+ /**
+ * [EventTarget] that can hold listeners to track the progress of the request.
+ * The events fired will be members of [HttpRequestUploadEvents].
+ */
+ @DomName('XMLHttpRequest.upload')
@DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- final List<Node> labels;
+ final HttpRequestUpload upload;
- @DomName('HTMLKeygenElement.name')
+ /**
+ * True if cross-site requests should use credentials such as cookies
+ * or authorization headers; false otherwise.
+ *
+ * This value is ignored for same-site requests.
+ */
+ @DomName('XMLHttpRequest.withCredentials')
@DocsEditable
- String name;
+ bool withCredentials;
- @DomName('HTMLKeygenElement.type')
+ /**
+ * Stop the current request.
+ *
+ * The request can only be stopped if readyState is `HEADERS_RECIEVED` or
+ * `LOADING`. If this method is not in the process of being sent, the method
+ * has no effect.
+ */
+ @DomName('XMLHttpRequest.abort')
@DocsEditable
- final String type;
+ void abort() native;
- @DomName('HTMLKeygenElement.validationMessage')
+ @JSName('addEventListener')
+ @DomName('XMLHttpRequest.addEventListener')
@DocsEditable
- final String validationMessage;
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('HTMLKeygenElement.validity')
+ @DomName('XMLHttpRequest.dispatchEvent')
@DocsEditable
- final ValidityState validity;
+ bool dispatchEvent(Event evt) native;
- @DomName('HTMLKeygenElement.willValidate')
+ /**
+ * Retrieve all the response headers from a request.
+ *
+ * `null` if no headers have been received. For multipart requests,
+ * `getAllResponseHeaders` will return the response headers for the current
+ * part of the request.
+ *
+ * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Responses)
+ * for a list of common response headers.
+ */
+ @DomName('XMLHttpRequest.getAllResponseHeaders')
@DocsEditable
- final bool willValidate;
+ String getAllResponseHeaders() native;
- @DomName('HTMLKeygenElement.checkValidity')
+ /**
+ * Return the response header named `header`, or `null` if not found.
+ *
+ * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_header_fields#Responses)
+ * for a list of common response headers.
+ */
+ @DomName('XMLHttpRequest.getResponseHeader')
+ @DocsEditable
+ String getResponseHeader(String header) native;
+
+ /**
+ * Specify the desired `url`, and `method` to use in making the request.
+ *
+ * By default the request is done asyncronously, with no user or password
+ * authentication information. If `async` is false, the request will be send
+ * synchronously.
+ *
+ * Calling `open` again on a currently active request is equivalent to
+ * calling `abort`.
+ */
+ @DomName('XMLHttpRequest.open')
@DocsEditable
- bool checkValidity() native;
+ void open(String method, String url, {bool async, String user, String password}) native;
- @DomName('HTMLKeygenElement.setCustomValidity')
+ /**
+ * Specify a particular MIME type (such as `text/xml`) desired for the
+ * response.
+ *
+ * This value must be set before the request has been sent. See also the list
+ * of [common MIME types](http://en.wikipedia.org/wiki/Internet_media_type#List_of_common_media_types)
+ */
+ @DomName('XMLHttpRequest.overrideMimeType')
@DocsEditable
- void setCustomValidity(String error) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('HTMLLIElement')
-class LIElement extends Element native "*HTMLLIElement" {
+ void overrideMimeType(String override) native;
- @DomName('HTMLLIElement.HTMLLIElement')
+ @JSName('removeEventListener')
+ @DomName('XMLHttpRequest.removeEventListener')
@DocsEditable
- factory LIElement() => document.$dom_createElement("li");
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('HTMLLIElement.type')
+ /**
+ * Send the request with any given `data`.
+ *
+ * See also:
+ * [send() docs](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send())
+ * from MDN.
+ */
+ @DomName('XMLHttpRequest.send')
@DocsEditable
- String type;
+ void send([data]) native;
- @DomName('HTMLLIElement.value')
+ @DomName('XMLHttpRequest.setRequestHeader')
@DocsEditable
- int value;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('HTMLLabelElement')
-class LabelElement extends Element native "*HTMLLabelElement" {
+ void setRequestHeader(String header, String value) native;
- @DomName('HTMLLabelElement.HTMLLabelElement')
+ /**
+ * Event listeners to be notified when request has been aborted,
+ * generally due to calling `httpRequest.abort()`.
+ */
+ @DomName('XMLHttpRequest.onabort')
@DocsEditable
- factory LabelElement() => document.$dom_createElement("label");
+ Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
- @DomName('HTMLLabelElement.control')
+ /**
+ * Event listeners to be notified when a request has failed, such as when a
+ * cross-domain error occurred or the file wasn't found on the server.
+ */
+ @DomName('XMLHttpRequest.onerror')
@DocsEditable
- final Element control;
+ Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
- @DomName('HTMLLabelElement.form')
+ /**
+ * Event listeners to be notified once the request has completed
+ * *successfully*.
+ */
+ @DomName('XMLHttpRequest.onload')
@DocsEditable
- final FormElement form;
+ Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
- @DomName('HTMLLabelElement.htmlFor')
+ /**
+ * Event listeners to be notified once the request has completed (on
+ * either success or failure).
+ */
+ @DomName('XMLHttpRequest.onloadend')
@DocsEditable
- String htmlFor;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
-@DocsEditable
-@DomName('HTMLLegendElement')
-class LegendElement extends Element native "*HTMLLegendElement" {
+ /**
+ * Event listeners to be notified when the request starts, once
+ * `httpRequest.send()` has been called.
+ */
+ @DomName('XMLHttpRequest.onloadstart')
+ @DocsEditable
+ Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
- @DomName('HTMLLegendElement.HTMLLegendElement')
+ /**
+ * Event listeners to be notified when data for the request
+ * is being sent or loaded.
+ *
+ * Progress events are fired every 50ms or for every byte transmitted,
+ * whichever is less frequent.
+ */
+ @DomName('XMLHttpRequest.onprogress')
@DocsEditable
- factory LegendElement() => document.$dom_createElement("legend");
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @SupportedBrowser(SupportedBrowser.IE, '10')
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
- @DomName('HTMLLegendElement.form')
+ /**
+ * Event listeners to be notified every time the [HttpRequest]
+ * object's `readyState` changes values.
+ */
+ @DomName('XMLHttpRequest.onreadystatechange')
@DocsEditable
- final FormElement form;
+ Stream<ProgressEvent> get onReadyStateChange => readyStateChangeEvent.forTarget(this);
+
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -15348,44 +12654,28 @@ class LegendElement extends Element native "*HTMLLegendElement" {
@DocsEditable
-@DomName('HTMLLinkElement')
-class LinkElement extends Element native "*HTMLLinkElement" {
-
- @DomName('HTMLLinkElement.HTMLLinkElement')
- @DocsEditable
- factory LinkElement() => document.$dom_createElement("link");
-
- @DomName('HTMLLinkElement.disabled')
- @DocsEditable
- bool disabled;
-
- @DomName('HTMLLinkElement.href')
- @DocsEditable
- String href;
+@DomName('XMLHttpRequestException')
+class HttpRequestException native "*XMLHttpRequestException" {
- @DomName('HTMLLinkElement.hreflang')
- @DocsEditable
- String hreflang;
+ static const int ABORT_ERR = 102;
- @DomName('HTMLLinkElement.media')
- @DocsEditable
- String media;
+ static const int NETWORK_ERR = 101;
- @DomName('HTMLLinkElement.rel')
+ @DomName('XMLHttpRequestException.code')
@DocsEditable
- String rel;
+ final int code;
- @DomName('HTMLLinkElement.sheet')
+ @DomName('XMLHttpRequestException.message')
@DocsEditable
- final StyleSheet sheet;
+ final String message;
- @DomName('HTMLLinkElement.sizes')
+ @DomName('XMLHttpRequestException.name')
@DocsEditable
- DomSettableTokenList sizes;
+ final String name;
- @DomName('HTMLLinkElement.type')
+ @DomName('XMLHttpRequestException.toString')
@DocsEditable
- String type;
+ String toString() native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -15393,14 +12683,22 @@ class LinkElement extends Element native "*HTMLLinkElement" {
@DocsEditable
-@DomName('LocalMediaStream')
+@DomName('XMLHttpRequestProgressEvent')
@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
-class LocalMediaStream extends MediaStream implements EventTarget native "*LocalMediaStream" {
+class HttpRequestProgressEvent extends ProgressEvent native "*XMLHttpRequestProgressEvent" {
- @DomName('LocalMediaStream.stop')
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => Device.isEventTypeSupported('XMLHttpRequestProgressEvent');
+
+ @DomName('XMLHttpRequestProgressEvent.position')
@DocsEditable
- void stop() native;
+ final int position;
+
+ @DomName('XMLHttpRequestProgressEvent.totalSize')
+ @DocsEditable
+ final int totalSize;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -15408,87 +12706,70 @@ class LocalMediaStream extends MediaStream implements EventTarget native "*Local
@DocsEditable
-@DomName('Location')
-class Location implements LocationBase native "*Location" {
-
- @DomName('Location.ancestorOrigins')
- @DocsEditable
- @Returns('DomStringList')
- @Creates('DomStringList')
- final List<String> ancestorOrigins;
-
- @DomName('Location.hash')
- @DocsEditable
- String hash;
-
- @DomName('Location.host')
- @DocsEditable
- String host;
+@DomName('XMLHttpRequestUpload')
+class HttpRequestUpload extends EventTarget native "*XMLHttpRequestUpload" {
- @DomName('Location.hostname')
+ @DomName('XMLHttpRequestUpload.abortEvent')
@DocsEditable
- String hostname;
+ static const EventStreamProvider<ProgressEvent> abortEvent = const EventStreamProvider<ProgressEvent>('abort');
- @DomName('Location.href')
+ @DomName('XMLHttpRequestUpload.errorEvent')
@DocsEditable
- String href;
+ static const EventStreamProvider<ProgressEvent> errorEvent = const EventStreamProvider<ProgressEvent>('error');
- @DomName('Location.origin')
+ @DomName('XMLHttpRequestUpload.loadEvent')
@DocsEditable
- final String origin;
+ static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamProvider<ProgressEvent>('load');
- @DomName('Location.pathname')
+ @DomName('XMLHttpRequestUpload.loadendEvent')
@DocsEditable
- String pathname;
+ static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStreamProvider<ProgressEvent>('loadend');
- @DomName('Location.port')
+ @DomName('XMLHttpRequestUpload.loadstartEvent')
@DocsEditable
- String port;
+ static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventStreamProvider<ProgressEvent>('loadstart');
- @DomName('Location.protocol')
+ @DomName('XMLHttpRequestUpload.progressEvent')
@DocsEditable
- String protocol;
+ static const EventStreamProvider<ProgressEvent> progressEvent = const EventStreamProvider<ProgressEvent>('progress');
- @DomName('Location.search')
+ @JSName('addEventListener')
+ @DomName('XMLHttpRequestUpload.addEventListener')
@DocsEditable
- String search;
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('Location.assign')
+ @DomName('XMLHttpRequestUpload.dispatchEvent')
@DocsEditable
- void assign(String url) native;
+ bool dispatchEvent(Event evt) native;
- @DomName('Location.reload')
+ @JSName('removeEventListener')
+ @DomName('XMLHttpRequestUpload.removeEventListener')
@DocsEditable
- void reload() native;
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('Location.replace')
+ @DomName('XMLHttpRequestUpload.onabort')
@DocsEditable
- void replace(String url) native;
+ Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
- @DomName('Location.toString')
+ @DomName('XMLHttpRequestUpload.onerror')
@DocsEditable
- String toString() native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
+ Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
-@DocsEditable
-@DomName('HTMLMapElement')
-class MapElement extends Element native "*HTMLMapElement" {
+ @DomName('XMLHttpRequestUpload.onload')
+ @DocsEditable
+ Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
- @DomName('HTMLMapElement.HTMLMapElement')
+ @DomName('XMLHttpRequestUpload.onloadend')
@DocsEditable
- factory MapElement() => document.$dom_createElement("map");
+ Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
- @DomName('HTMLMapElement.areas')
+ @DomName('XMLHttpRequestUpload.onloadstart')
@DocsEditable
- final HtmlCollection areas;
+ Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
- @DomName('HTMLMapElement.name')
+ @DomName('XMLHttpRequestUpload.onprogress')
@DocsEditable
- String name;
+ Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -15496,85 +12777,66 @@ class MapElement extends Element native "*HTMLMapElement" {
@DocsEditable
-@DomName('MediaController')
-class MediaController extends EventTarget native "*MediaController" {
-
- @DomName('MediaController.MediaController')
- @DocsEditable
- factory MediaController() {
- return MediaController._create_1();
- }
- static MediaController _create_1() => JS('MediaController', 'new MediaController()');
-
- @DomName('MediaController.buffered')
- @DocsEditable
- final TimeRanges buffered;
-
- @DomName('MediaController.currentTime')
- @DocsEditable
- num currentTime;
+@DomName('HTMLIFrameElement')
+class IFrameElement extends Element native "*HTMLIFrameElement" {
- @DomName('MediaController.defaultPlaybackRate')
+ @DomName('HTMLIFrameElement.HTMLIFrameElement')
@DocsEditable
- num defaultPlaybackRate;
+ factory IFrameElement() => document.$dom_createElement("iframe");
- @DomName('MediaController.duration')
+ WindowBase get contentWindow => _convertNativeToDart_Window(this._get_contentWindow);
+ @JSName('contentWindow')
+ @DomName('HTMLIFrameElement.contentWindow')
@DocsEditable
- final num duration;
+ @Creates('Window|=Object')
+ @Returns('Window|=Object')
+ final dynamic _get_contentWindow;
- @DomName('MediaController.muted')
+ @DomName('HTMLIFrameElement.height')
@DocsEditable
- bool muted;
+ String height;
- @DomName('MediaController.paused')
+ @DomName('HTMLIFrameElement.name')
@DocsEditable
- final bool paused;
+ String name;
- @DomName('MediaController.playbackRate')
+ @DomName('HTMLIFrameElement.sandbox')
@DocsEditable
- num playbackRate;
+ String sandbox;
- @DomName('MediaController.playbackState')
+ @DomName('HTMLIFrameElement.src')
@DocsEditable
- final String playbackState;
+ String src;
- @DomName('MediaController.played')
+ @DomName('HTMLIFrameElement.srcdoc')
@DocsEditable
- final TimeRanges played;
+ String srcdoc;
- @DomName('MediaController.seekable')
+ @DomName('HTMLIFrameElement.width')
@DocsEditable
- final TimeRanges seekable;
+ String width;
+}
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('MediaController.volume')
- @DocsEditable
- num volume;
+@DomName('ImageData')
- @JSName('addEventListener')
- @DomName('MediaController.addEventListener')
- @DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+class ImageData native "*ImageData" {
- @DomName('MediaController.dispatchEvent')
- @DocsEditable
- bool dispatchEvent(Event evt) native;
- @DomName('MediaController.pause')
+ @DomName('ImageData.data')
@DocsEditable
- void pause() native;
+ final List<int> data;
- @DomName('MediaController.play')
+ @DomName('ImageData.height')
@DocsEditable
- void play() native;
+ final int height;
- @JSName('removeEventListener')
- @DomName('MediaController.removeEventListener')
+ @DomName('ImageData.width')
@DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ final int width;
- @DomName('MediaController.unpause')
- @DocsEditable
- void unpause() native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -15582,905 +12844,1083 @@ class MediaController extends EventTarget native "*MediaController" {
@DocsEditable
-@DomName('HTMLMediaElement')
-class MediaElement extends Element native "*HTMLMediaElement" {
+@DomName('HTMLImageElement')
+class ImageElement extends Element native "*HTMLImageElement" {
- @DomName('HTMLMediaElement.canplayEvent')
+ @DomName('HTMLImageElement.HTMLImageElement')
@DocsEditable
- static const EventStreamProvider<Event> canPlayEvent = const EventStreamProvider<Event>('canplay');
+ factory ImageElement({String src, int width, int height}) {
+ var e = document.$dom_createElement("img");
+ if (src != null) e.src = src;
+ if (width != null) e.width = width;
+ if (height != null) e.height = height;
+ return e;
+ }
- @DomName('HTMLMediaElement.canplaythroughEvent')
+ @DomName('HTMLImageElement.alt')
@DocsEditable
- static const EventStreamProvider<Event> canPlayThroughEvent = const EventStreamProvider<Event>('canplaythrough');
+ String alt;
- @DomName('HTMLMediaElement.durationchangeEvent')
+ @DomName('HTMLImageElement.border')
@DocsEditable
- static const EventStreamProvider<Event> durationChangeEvent = const EventStreamProvider<Event>('durationchange');
+ String border;
- @DomName('HTMLMediaElement.emptiedEvent')
+ @DomName('HTMLImageElement.complete')
@DocsEditable
- static const EventStreamProvider<Event> emptiedEvent = const EventStreamProvider<Event>('emptied');
+ final bool complete;
- @DomName('HTMLMediaElement.endedEvent')
+ @DomName('HTMLImageElement.crossOrigin')
@DocsEditable
- static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
+ String crossOrigin;
- @DomName('HTMLMediaElement.loadeddataEvent')
+ @DomName('HTMLImageElement.height')
@DocsEditable
- static const EventStreamProvider<Event> loadedDataEvent = const EventStreamProvider<Event>('loadeddata');
+ int height;
- @DomName('HTMLMediaElement.loadedmetadataEvent')
+ @DomName('HTMLImageElement.isMap')
@DocsEditable
- static const EventStreamProvider<Event> loadedMetadataEvent = const EventStreamProvider<Event>('loadedmetadata');
+ bool isMap;
- @DomName('HTMLMediaElement.loadstartEvent')
+ @DomName('HTMLImageElement.lowsrc')
@DocsEditable
- static const EventStreamProvider<Event> loadStartEvent = const EventStreamProvider<Event>('loadstart');
+ String lowsrc;
- @DomName('HTMLMediaElement.pauseEvent')
+ @DomName('HTMLImageElement.naturalHeight')
@DocsEditable
- static const EventStreamProvider<Event> pauseEvent = const EventStreamProvider<Event>('pause');
+ final int naturalHeight;
- @DomName('HTMLMediaElement.playEvent')
+ @DomName('HTMLImageElement.naturalWidth')
@DocsEditable
- static const EventStreamProvider<Event> playEvent = const EventStreamProvider<Event>('play');
+ final int naturalWidth;
- @DomName('HTMLMediaElement.playingEvent')
+ @DomName('HTMLImageElement.src')
@DocsEditable
- static const EventStreamProvider<Event> playingEvent = const EventStreamProvider<Event>('playing');
+ String src;
- @DomName('HTMLMediaElement.progressEvent')
+ @DomName('HTMLImageElement.useMap')
@DocsEditable
- static const EventStreamProvider<Event> progressEvent = const EventStreamProvider<Event>('progress');
+ String useMap;
- @DomName('HTMLMediaElement.ratechangeEvent')
+ @DomName('HTMLImageElement.width')
@DocsEditable
- static const EventStreamProvider<Event> rateChangeEvent = const EventStreamProvider<Event>('ratechange');
+ int width;
- @DomName('HTMLMediaElement.seekedEvent')
+ @DomName('HTMLImageElement.x')
@DocsEditable
- static const EventStreamProvider<Event> seekedEvent = const EventStreamProvider<Event>('seeked');
+ final int x;
- @DomName('HTMLMediaElement.seekingEvent')
+ @DomName('HTMLImageElement.y')
@DocsEditable
- static const EventStreamProvider<Event> seekingEvent = const EventStreamProvider<Event>('seeking');
+ final int y;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('HTMLMediaElement.showEvent')
- @DocsEditable
- static const EventStreamProvider<Event> showEvent = const EventStreamProvider<Event>('show');
- @DomName('HTMLMediaElement.stalledEvent')
- @DocsEditable
- static const EventStreamProvider<Event> stalledEvent = const EventStreamProvider<Event>('stalled');
+@DomName('HTMLInputElement')
+class InputElement extends Element implements
+ HiddenInputElement,
+ SearchInputElement,
+ TextInputElement,
+ UrlInputElement,
+ TelephoneInputElement,
+ EmailInputElement,
+ PasswordInputElement,
+ DateInputElement,
+ MonthInputElement,
+ WeekInputElement,
+ TimeInputElement,
+ LocalDateTimeInputElement,
+ NumberInputElement,
+ RangeInputElement,
+ CheckboxInputElement,
+ RadioButtonInputElement,
+ FileUploadInputElement,
+ SubmitButtonInputElement,
+ ImageButtonInputElement,
+ ResetButtonInputElement,
+ ButtonInputElement
+ native "*HTMLInputElement" {
- @DomName('HTMLMediaElement.suspendEvent')
+ factory InputElement({String type}) {
+ var e = document.$dom_createElement("input");
+ if (type != null) {
+ try {
+ // IE throws an exception for unknown types.
+ e.type = type;
+ } catch(_) {}
+ }
+ return e;
+ }
+
+ @DomName('HTMLInputElement.webkitSpeechChangeEvent')
@DocsEditable
- static const EventStreamProvider<Event> suspendEvent = const EventStreamProvider<Event>('suspend');
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ static const EventStreamProvider<Event> speechChangeEvent = const EventStreamProvider<Event>('webkitSpeechChange');
- @DomName('HTMLMediaElement.timeupdateEvent')
+ @DomName('HTMLInputElement.accept')
@DocsEditable
- static const EventStreamProvider<Event> timeUpdateEvent = const EventStreamProvider<Event>('timeupdate');
+ String accept;
- @DomName('HTMLMediaElement.volumechangeEvent')
+ @DomName('HTMLInputElement.alt')
@DocsEditable
- static const EventStreamProvider<Event> volumeChangeEvent = const EventStreamProvider<Event>('volumechange');
+ String alt;
- @DomName('HTMLMediaElement.waitingEvent')
+ @DomName('HTMLInputElement.autocomplete')
@DocsEditable
- static const EventStreamProvider<Event> waitingEvent = const EventStreamProvider<Event>('waiting');
+ String autocomplete;
- @DomName('HTMLMediaElement.webkitkeyaddedEvent')
+ @DomName('HTMLInputElement.autofocus')
@DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- static const EventStreamProvider<MediaKeyEvent> keyAddedEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeyadded');
+ bool autofocus;
- @DomName('HTMLMediaElement.webkitkeyerrorEvent')
+ @DomName('HTMLInputElement.checked')
@DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- static const EventStreamProvider<MediaKeyEvent> keyErrorEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeyerror');
+ bool checked;
- @DomName('HTMLMediaElement.webkitkeymessageEvent')
+ @DomName('HTMLInputElement.defaultChecked')
@DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- static const EventStreamProvider<MediaKeyEvent> keyMessageEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeymessage');
+ bool defaultChecked;
- @DomName('HTMLMediaElement.webkitneedkeyEvent')
+ @DomName('HTMLInputElement.defaultValue')
@DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- static const EventStreamProvider<MediaKeyEvent> needKeyEvent = const EventStreamProvider<MediaKeyEvent>('webkitneedkey');
+ String defaultValue;
- static const int HAVE_CURRENT_DATA = 2;
+ @DomName('HTMLInputElement.dirName')
+ @DocsEditable
+ String dirName;
- static const int HAVE_ENOUGH_DATA = 4;
+ @DomName('HTMLInputElement.disabled')
+ @DocsEditable
+ bool disabled;
- static const int HAVE_FUTURE_DATA = 3;
+ @DomName('HTMLInputElement.files')
+ @DocsEditable
+ @Returns('FileList')
+ @Creates('FileList')
+ List<File> files;
- static const int HAVE_METADATA = 1;
+ @DomName('HTMLInputElement.form')
+ @DocsEditable
+ final FormElement form;
- static const int HAVE_NOTHING = 0;
+ @DomName('HTMLInputElement.formAction')
+ @DocsEditable
+ String formAction;
- static const int NETWORK_EMPTY = 0;
+ @DomName('HTMLInputElement.formEnctype')
+ @DocsEditable
+ String formEnctype;
- static const int NETWORK_IDLE = 1;
+ @DomName('HTMLInputElement.formMethod')
+ @DocsEditable
+ String formMethod;
- static const int NETWORK_LOADING = 2;
+ @DomName('HTMLInputElement.formNoValidate')
+ @DocsEditable
+ bool formNoValidate;
- static const int NETWORK_NO_SOURCE = 3;
+ @DomName('HTMLInputElement.formTarget')
+ @DocsEditable
+ String formTarget;
- @DomName('HTMLMediaElement.autoplay')
+ @DomName('HTMLInputElement.height')
@DocsEditable
- bool autoplay;
+ int height;
- @DomName('HTMLMediaElement.buffered')
+ @DomName('HTMLInputElement.incremental')
@DocsEditable
- final TimeRanges buffered;
+ bool incremental;
- @DomName('HTMLMediaElement.controller')
+ @DomName('HTMLInputElement.indeterminate')
@DocsEditable
- MediaController controller;
+ bool indeterminate;
- @DomName('HTMLMediaElement.controls')
+ @DomName('HTMLInputElement.labels')
@DocsEditable
- bool controls;
+ @Returns('NodeList')
+ @Creates('NodeList')
+ final List<Node> labels;
- @DomName('HTMLMediaElement.currentSrc')
+ @DomName('HTMLInputElement.list')
@DocsEditable
- final String currentSrc;
+ final Element list;
- @DomName('HTMLMediaElement.currentTime')
+ @DomName('HTMLInputElement.max')
@DocsEditable
- num currentTime;
+ String max;
- @DomName('HTMLMediaElement.defaultMuted')
+ @DomName('HTMLInputElement.maxLength')
@DocsEditable
- bool defaultMuted;
+ int maxLength;
- @DomName('HTMLMediaElement.defaultPlaybackRate')
+ @DomName('HTMLInputElement.min')
@DocsEditable
- num defaultPlaybackRate;
+ String min;
- @DomName('HTMLMediaElement.duration')
+ @DomName('HTMLInputElement.multiple')
@DocsEditable
- final num duration;
+ bool multiple;
- @DomName('HTMLMediaElement.ended')
+ @DomName('HTMLInputElement.name')
@DocsEditable
- final bool ended;
+ String name;
- @DomName('HTMLMediaElement.error')
+ @DomName('HTMLInputElement.pattern')
@DocsEditable
- final MediaError error;
+ String pattern;
- @DomName('HTMLMediaElement.initialTime')
+ @DomName('HTMLInputElement.placeholder')
@DocsEditable
- final num initialTime;
+ String placeholder;
- @DomName('HTMLMediaElement.loop')
+ @DomName('HTMLInputElement.readOnly')
@DocsEditable
- bool loop;
+ bool readOnly;
- @DomName('HTMLMediaElement.mediaGroup')
+ @DomName('HTMLInputElement.required')
@DocsEditable
- String mediaGroup;
+ bool required;
- @DomName('HTMLMediaElement.muted')
+ @DomName('HTMLInputElement.selectionDirection')
@DocsEditable
- bool muted;
+ String selectionDirection;
- @DomName('HTMLMediaElement.networkState')
+ @DomName('HTMLInputElement.selectionEnd')
@DocsEditable
- final int networkState;
+ int selectionEnd;
- @DomName('HTMLMediaElement.paused')
+ @DomName('HTMLInputElement.selectionStart')
@DocsEditable
- final bool paused;
+ int selectionStart;
- @DomName('HTMLMediaElement.playbackRate')
+ @DomName('HTMLInputElement.size')
@DocsEditable
- num playbackRate;
+ int size;
- @DomName('HTMLMediaElement.played')
+ @DomName('HTMLInputElement.src')
@DocsEditable
- final TimeRanges played;
+ String src;
- @DomName('HTMLMediaElement.preload')
+ @DomName('HTMLInputElement.step')
@DocsEditable
- String preload;
+ String step;
- @DomName('HTMLMediaElement.readyState')
+ @DomName('HTMLInputElement.type')
@DocsEditable
- final int readyState;
+ String type;
- @DomName('HTMLMediaElement.seekable')
+ @DomName('HTMLInputElement.useMap')
@DocsEditable
- final TimeRanges seekable;
+ String useMap;
- @DomName('HTMLMediaElement.seeking')
+ @DomName('HTMLInputElement.validationMessage')
@DocsEditable
- final bool seeking;
+ final String validationMessage;
- @DomName('HTMLMediaElement.src')
+ @DomName('HTMLInputElement.validity')
@DocsEditable
- String src;
+ final ValidityState validity;
- @DomName('HTMLMediaElement.startTime')
+ @DomName('HTMLInputElement.value')
@DocsEditable
- final num startTime;
+ String value;
- @DomName('HTMLMediaElement.textTracks')
+ DateTime get valueAsDate => _convertNativeToDart_DateTime(this._get_valueAsDate);
+ @JSName('valueAsDate')
+ @DomName('HTMLInputElement.valueAsDate')
@DocsEditable
- final TextTrackList textTracks;
+ final dynamic _get_valueAsDate;
- @DomName('HTMLMediaElement.volume')
+ void set valueAsDate(DateTime value) {
+ this._set_valueAsDate = _convertDartToNative_DateTime(value);
+ }
+ void set _set_valueAsDate(/*dynamic*/ value) {
+ JS("void", "#.valueAsDate = #", this, value);
+ }
+
+ @DomName('HTMLInputElement.valueAsNumber')
@DocsEditable
- num volume;
+ num valueAsNumber;
- @JSName('webkitAudioDecodedByteCount')
- @DomName('HTMLMediaElement.webkitAudioDecodedByteCount')
+ @JSName('webkitEntries')
+ @DomName('HTMLInputElement.webkitEntries')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
- final int audioDecodedByteCount;
+ @Returns('_EntryArray')
+ @Creates('_EntryArray')
+ final List<Entry> entries;
- @JSName('webkitClosedCaptionsVisible')
- @DomName('HTMLMediaElement.webkitClosedCaptionsVisible')
+ @JSName('webkitGrammar')
+ @DomName('HTMLInputElement.webkitGrammar')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
- bool closedCaptionsVisible;
+ bool grammar;
- @JSName('webkitHasClosedCaptions')
- @DomName('HTMLMediaElement.webkitHasClosedCaptions')
+ @JSName('webkitSpeech')
+ @DomName('HTMLInputElement.webkitSpeech')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
- final bool hasClosedCaptions;
+ bool speech;
- @JSName('webkitPreservesPitch')
- @DomName('HTMLMediaElement.webkitPreservesPitch')
+ @JSName('webkitdirectory')
+ @DomName('HTMLInputElement.webkitdirectory')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
- bool preservesPitch;
+ bool directory;
+
+ @DomName('HTMLInputElement.width')
+ @DocsEditable
+ int width;
+
+ @DomName('HTMLInputElement.willValidate')
+ @DocsEditable
+ final bool willValidate;
+
+ @DomName('HTMLInputElement.checkValidity')
+ @DocsEditable
+ bool checkValidity() native;
+
+ @DomName('HTMLInputElement.select')
+ @DocsEditable
+ void select() native;
+
+ @DomName('HTMLInputElement.setCustomValidity')
+ @DocsEditable
+ void setCustomValidity(String error) native;
+
+ @DomName('HTMLInputElement.setRangeText')
+ @DocsEditable
+ void setRangeText(String replacement, {int start, int end, String selectionMode}) native;
+
+ @DomName('HTMLInputElement.setSelectionRange')
+ @DocsEditable
+ void setSelectionRange(int start, int end, [String direction]) native;
+
+ @DomName('HTMLInputElement.stepDown')
+ @DocsEditable
+ void stepDown([int n]) native;
+
+ @DomName('HTMLInputElement.stepUp')
+ @DocsEditable
+ void stepUp([int n]) native;
+
+ @DomName('HTMLInputElement.onwebkitSpeechChange')
+ @DocsEditable
+ Stream<Event> get onSpeechChange => speechChangeEvent.forTarget(this);
+
+}
+
+
+// Interfaces representing the InputElement APIs which are supported
+// for the various types of InputElement.
+// From http://dev.w3.org/html5/spec/the-input-element.html#the-input-element.
+
+/**
+ * Exposes the functionality common between all InputElement types.
+ */
+abstract class InputElementBase implements Element {
+ @DomName('HTMLInputElement.autofocus')
+ bool autofocus;
+
+ @DomName('HTMLInputElement.disabled')
+ bool disabled;
+
+ @DomName('HTMLInputElement.incremental')
+ bool incremental;
+
+ @DomName('HTMLInputElement.indeterminate')
+ bool indeterminate;
+
+ @DomName('HTMLInputElement.labels')
+ List<Node> get labels;
- @JSName('webkitVideoDecodedByteCount')
- @DomName('HTMLMediaElement.webkitVideoDecodedByteCount')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- final int videoDecodedByteCount;
+ @DomName('HTMLInputElement.name')
+ String name;
- @DomName('HTMLMediaElement.addTextTrack')
- @DocsEditable
- TextTrack addTextTrack(String kind, [String label, String language]) native;
+ @DomName('HTMLInputElement.validationMessage')
+ String get validationMessage;
- @DomName('HTMLMediaElement.canPlayType')
- @DocsEditable
- String canPlayType(String type, String keySystem) native;
+ @DomName('HTMLInputElement.validity')
+ ValidityState get validity;
- @DomName('HTMLMediaElement.load')
- @DocsEditable
- void load() native;
+ @DomName('HTMLInputElement.value')
+ String value;
- @DomName('HTMLMediaElement.pause')
- @DocsEditable
- void pause() native;
+ @DomName('HTMLInputElement.willValidate')
+ bool get willValidate;
- @DomName('HTMLMediaElement.play')
- @DocsEditable
- void play() native;
+ @DomName('HTMLInputElement.checkValidity')
+ bool checkValidity();
- @JSName('webkitAddKey')
- @DomName('HTMLMediaElement.webkitAddKey')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- void addKey(String keySystem, Uint8Array key, [Uint8Array initData, String sessionId]) native;
+ @DomName('HTMLInputElement.setCustomValidity')
+ void setCustomValidity(String error);
+}
- @JSName('webkitCancelKeyRequest')
- @DomName('HTMLMediaElement.webkitCancelKeyRequest')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- void cancelKeyRequest(String keySystem, String sessionId) native;
+/**
+ * Hidden input which is not intended to be seen or edited by the user.
+ */
+abstract class HiddenInputElement implements Element {
+ factory HiddenInputElement() => new InputElement(type: 'hidden');
+}
- @JSName('webkitGenerateKeyRequest')
- @DomName('HTMLMediaElement.webkitGenerateKeyRequest')
- @DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- void generateKeyRequest(String keySystem, [Uint8Array initData]) native;
- @DomName('HTMLMediaElement.oncanplay')
- @DocsEditable
- Stream<Event> get onCanPlay => canPlayEvent.forTarget(this);
+/**
+ * Base interface for all inputs which involve text editing.
+ */
+abstract class TextInputElementBase implements InputElementBase {
+ @DomName('HTMLInputElement.autocomplete')
+ String autocomplete;
- @DomName('HTMLMediaElement.oncanplaythrough')
- @DocsEditable
- Stream<Event> get onCanPlayThrough => canPlayThroughEvent.forTarget(this);
+ @DomName('HTMLInputElement.maxLength')
+ int maxLength;
- @DomName('HTMLMediaElement.ondurationchange')
- @DocsEditable
- Stream<Event> get onDurationChange => durationChangeEvent.forTarget(this);
+ @DomName('HTMLInputElement.pattern')
+ String pattern;
- @DomName('HTMLMediaElement.onemptied')
- @DocsEditable
- Stream<Event> get onEmptied => emptiedEvent.forTarget(this);
+ @DomName('HTMLInputElement.placeholder')
+ String placeholder;
- @DomName('HTMLMediaElement.onended')
- @DocsEditable
- Stream<Event> get onEnded => endedEvent.forTarget(this);
+ @DomName('HTMLInputElement.readOnly')
+ bool readOnly;
- @DomName('HTMLMediaElement.onloadeddata')
- @DocsEditable
- Stream<Event> get onLoadedData => loadedDataEvent.forTarget(this);
+ @DomName('HTMLInputElement.required')
+ bool required;
- @DomName('HTMLMediaElement.onloadedmetadata')
- @DocsEditable
- Stream<Event> get onLoadedMetadata => loadedMetadataEvent.forTarget(this);
+ @DomName('HTMLInputElement.size')
+ int size;
- @DomName('HTMLMediaElement.onloadstart')
- @DocsEditable
- Stream<Event> get onLoadStart => loadStartEvent.forTarget(this);
+ @DomName('HTMLInputElement.select')
+ void select();
- @DomName('HTMLMediaElement.onpause')
- @DocsEditable
- Stream<Event> get onPause => pauseEvent.forTarget(this);
+ @DomName('HTMLInputElement.selectionDirection')
+ String selectionDirection;
- @DomName('HTMLMediaElement.onplay')
- @DocsEditable
- Stream<Event> get onPlay => playEvent.forTarget(this);
+ @DomName('HTMLInputElement.selectionEnd')
+ int selectionEnd;
- @DomName('HTMLMediaElement.onplaying')
- @DocsEditable
- Stream<Event> get onPlaying => playingEvent.forTarget(this);
+ @DomName('HTMLInputElement.selectionStart')
+ int selectionStart;
- @DomName('HTMLMediaElement.onprogress')
- @DocsEditable
- Stream<Event> get onProgress => progressEvent.forTarget(this);
+ @DomName('HTMLInputElement.setSelectionRange')
+ void setSelectionRange(int start, int end, [String direction]);
+}
- @DomName('HTMLMediaElement.onratechange')
- @DocsEditable
- Stream<Event> get onRateChange => rateChangeEvent.forTarget(this);
+/**
+ * Similar to [TextInputElement], but on platforms where search is styled
+ * differently this will get the search style.
+ *
+ * Use [supported] to check if this is supported on the current platform.
+ */
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.IE, '10')
+@SupportedBrowser(SupportedBrowser.SAFARI)
+abstract class SearchInputElement implements TextInputElementBase {
+ factory SearchInputElement() => new InputElement(type: 'search');
- @DomName('HTMLMediaElement.onseeked')
- @DocsEditable
- Stream<Event> get onSeeked => seekedEvent.forTarget(this);
+ @DomName('HTMLInputElement.dirName')
+ String dirName;
- @DomName('HTMLMediaElement.onseeking')
- @DocsEditable
- Stream<Event> get onSeeking => seekingEvent.forTarget(this);
+ @DomName('HTMLInputElement.list')
+ Element get list;
- @DomName('HTMLMediaElement.onshow')
- @DocsEditable
- Stream<Event> get onShow => showEvent.forTarget(this);
+ /// Returns true if this input type is supported on the current platform.
+ static bool get supported {
+ return (new InputElement(type: 'search')).type == 'search';
+ }
+}
- @DomName('HTMLMediaElement.onstalled')
- @DocsEditable
- Stream<Event> get onStalled => stalledEvent.forTarget(this);
+/**
+ * A basic text input editor control.
+ */
+abstract class TextInputElement implements TextInputElementBase {
+ factory TextInputElement() => new InputElement(type: 'text');
- @DomName('HTMLMediaElement.onsuspend')
- @DocsEditable
- Stream<Event> get onSuspend => suspendEvent.forTarget(this);
+ @DomName('HTMLInputElement.dirName')
+ String dirName;
- @DomName('HTMLMediaElement.ontimeupdate')
- @DocsEditable
- Stream<Event> get onTimeUpdate => timeUpdateEvent.forTarget(this);
+ @DomName('HTMLInputElement.list')
+ Element get list;
+}
- @DomName('HTMLMediaElement.onvolumechange')
- @DocsEditable
- Stream<Event> get onVolumeChange => volumeChangeEvent.forTarget(this);
+/**
+ * A control for editing an absolute URL.
+ *
+ * Use [supported] to check if this is supported on the current platform.
+ */
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.IE, '10')
+@SupportedBrowser(SupportedBrowser.SAFARI)
+abstract class UrlInputElement implements TextInputElementBase {
+ factory UrlInputElement() => new InputElement(type: 'url');
- @DomName('HTMLMediaElement.onwaiting')
- @DocsEditable
- Stream<Event> get onWaiting => waitingEvent.forTarget(this);
+ @DomName('HTMLInputElement.list')
+ Element get list;
- @DomName('HTMLMediaElement.onwebkitkeyadded')
- @DocsEditable
- Stream<MediaKeyEvent> get onKeyAdded => keyAddedEvent.forTarget(this);
+ /// Returns true if this input type is supported on the current platform.
+ static bool get supported {
+ return (new InputElement(type: 'url')).type == 'url';
+ }
+}
- @DomName('HTMLMediaElement.onwebkitkeyerror')
- @DocsEditable
- Stream<MediaKeyEvent> get onKeyError => keyErrorEvent.forTarget(this);
+/**
+ * Represents a control for editing a telephone number.
+ *
+ * This provides a single line of text with minimal formatting help since
+ * there is a wide variety of telephone numbers.
+ *
+ * Use [supported] to check if this is supported on the current platform.
+ */
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.IE, '10')
+@SupportedBrowser(SupportedBrowser.SAFARI)
+abstract class TelephoneInputElement implements TextInputElementBase {
+ factory TelephoneInputElement() => new InputElement(type: 'tel');
- @DomName('HTMLMediaElement.onwebkitkeymessage')
- @DocsEditable
- Stream<MediaKeyEvent> get onKeyMessage => keyMessageEvent.forTarget(this);
+ @DomName('HTMLInputElement.list')
+ Element get list;
- @DomName('HTMLMediaElement.onwebkitneedkey')
- @DocsEditable
- Stream<MediaKeyEvent> get onNeedKey => needKeyEvent.forTarget(this);
+ /// Returns true if this input type is supported on the current platform.
+ static bool get supported {
+ return (new InputElement(type: 'tel')).type == 'tel';
+ }
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+/**
+ * An e-mail address or list of e-mail addresses.
+ *
+ * Use [supported] to check if this is supported on the current platform.
+ */
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.IE, '10')
+@SupportedBrowser(SupportedBrowser.SAFARI)
+abstract class EmailInputElement implements TextInputElementBase {
+ factory EmailInputElement() => new InputElement(type: 'email');
+
+ @DomName('HTMLInputElement.autocomplete')
+ String autocomplete;
+
+ @DomName('HTMLInputElement.autofocus')
+ bool autofocus;
+
+ @DomName('HTMLInputElement.list')
+ Element get list;
-@DocsEditable
-@DomName('MediaError')
-class MediaError native "*MediaError" {
+ @DomName('HTMLInputElement.maxLength')
+ int maxLength;
- static const int MEDIA_ERR_ABORTED = 1;
+ @DomName('HTMLInputElement.multiple')
+ bool multiple;
- static const int MEDIA_ERR_DECODE = 3;
+ @DomName('HTMLInputElement.pattern')
+ String pattern;
- static const int MEDIA_ERR_ENCRYPTED = 5;
+ @DomName('HTMLInputElement.placeholder')
+ String placeholder;
- static const int MEDIA_ERR_NETWORK = 2;
+ @DomName('HTMLInputElement.readOnly')
+ bool readOnly;
- static const int MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
+ @DomName('HTMLInputElement.required')
+ bool required;
- @DomName('MediaError.code')
- @DocsEditable
- final int code;
+ @DomName('HTMLInputElement.size')
+ int size;
+
+ /// Returns true if this input type is supported on the current platform.
+ static bool get supported {
+ return (new InputElement(type: 'email')).type == 'email';
+ }
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+/**
+ * Text with no line breaks (sensitive information).
+ */
+abstract class PasswordInputElement implements TextInputElementBase {
+ factory PasswordInputElement() => new InputElement(type: 'password');
+}
-@DocsEditable
-@DomName('MediaKeyError')
-class MediaKeyError native "*MediaKeyError" {
+/**
+ * Base interface for all input element types which involve ranges.
+ */
+abstract class RangeInputElementBase implements InputElementBase {
- static const int MEDIA_KEYERR_CLIENT = 2;
+ @DomName('HTMLInputElement.list')
+ Element get list;
- static const int MEDIA_KEYERR_DOMAIN = 6;
+ @DomName('HTMLInputElement.max')
+ String max;
- static const int MEDIA_KEYERR_HARDWARECHANGE = 5;
+ @DomName('HTMLInputElement.min')
+ String min;
- static const int MEDIA_KEYERR_OUTPUT = 4;
+ @DomName('HTMLInputElement.step')
+ String step;
- static const int MEDIA_KEYERR_SERVICE = 3;
+ @DomName('HTMLInputElement.valueAsNumber')
+ num valueAsNumber;
- static const int MEDIA_KEYERR_UNKNOWN = 1;
+ @DomName('HTMLInputElement.stepDown')
+ void stepDown([int n]);
- @DomName('MediaKeyError.code')
- @DocsEditable
- final int code;
+ @DomName('HTMLInputElement.stepUp')
+ void stepUp([int n]);
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+/**
+ * A date (year, month, day) with no time zone.
+ *
+ * Use [supported] to check if this is supported on the current platform.
+ */
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental
+abstract class DateInputElement implements RangeInputElementBase {
+ factory DateInputElement() => new InputElement(type: 'date');
-@DocsEditable
-@DomName('MediaKeyEvent')
-class MediaKeyEvent extends Event native "*MediaKeyEvent" {
-
- @JSName('defaultURL')
- @DomName('MediaKeyEvent.defaultURL')
- @DocsEditable
- final String defaultUrl;
+ @DomName('HTMLInputElement.valueAsDate')
+ DateTime valueAsDate;
- @DomName('MediaKeyEvent.errorCode')
- @DocsEditable
- final MediaKeyError errorCode;
+ @DomName('HTMLInputElement.readOnly')
+ bool readOnly;
- @DomName('MediaKeyEvent.initData')
- @DocsEditable
- @Returns('Uint8Array')
- @Creates('Uint8Array')
- final List<int> initData;
+ @DomName('HTMLInputElement.required')
+ bool required;
- @DomName('MediaKeyEvent.keySystem')
- @DocsEditable
- final String keySystem;
+ /// Returns true if this input type is supported on the current platform.
+ static bool get supported {
+ return (new InputElement(type: 'date')).type == 'date';
+ }
+}
- @DomName('MediaKeyEvent.message')
- @DocsEditable
- @Returns('Uint8Array')
- @Creates('Uint8Array')
- final List<int> message;
+/**
+ * A date consisting of a year and a month with no time zone.
+ *
+ * Use [supported] to check if this is supported on the current platform.
+ */
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental
+abstract class MonthInputElement implements RangeInputElementBase {
+ factory MonthInputElement() => new InputElement(type: 'month');
- @DomName('MediaKeyEvent.sessionId')
- @DocsEditable
- final String sessionId;
+ @DomName('HTMLInputElement.valueAsDate')
+ DateTime valueAsDate;
- @DomName('MediaKeyEvent.systemCode')
- @DocsEditable
- final int systemCode;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @DomName('HTMLInputElement.readOnly')
+ bool readOnly;
+ @DomName('HTMLInputElement.required')
+ bool required;
-@DocsEditable
-@DomName('MediaList')
-class MediaList native "*MediaList" {
+ /// Returns true if this input type is supported on the current platform.
+ static bool get supported {
+ return (new InputElement(type: 'month')).type == 'month';
+ }
+}
- @DomName('MediaList.length')
- @DocsEditable
- final int length;
+/**
+ * A date consisting of a week-year number and a week number with no time zone.
+ *
+ * Use [supported] to check if this is supported on the current platform.
+ */
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental
+abstract class WeekInputElement implements RangeInputElementBase {
+ factory WeekInputElement() => new InputElement(type: 'week');
- @DomName('MediaList.mediaText')
- @DocsEditable
- String mediaText;
+ @DomName('HTMLInputElement.valueAsDate')
+ DateTime valueAsDate;
- @DomName('MediaList.appendMedium')
- @DocsEditable
- void appendMedium(String newMedium) native;
+ @DomName('HTMLInputElement.readOnly')
+ bool readOnly;
- @DomName('MediaList.deleteMedium')
- @DocsEditable
- void deleteMedium(String oldMedium) native;
+ @DomName('HTMLInputElement.required')
+ bool required;
- @DomName('MediaList.item')
- @DocsEditable
- String item(int index) native;
+ /// Returns true if this input type is supported on the current platform.
+ static bool get supported {
+ return (new InputElement(type: 'week')).type == 'week';
+ }
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+/**
+ * A time (hour, minute, seconds, fractional seconds) with no time zone.
+ *
+ * Use [supported] to check if this is supported on the current platform.
+ */
+@SupportedBrowser(SupportedBrowser.CHROME)
+@Experimental
+abstract class TimeInputElement implements RangeInputElementBase {
+ factory TimeInputElement() => new InputElement(type: 'time');
-@DocsEditable
-@DomName('MediaQueryList')
-class MediaQueryList native "*MediaQueryList" {
-
- @DomName('MediaQueryList.matches')
- @DocsEditable
- final bool matches;
+ @DomName('HTMLInputElement.valueAsDate')
+ DateTime valueAsDate;
- @DomName('MediaQueryList.media')
- @DocsEditable
- final String media;
+ @DomName('HTMLInputElement.readOnly')
+ bool readOnly;
- @DomName('MediaQueryList.addListener')
- @DocsEditable
- void addListener(MediaQueryListListener listener) native;
+ @DomName('HTMLInputElement.required')
+ bool required;
- @DomName('MediaQueryList.removeListener')
- @DocsEditable
- void removeListener(MediaQueryListListener listener) native;
+ /// Returns true if this input type is supported on the current platform.
+ static bool get supported {
+ return (new InputElement(type: 'time')).type == 'time';
+ }
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+/**
+ * A date and time (year, month, day, hour, minute, second, fraction of a
+ * second) with no time zone.
+ *
+ * Use [supported] to check if this is supported on the current platform.
+ */
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental
+abstract class LocalDateTimeInputElement implements RangeInputElementBase {
+ factory LocalDateTimeInputElement() =>
+ new InputElement(type: 'datetime-local');
+
+ @DomName('HTMLInputElement.readOnly')
+ bool readOnly;
-@DomName('MediaQueryListListener')
-abstract class MediaQueryListListener {
+ @DomName('HTMLInputElement.required')
+ bool required;
- void queryChanged(MediaQueryList list);
+ /// Returns true if this input type is supported on the current platform.
+ static bool get supported {
+ return (new InputElement(type: 'datetime-local')).type == 'datetime-local';
+ }
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+/**
+ * A numeric editor control.
+ */
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.IE)
+@SupportedBrowser(SupportedBrowser.SAFARI)
+@Experimental
+abstract class NumberInputElement implements RangeInputElementBase {
+ factory NumberInputElement() => new InputElement(type: 'number');
+
+ @DomName('HTMLInputElement.placeholder')
+ String placeholder;
-@DocsEditable
-@DomName('MediaSource')
-class MediaSource extends EventTarget native "*MediaSource" {
+ @DomName('HTMLInputElement.readOnly')
+ bool readOnly;
- @DomName('MediaSource.MediaSource')
- @DocsEditable
- factory MediaSource() {
- return MediaSource._create_1();
- }
- static MediaSource _create_1() => JS('MediaSource', 'new MediaSource()');
+ @DomName('HTMLInputElement.required')
+ bool required;
- @DomName('MediaSource.activeSourceBuffers')
- @DocsEditable
- final SourceBufferList activeSourceBuffers;
+ /// Returns true if this input type is supported on the current platform.
+ static bool get supported {
+ return (new InputElement(type: 'number')).type == 'number';
+ }
+}
- @DomName('MediaSource.duration')
- @DocsEditable
- num duration;
+/**
+ * Similar to [NumberInputElement] but the browser may provide more optimal
+ * styling (such as a slider control).
+ *
+ * Use [supported] to check if this is supported on the current platform.
+ */
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.IE, '10')
+@Experimental
+abstract class RangeInputElement implements RangeInputElementBase {
+ factory RangeInputElement() => new InputElement(type: 'range');
- @DomName('MediaSource.readyState')
- @DocsEditable
- final String readyState;
+ /// Returns true if this input type is supported on the current platform.
+ static bool get supported {
+ return (new InputElement(type: 'range')).type == 'range';
+ }
+}
- @DomName('MediaSource.sourceBuffers')
- @DocsEditable
- final SourceBufferList sourceBuffers;
+/**
+ * A boolean editor control.
+ *
+ * Note that if [indeterminate] is set then this control is in a third
+ * indeterminate state.
+ */
+abstract class CheckboxInputElement implements InputElementBase {
+ factory CheckboxInputElement() => new InputElement(type: 'checkbox');
- @JSName('addEventListener')
- @DomName('MediaSource.addEventListener')
- @DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+ @DomName('HTMLInputElement.checked')
+ bool checked;
- @DomName('MediaSource.addSourceBuffer')
- @DocsEditable
- SourceBuffer addSourceBuffer(String type) native;
+ @DomName('HTMLInputElement.required')
+ bool required;
+}
- @DomName('MediaSource.dispatchEvent')
- @DocsEditable
- bool dispatchEvent(Event event) native;
- @DomName('MediaSource.endOfStream')
- @DocsEditable
- void endOfStream(String error) native;
+/**
+ * A control that when used with other [ReadioButtonInputElement] controls
+ * forms a radio button group in which only one control can be checked at a
+ * time.
+ *
+ * Radio buttons are considered to be in the same radio button group if:
+ *
+ * * They are all of type 'radio'.
+ * * They all have either the same [FormElement] owner, or no owner.
+ * * Their name attributes contain the same name.
+ */
+abstract class RadioButtonInputElement implements InputElementBase {
+ factory RadioButtonInputElement() => new InputElement(type: 'radio');
- @JSName('removeEventListener')
- @DomName('MediaSource.removeEventListener')
- @DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ @DomName('HTMLInputElement.checked')
+ bool checked;
- @DomName('MediaSource.removeSourceBuffer')
- @DocsEditable
- void removeSourceBuffer(SourceBuffer buffer) native;
+ @DomName('HTMLInputElement.required')
+ bool required;
}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+/**
+ * A control for picking files from the user's computer.
+ */
+abstract class FileUploadInputElement implements InputElementBase {
+ factory FileUploadInputElement() => new InputElement(type: 'file');
-@DomName('MediaStream')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Experimental
-class MediaStream extends EventTarget native "*MediaStream" {
+ @DomName('HTMLInputElement.accept')
+ String accept;
- @DomName('MediaStream.addtrackEvent')
- @DocsEditable
- static const EventStreamProvider<Event> addTrackEvent = const EventStreamProvider<Event>('addtrack');
+ @DomName('HTMLInputElement.multiple')
+ bool multiple;
- @DomName('MediaStream.endedEvent')
- @DocsEditable
- static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
+ @DomName('HTMLInputElement.required')
+ bool required;
- @DomName('MediaStream.removetrackEvent')
- @DocsEditable
- static const EventStreamProvider<Event> removeTrackEvent = const EventStreamProvider<Event>('removetrack');
+ @DomName('HTMLInputElement.files')
+ List<File> files;
+}
- @DomName('MediaStream.MediaStream')
- @DocsEditable
- factory MediaStream([stream_OR_tracks]) {
- if (!?stream_OR_tracks) {
- return MediaStream._create_1();
- }
- if ((stream_OR_tracks is MediaStream || stream_OR_tracks == null)) {
- return MediaStream._create_2(stream_OR_tracks);
- }
- if ((stream_OR_tracks is List<MediaStreamTrack> || stream_OR_tracks == null)) {
- return MediaStream._create_3(stream_OR_tracks);
- }
- throw new ArgumentError("Incorrect number or type of arguments");
- }
- static MediaStream _create_1() => JS('MediaStream', 'new MediaStream()');
- static MediaStream _create_2(stream_OR_tracks) => JS('MediaStream', 'new MediaStream(#)', stream_OR_tracks);
- static MediaStream _create_3(stream_OR_tracks) => JS('MediaStream', 'new MediaStream(#)', stream_OR_tracks);
+/**
+ * A button, which when clicked, submits the form.
+ */
+abstract class SubmitButtonInputElement implements InputElementBase {
+ factory SubmitButtonInputElement() => new InputElement(type: 'submit');
- @DomName('MediaStream.ended')
- @DocsEditable
- final bool ended;
+ @DomName('HTMLInputElement.formAction')
+ String formAction;
- @DomName('MediaStream.id')
- @DocsEditable
- final String id;
+ @DomName('HTMLInputElement.formEnctype')
+ String formEnctype;
- @DomName('MediaStream.label')
- @DocsEditable
- final String label;
+ @DomName('HTMLInputElement.formMethod')
+ String formMethod;
- @JSName('addEventListener')
- @DomName('MediaStream.addEventListener')
- @DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+ @DomName('HTMLInputElement.formNoValidate')
+ bool formNoValidate;
- @DomName('MediaStream.addTrack')
- @DocsEditable
- void addTrack(MediaStreamTrack track) native;
+ @DomName('HTMLInputElement.formTarget')
+ String formTarget;
+}
- @DomName('MediaStream.dispatchEvent')
- @DocsEditable
- bool dispatchEvent(Event event) native;
+/**
+ * Either an image which the user can select a coordinate to or a form
+ * submit button.
+ */
+abstract class ImageButtonInputElement implements InputElementBase {
+ factory ImageButtonInputElement() => new InputElement(type: 'image');
- @DomName('MediaStream.getAudioTracks')
- @DocsEditable
- List<MediaStreamTrack> getAudioTracks() native;
+ @DomName('HTMLInputElement.alt')
+ String alt;
- @DomName('MediaStream.getTrackById')
- @DocsEditable
- MediaStreamTrack getTrackById(String trackId) native;
+ @DomName('HTMLInputElement.formAction')
+ String formAction;
- @DomName('MediaStream.getVideoTracks')
- @DocsEditable
- List<MediaStreamTrack> getVideoTracks() native;
+ @DomName('HTMLInputElement.formEnctype')
+ String formEnctype;
- @JSName('removeEventListener')
- @DomName('MediaStream.removeEventListener')
- @DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ @DomName('HTMLInputElement.formMethod')
+ String formMethod;
- @DomName('MediaStream.removeTrack')
- @DocsEditable
- void removeTrack(MediaStreamTrack track) native;
+ @DomName('HTMLInputElement.formNoValidate')
+ bool formNoValidate;
- @DomName('MediaStream.onaddtrack')
- @DocsEditable
- Stream<Event> get onAddTrack => addTrackEvent.forTarget(this);
+ @DomName('HTMLInputElement.formTarget')
+ String formTarget;
- @DomName('MediaStream.onended')
- @DocsEditable
- Stream<Event> get onEnded => endedEvent.forTarget(this);
+ @DomName('HTMLInputElement.height')
+ int height;
- @DomName('MediaStream.onremovetrack')
- @DocsEditable
- Stream<Event> get onRemoveTrack => removeTrackEvent.forTarget(this);
+ @DomName('HTMLInputElement.src')
+ String src;
+ @DomName('HTMLInputElement.width')
+ int width;
+}
- /**
- * Checks if the MediaStream APIs are supported on the current platform.
- *
- * See also:
- *
- * * [Navigator.getUserMedia]
- */
- static bool get supported =>
- JS('bool', '''!!(#.getUserMedia || #.webkitGetUserMedia ||
- #.mozGetUserMedia || #.msGetUserMedia)''',
- window.navigator,
- window.navigator,
- window.navigator,
- window.navigator);
+/**
+ * A button, which when clicked, resets the form.
+ */
+abstract class ResetButtonInputElement implements InputElementBase {
+ factory ResetButtonInputElement() => new InputElement(type: 'reset');
+}
+
+/**
+ * A button, with no default behavior.
+ */
+abstract class ButtonInputElement implements InputElementBase {
+ factory ButtonInputElement() => new InputElement(type: 'button');
}
+
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable
-@DomName('MediaStreamEvent')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Experimental
-class MediaStreamEvent extends Event native "*MediaStreamEvent" {
-
- /// Checks if this type is supported on the current platform.
- static bool get supported => Device.isEventTypeSupported('MediaStreamEvent');
+@DomName('JavaScriptCallFrame')
+class JavaScriptCallFrame native "*JavaScriptCallFrame" {
- @DomName('MediaStreamEvent.stream')
- @DocsEditable
- final MediaStream stream;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ static const int CATCH_SCOPE = 4;
+ static const int CLOSURE_SCOPE = 3;
-@DocsEditable
-@DomName('MediaStreamTrack')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Experimental
-class MediaStreamTrack extends EventTarget native "*MediaStreamTrack" {
+ static const int GLOBAL_SCOPE = 0;
- @DomName('MediaStreamTrack.endedEvent')
- @DocsEditable
- static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
+ static const int LOCAL_SCOPE = 1;
- @DomName('MediaStreamTrack.muteEvent')
- @DocsEditable
- static const EventStreamProvider<Event> muteEvent = const EventStreamProvider<Event>('mute');
+ static const int WITH_SCOPE = 2;
- @DomName('MediaStreamTrack.unmuteEvent')
+ @DomName('JavaScriptCallFrame.caller')
@DocsEditable
- static const EventStreamProvider<Event> unmuteEvent = const EventStreamProvider<Event>('unmute');
+ final JavaScriptCallFrame caller;
- @DomName('MediaStreamTrack.enabled')
+ @DomName('JavaScriptCallFrame.column')
@DocsEditable
- bool enabled;
+ final int column;
- @DomName('MediaStreamTrack.id')
+ @DomName('JavaScriptCallFrame.functionName')
@DocsEditable
- final String id;
+ final String functionName;
- @DomName('MediaStreamTrack.kind')
+ @DomName('JavaScriptCallFrame.line')
@DocsEditable
- final String kind;
+ final int line;
- @DomName('MediaStreamTrack.label')
+ @DomName('JavaScriptCallFrame.scopeChain')
@DocsEditable
- final String label;
+ final List scopeChain;
- @DomName('MediaStreamTrack.readyState')
+ @DomName('JavaScriptCallFrame.sourceID')
@DocsEditable
- final String readyState;
+ final int sourceID;
- @JSName('addEventListener')
- @DomName('MediaStreamTrack.addEventListener')
+ @DomName('JavaScriptCallFrame.thisObject')
@DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+ final Object thisObject;
- @DomName('MediaStreamTrack.dispatchEvent')
+ @DomName('JavaScriptCallFrame.type')
@DocsEditable
- bool dispatchEvent(Event event) native;
+ final String type;
- @JSName('removeEventListener')
- @DomName('MediaStreamTrack.removeEventListener')
+ @DomName('JavaScriptCallFrame.evaluate')
@DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ void evaluate(String script) native;
- @DomName('MediaStreamTrack.onended')
+ @DomName('JavaScriptCallFrame.restart')
@DocsEditable
- Stream<Event> get onEnded => endedEvent.forTarget(this);
+ Object restart() native;
- @DomName('MediaStreamTrack.onmute')
+ @DomName('JavaScriptCallFrame.scopeType')
@DocsEditable
- Stream<Event> get onMute => muteEvent.forTarget(this);
+ int scopeType(int scopeIndex) native;
- @DomName('MediaStreamTrack.onunmute')
+ @DomName('JavaScriptCallFrame.setVariableValue')
@DocsEditable
- Stream<Event> get onUnmute => unmuteEvent.forTarget(this);
+ Object setVariableValue(int scopeIndex, String variableName, Object newValue) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DocsEditable
-@DomName('MediaStreamTrackEvent')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Experimental
-class MediaStreamTrackEvent extends Event native "*MediaStreamTrackEvent" {
+@DomName('KeyboardEvent')
+class KeyboardEvent extends UIEvent native "*KeyboardEvent" {
- /// Checks if this type is supported on the current platform.
- static bool get supported => Device.isEventTypeSupported('MediaStreamTrackEvent');
+ factory KeyboardEvent(String type,
+ {Window view, bool canBubble: true, bool cancelable: true,
+ String keyIdentifier: "", int keyLocation: 1, bool ctrlKey: false,
+ bool altKey: false, bool shiftKey: false, bool metaKey: false,
+ bool altGraphKey: false}) {
+ if (view == null) {
+ view = window;
+ }
+ final e = document.$dom_createEvent("KeyboardEvent");
+ e.$dom_initKeyboardEvent(type, canBubble, cancelable, view, keyIdentifier,
+ keyLocation, ctrlKey, altKey, shiftKey, metaKey, altGraphKey);
+ return e;
+ }
- @DomName('MediaStreamTrackEvent.track')
- @DocsEditable
- final MediaStreamTrack track;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @DomName('KeyboardEvent.initKeyboardEvent')
+ void $dom_initKeyboardEvent(String type, bool canBubble, bool cancelable,
+ Window view, String keyIdentifier, int keyLocation, bool ctrlKey,
+ bool altKey, bool shiftKey, bool metaKey, bool altGraphKey) {
+ if (JS('bool', 'typeof(#.initKeyEvent) == "function"', this)) {
+ // initKeyEvent is only in Firefox (instead of initKeyboardEvent). It has
+ // a slightly different signature, and allows you to specify keyCode and
+ // charCode as the last two arguments, but we just set them as the default
+ // since they can't be specified in other browsers.
+ JS('void', '#.initKeyEvent(#, #, #, #, #, #, #, #, 0, 0)', this,
+ type, canBubble, cancelable, view,
+ ctrlKey, altKey, shiftKey, metaKey);
+ } else {
+ // initKeyboardEvent is for all other browsers.
+ JS('void', '#.initKeyboardEvent(#, #, #, #, #, #, #, #, #, #, #)', this,
+ type, canBubble, cancelable, view, keyIdentifier, keyLocation,
+ ctrlKey, altKey, shiftKey, metaKey, altGraphKey);
+ }
+ }
+ @DomName('KeyboardEvent.keyCode')
+ int get keyCode => $dom_keyCode;
-@DocsEditable
-@DomName('MemoryInfo')
-class MemoryInfo native "*MemoryInfo" {
+ @DomName('KeyboardEvent.charCode')
+ int get charCode => $dom_charCode;
- @DomName('MemoryInfo.jsHeapSizeLimit')
+ @DomName('KeyboardEvent.altGraphKey')
@DocsEditable
- final int jsHeapSizeLimit;
+ final bool altGraphKey;
- @DomName('MemoryInfo.totalJSHeapSize')
+ @DomName('KeyboardEvent.altKey')
@DocsEditable
- final int totalJSHeapSize;
+ final bool altKey;
- @DomName('MemoryInfo.usedJSHeapSize')
+ @DomName('KeyboardEvent.ctrlKey')
@DocsEditable
- final int usedJSHeapSize;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ final bool ctrlKey;
+
+ @JSName('keyIdentifier')
+ @DomName('KeyboardEvent.keyIdentifier')
+ @DocsEditable
+ final String $dom_keyIdentifier;
+ @DomName('KeyboardEvent.keyLocation')
+ @DocsEditable
+ final int keyLocation;
-@DocsEditable
-/**
- * An HTML <menu> element.
- *
- * A <menu> element represents an unordered list of menu commands.
- *
- * See also:
- *
- * * [Menu Element](https://developer.mozilla.org/en-US/docs/HTML/Element/menu) from MDN.
- * * [Menu Element](http://www.w3.org/TR/html5/the-menu-element.html#the-menu-element) from the W3C.
- */
-@DomName('HTMLMenuElement')
-class MenuElement extends Element native "*HTMLMenuElement" {
+ @DomName('KeyboardEvent.metaKey')
+ @DocsEditable
+ final bool metaKey;
- @DomName('HTMLMenuElement.HTMLMenuElement')
+ @DomName('KeyboardEvent.shiftKey')
@DocsEditable
- factory MenuElement() => document.$dom_createElement("menu");
+ final bool shiftKey;
+
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -16488,80 +13928,72 @@ class MenuElement extends Element native "*HTMLMenuElement" {
@DocsEditable
-@DomName('MessageChannel')
-class MessageChannel native "*MessageChannel" {
+@DomName('HTMLKeygenElement')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.SAFARI)
+@Experimental
+class KeygenElement extends Element native "*HTMLKeygenElement" {
- @DomName('MessageChannel.MessageChannel')
+ @DomName('HTMLKeygenElement.HTMLKeygenElement')
@DocsEditable
- factory MessageChannel() {
- return MessageChannel._create_1();
- }
- static MessageChannel _create_1() => JS('MessageChannel', 'new MessageChannel()');
+ factory KeygenElement() => document.$dom_createElement("keygen");
- @DomName('MessageChannel.port1')
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => Element.isTagSupported('keygen') && (new Element.tag('keygen') is KeygenElement);
+
+ @DomName('HTMLKeygenElement.autofocus')
@DocsEditable
- final MessagePort port1;
+ bool autofocus;
- @DomName('MessageChannel.port2')
+ @DomName('HTMLKeygenElement.challenge')
@DocsEditable
- final MessagePort port2;
-}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ String challenge;
-// WARNING: Do not edit - generated code.
+ @DomName('HTMLKeygenElement.disabled')
+ @DocsEditable
+ bool disabled;
+ @DomName('HTMLKeygenElement.form')
+ @DocsEditable
+ final FormElement form;
-@DomName('MessageEvent')
-class MessageEvent extends Event native "*MessageEvent" {
- factory MessageEvent(String type,
- {bool canBubble: false, bool cancelable: false, Object data,
- String origin, String lastEventId,
- Window source, List messagePorts}) {
- if (source == null) {
- source = window;
- }
- var event = document.$dom_createEvent("MessageEvent");
- event.$dom_initMessageEvent(type, canBubble, cancelable, data, origin,
- lastEventId, source, messagePorts);
- return event;
- }
+ @DomName('HTMLKeygenElement.keytype')
+ @DocsEditable
+ String keytype;
- dynamic get data => convertNativeToDart_SerializedScriptValue(this._get_data);
- @JSName('data')
- @DomName('MessageEvent.data')
+ @DomName('HTMLKeygenElement.labels')
@DocsEditable
- @annotation_Creates_SerializedScriptValue
- @annotation_Returns_SerializedScriptValue
- final dynamic _get_data;
+ @Returns('NodeList')
+ @Creates('NodeList')
+ final List<Node> labels;
- @DomName('MessageEvent.lastEventId')
+ @DomName('HTMLKeygenElement.name')
@DocsEditable
- final String lastEventId;
+ String name;
+
+ @DomName('HTMLKeygenElement.type')
+ @DocsEditable
+ final String type;
- @DomName('MessageEvent.origin')
+ @DomName('HTMLKeygenElement.validationMessage')
@DocsEditable
- final String origin;
+ final String validationMessage;
- @DomName('MessageEvent.ports')
+ @DomName('HTMLKeygenElement.validity')
@DocsEditable
- @Creates('=List')
- final List ports;
+ final ValidityState validity;
- WindowBase get source => _convertNativeToDart_Window(this._get_source);
- @JSName('source')
- @DomName('MessageEvent.source')
+ @DomName('HTMLKeygenElement.willValidate')
@DocsEditable
- @Creates('Window|=Object')
- @Returns('Window|=Object')
- final dynamic _get_source;
+ final bool willValidate;
- @JSName('initMessageEvent')
- @DomName('MessageEvent.initMessageEvent')
+ @DomName('HTMLKeygenElement.checkValidity')
@DocsEditable
- void $dom_initMessageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Object dataArg, String originArg, String lastEventIdArg, Window sourceArg, List messagePorts) native;
+ bool checkValidity() native;
+ @DomName('HTMLKeygenElement.setCustomValidity')
+ @DocsEditable
+ void setCustomValidity(String error) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -16569,59 +14001,45 @@ class MessageEvent extends Event native "*MessageEvent" {
@DocsEditable
-@DomName('MessagePort')
-class MessagePort extends EventTarget native "*MessagePort" {
+@DomName('HTMLLIElement')
+class LIElement extends Element native "*HTMLLIElement" {
- @DomName('MessagePort.messageEvent')
+ @DomName('HTMLLIElement.HTMLLIElement')
@DocsEditable
- static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
+ factory LIElement() => document.$dom_createElement("li");
- @JSName('addEventListener')
- @DomName('MessagePort.addEventListener')
+ @DomName('HTMLLIElement.type')
@DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+ String type;
- @DomName('MessagePort.close')
+ @DomName('HTMLLIElement.value')
@DocsEditable
- void close() native;
+ int value;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('MessagePort.dispatchEvent')
- @DocsEditable
- bool dispatchEvent(Event evt) native;
- @DomName('MessagePort.postMessage')
- @DocsEditable
- void postMessage(/*any*/ message, [List messagePorts]) {
- if (?messagePorts) {
- var message_1 = convertDartToNative_SerializedScriptValue(message);
- _postMessage_1(message_1, messagePorts);
- return;
- }
- var message_2 = convertDartToNative_SerializedScriptValue(message);
- _postMessage_2(message_2);
- return;
- }
- @JSName('postMessage')
- @DomName('MessagePort.postMessage')
- @DocsEditable
- void _postMessage_1(message, List messagePorts) native;
- @JSName('postMessage')
- @DomName('MessagePort.postMessage')
+@DocsEditable
+@DomName('HTMLLabelElement')
+class LabelElement extends Element native "*HTMLLabelElement" {
+
+ @DomName('HTMLLabelElement.HTMLLabelElement')
@DocsEditable
- void _postMessage_2(message) native;
+ factory LabelElement() => document.$dom_createElement("label");
- @JSName('removeEventListener')
- @DomName('MessagePort.removeEventListener')
+ @DomName('HTMLLabelElement.control')
@DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ final Element control;
- @DomName('MessagePort.start')
+ @DomName('HTMLLabelElement.form')
@DocsEditable
- void start() native;
+ final FormElement form;
- @DomName('MessagePort.onmessage')
+ @DomName('HTMLLabelElement.htmlFor')
@DocsEditable
- Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+ String htmlFor;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -16629,20 +14047,16 @@ class MessagePort extends EventTarget native "*MessagePort" {
@DocsEditable
-@DomName('HTMLMetaElement')
-class MetaElement extends Element native "*HTMLMetaElement" {
-
- @DomName('HTMLMetaElement.content')
- @DocsEditable
- String content;
+@DomName('HTMLLegendElement')
+class LegendElement extends Element native "*HTMLLegendElement" {
- @DomName('HTMLMetaElement.httpEquiv')
+ @DomName('HTMLLegendElement.HTMLLegendElement')
@DocsEditable
- String httpEquiv;
+ factory LegendElement() => document.$dom_createElement("legend");
- @DomName('HTMLMetaElement.name')
+ @DomName('HTMLLegendElement.form')
@DocsEditable
- String name;
+ final FormElement form;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -16650,1074 +14064,818 @@ class MetaElement extends Element native "*HTMLMetaElement" {
@DocsEditable
-@DomName('Metadata')
-class Metadata native "*Metadata" {
+@DomName('HTMLLinkElement')
+class LinkElement extends Element native "*HTMLLinkElement" {
- DateTime get modificationTime => _convertNativeToDart_DateTime(this._get_modificationTime);
- @JSName('modificationTime')
- @DomName('Metadata.modificationTime')
+ @DomName('HTMLLinkElement.HTMLLinkElement')
@DocsEditable
- final dynamic _get_modificationTime;
+ factory LinkElement() => document.$dom_createElement("link");
- @DomName('Metadata.size')
+ @DomName('HTMLLinkElement.disabled')
@DocsEditable
- final int size;
+ bool disabled;
+
+ @DomName('HTMLLinkElement.href')
+ @DocsEditable
+ String href;
+
+ @DomName('HTMLLinkElement.hreflang')
+ @DocsEditable
+ String hreflang;
+
+ @DomName('HTMLLinkElement.media')
+ @DocsEditable
+ String media;
+
+ @DomName('HTMLLinkElement.rel')
+ @DocsEditable
+ String rel;
+
+ @DomName('HTMLLinkElement.sheet')
+ @DocsEditable
+ final StyleSheet sheet;
+
+ @DomName('HTMLLinkElement.sizes')
+ @DocsEditable
+ DomSettableTokenList sizes;
+
+ @DomName('HTMLLinkElement.type')
+ @DocsEditable
+ String type;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// WARNING: Do not edit - generated code.
+@DocsEditable
+@DomName('LocalMediaStream')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@Experimental
+class LocalMediaStream extends MediaStream implements EventTarget native "*LocalMediaStream" {
-typedef void MetadataCallback(Metadata metadata);
+ @DomName('LocalMediaStream.stop')
+ @DocsEditable
+ void stop() native;
+}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable
-@DomName('HTMLMeterElement')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class MeterElement extends Element native "*HTMLMeterElement" {
+@DomName('Location')
+class Location implements LocationBase native "*Location" {
- @DomName('HTMLMeterElement.HTMLMeterElement')
+ @DomName('Location.ancestorOrigins')
@DocsEditable
- factory MeterElement() => document.$dom_createElement("meter");
+ @Returns('DomStringList')
+ @Creates('DomStringList')
+ final List<String> ancestorOrigins;
- /// Checks if this type is supported on the current platform.
- static bool get supported => Element.isTagSupported('meter');
+ @DomName('Location.hash')
+ @DocsEditable
+ String hash;
- @DomName('HTMLMeterElement.high')
+ @DomName('Location.host')
@DocsEditable
- num high;
+ String host;
- @DomName('HTMLMeterElement.labels')
+ @DomName('Location.hostname')
@DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- final List<Node> labels;
+ String hostname;
- @DomName('HTMLMeterElement.low')
+ @DomName('Location.href')
@DocsEditable
- num low;
+ String href;
- @DomName('HTMLMeterElement.max')
+ @DomName('Location.origin')
@DocsEditable
- num max;
+ final String origin;
- @DomName('HTMLMeterElement.min')
+ @DomName('Location.pathname')
@DocsEditable
- num min;
+ String pathname;
- @DomName('HTMLMeterElement.optimum')
+ @DomName('Location.port')
@DocsEditable
- num optimum;
+ String port;
- @DomName('HTMLMeterElement.value')
+ @DomName('Location.protocol')
@DocsEditable
- num value;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ String protocol;
+ @DomName('Location.search')
+ @DocsEditable
+ String search;
-@DocsEditable
-@DomName('HTMLModElement')
-class ModElement extends Element native "*HTMLModElement" {
+ @DomName('Location.assign')
+ @DocsEditable
+ void assign(String url) native;
- @DomName('HTMLModElement.cite')
+ @DomName('Location.reload')
@DocsEditable
- String cite;
+ void reload() native;
- @DomName('HTMLModElement.dateTime')
+ @DomName('Location.replace')
@DocsEditable
- String dateTime;
+ void replace(String url) native;
+
+ @DomName('Location.toString')
+ @DocsEditable
+ String toString() native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DomName('MouseEvent')
-class MouseEvent extends UIEvent native "*MouseEvent" {
- factory MouseEvent(String type,
- {Window view, int detail: 0, int screenX: 0, int screenY: 0,
- int clientX: 0, int clientY: 0, int button: 0, bool canBubble: true,
- bool cancelable: true, bool ctrlKey: false, bool altKey: false,
- bool shiftKey: false, bool metaKey: false, EventTarget relatedTarget}) {
-
- if (view == null) {
- view = window;
- }
- var event = document.$dom_createEvent('MouseEvent');
- event.$dom_initMouseEvent(type, canBubble, cancelable, view, detail,
- screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey,
- button, relatedTarget);
- return event;
- }
-
- @DomName('MouseEvent.altKey')
- @DocsEditable
- final bool altKey;
-
- @DomName('MouseEvent.button')
- @DocsEditable
- final int button;
+@DocsEditable
+@DomName('HTMLMapElement')
+class MapElement extends Element native "*HTMLMapElement" {
- @JSName('clientX')
- @DomName('MouseEvent.clientX')
+ @DomName('HTMLMapElement.HTMLMapElement')
@DocsEditable
- final int $dom_clientX;
+ factory MapElement() => document.$dom_createElement("map");
- @JSName('clientY')
- @DomName('MouseEvent.clientY')
+ @DomName('HTMLMapElement.areas')
@DocsEditable
- final int $dom_clientY;
+ final HtmlCollection areas;
- @DomName('MouseEvent.ctrlKey')
+ @DomName('HTMLMapElement.name')
@DocsEditable
- final bool ctrlKey;
+ String name;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('MouseEvent.dataTransfer')
+
+@DocsEditable
+@DomName('MediaController')
+class MediaController extends EventTarget native "*MediaController" {
+
+ @DomName('MediaController.MediaController')
@DocsEditable
- final DataTransfer dataTransfer;
+ factory MediaController() {
+ return MediaController._create_1();
+ }
+ static MediaController _create_1() => JS('MediaController', 'new MediaController()');
- @DomName('MouseEvent.fromElement')
+ @DomName('MediaController.buffered')
@DocsEditable
- final Node fromElement;
+ final TimeRanges buffered;
- @DomName('MouseEvent.metaKey')
+ @DomName('MediaController.currentTime')
@DocsEditable
- final bool metaKey;
+ num currentTime;
- EventTarget get relatedTarget => _convertNativeToDart_EventTarget(this._get_relatedTarget);
- @JSName('relatedTarget')
- @DomName('MouseEvent.relatedTarget')
+ @DomName('MediaController.defaultPlaybackRate')
@DocsEditable
- @Creates('Node')
- @Returns('EventTarget|=Object')
- final dynamic _get_relatedTarget;
+ num defaultPlaybackRate;
- @JSName('screenX')
- @DomName('MouseEvent.screenX')
+ @DomName('MediaController.duration')
@DocsEditable
- final int $dom_screenX;
+ final num duration;
- @JSName('screenY')
- @DomName('MouseEvent.screenY')
+ @DomName('MediaController.muted')
@DocsEditable
- final int $dom_screenY;
+ bool muted;
- @DomName('MouseEvent.shiftKey')
+ @DomName('MediaController.paused')
@DocsEditable
- final bool shiftKey;
+ final bool paused;
- @DomName('MouseEvent.toElement')
+ @DomName('MediaController.playbackRate')
@DocsEditable
- final Node toElement;
+ num playbackRate;
- @JSName('webkitMovementX')
- @DomName('MouseEvent.webkitMovementX')
+ @DomName('MediaController.playbackState')
@DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- final int $dom_webkitMovementX;
+ final String playbackState;
- @JSName('webkitMovementY')
- @DomName('MouseEvent.webkitMovementY')
+ @DomName('MediaController.played')
@DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- final int $dom_webkitMovementY;
+ final TimeRanges played;
- @DomName('MouseEvent.initMouseEvent')
+ @DomName('MediaController.seekable')
@DocsEditable
- void $dom_initMouseEvent(String type, bool canBubble, bool cancelable, Window view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, int button, EventTarget relatedTarget) {
- var relatedTarget_1 = _convertDartToNative_EventTarget(relatedTarget);
- _$dom_initMouseEvent_1(type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget_1);
- return;
- }
- @JSName('initMouseEvent')
- @DomName('MouseEvent.initMouseEvent')
+ final TimeRanges seekable;
+
+ @DomName('MediaController.volume')
@DocsEditable
- void _$dom_initMouseEvent_1(type, canBubble, cancelable, Window view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) native;
+ num volume;
+ @JSName('addEventListener')
+ @DomName('MediaController.addEventListener')
+ @DocsEditable
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- @deprecated
- int get clientX => client.x;
- @deprecated
- int get clientY => client.y;
- @deprecated
- int get offsetX => offset.x;
- @deprecated
- int get offsetY => offset.y;
- @deprecated
- int get movementX => movement.x;
- @deprecated
- int get movementY => movement.y;
- @deprecated
- int get screenX => screen.x;
- @deprecated
- int get screenY => screen.y;
+ @DomName('MediaController.dispatchEvent')
+ @DocsEditable
+ bool dispatchEvent(Event evt) native;
- @DomName('MouseEvent.clientX')
- @DomName('MouseEvent.clientY')
- Point get client => new Point($dom_clientX, $dom_clientY);
+ @DomName('MediaController.pause')
+ @DocsEditable
+ void pause() native;
- @DomName('MouseEvent.movementX')
- @DomName('MouseEvent.movementY')
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- Point get movement => new Point($dom_webkitMovementX, $dom_webkitMovementY);
+ @DomName('MediaController.play')
+ @DocsEditable
+ void play() native;
- /**
- * The coordinates of the mouse pointer in target node coordinates.
- *
- * This value may vary between platforms if the target node moves
- * after the event has fired or if the element has CSS transforms affecting
- * it.
- */
- Point get offset {
- if (JS('bool', '!!#.offsetX', this)) {
- var x = JS('int', '#.offsetX', this);
- var y = JS('int', '#.offsetX', this);
- return new Point(x, y);
- } else {
- // Firefox does not support offsetX.
- var target = this.target;
- if (!(target is Element)) {
- throw new UnsupportedError(
- 'offsetX is only supported on elements');
- }
- return (this.client -
- this.target.getBoundingClientRect().topLeft).toInt();
- }
- }
+ @JSName('removeEventListener')
+ @DomName('MediaController.removeEventListener')
+ @DocsEditable
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('MouseEvent.screenX')
- @DomName('MouseEvent.screenY')
- Point get screen => new Point($dom_screenX, $dom_screenY);
+ @DomName('MediaController.unpause')
+ @DocsEditable
+ void unpause() native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// WARNING: Do not edit - generated code.
-
-
-typedef void MutationCallback(List<MutationRecord> mutations, MutationObserver observer);
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DomName('MutationEvent')
-class MutationEvent extends Event native "*MutationEvent" {
- factory MutationEvent(String type,
- {bool canBubble: false, bool cancelable: false, Node relatedNode,
- String prevValue, String newValue, String attrName, int attrChange: 0}) {
- var event = document.$dom_createEvent('MutationEvent');
- event.$dom_initMutationEvent(type, canBubble, cancelable, relatedNode,
- prevValue, newValue, attrName, attrChange);
- return event;
- }
+@DocsEditable
+@DomName('HTMLMediaElement')
+class MediaElement extends Element native "*HTMLMediaElement" {
- static const int ADDITION = 2;
+ @DomName('HTMLMediaElement.canplayEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> canPlayEvent = const EventStreamProvider<Event>('canplay');
- static const int MODIFICATION = 1;
+ @DomName('HTMLMediaElement.canplaythroughEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> canPlayThroughEvent = const EventStreamProvider<Event>('canplaythrough');
- static const int REMOVAL = 3;
+ @DomName('HTMLMediaElement.durationchangeEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> durationChangeEvent = const EventStreamProvider<Event>('durationchange');
- @DomName('MutationEvent.attrChange')
+ @DomName('HTMLMediaElement.emptiedEvent')
@DocsEditable
- final int attrChange;
+ static const EventStreamProvider<Event> emptiedEvent = const EventStreamProvider<Event>('emptied');
- @DomName('MutationEvent.attrName')
+ @DomName('HTMLMediaElement.endedEvent')
@DocsEditable
- final String attrName;
+ static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
- @DomName('MutationEvent.newValue')
+ @DomName('HTMLMediaElement.loadeddataEvent')
@DocsEditable
- final String newValue;
+ static const EventStreamProvider<Event> loadedDataEvent = const EventStreamProvider<Event>('loadeddata');
- @DomName('MutationEvent.prevValue')
+ @DomName('HTMLMediaElement.loadedmetadataEvent')
@DocsEditable
- final String prevValue;
+ static const EventStreamProvider<Event> loadedMetadataEvent = const EventStreamProvider<Event>('loadedmetadata');
- @DomName('MutationEvent.relatedNode')
+ @DomName('HTMLMediaElement.loadstartEvent')
@DocsEditable
- final Node relatedNode;
+ static const EventStreamProvider<Event> loadStartEvent = const EventStreamProvider<Event>('loadstart');
- @JSName('initMutationEvent')
- @DomName('MutationEvent.initMutationEvent')
+ @DomName('HTMLMediaElement.pauseEvent')
@DocsEditable
- void $dom_initMutationEvent(String type, bool canBubble, bool cancelable, Node relatedNode, String prevValue, String newValue, String attrName, int attrChange) native;
+ static const EventStreamProvider<Event> pauseEvent = const EventStreamProvider<Event>('pause');
-}
+ @DomName('HTMLMediaElement.playEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> playEvent = const EventStreamProvider<Event>('play');
+ @DomName('HTMLMediaElement.playingEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> playingEvent = const EventStreamProvider<Event>('playing');
+ @DomName('HTMLMediaElement.progressEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> progressEvent = const EventStreamProvider<Event>('progress');
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @DomName('HTMLMediaElement.ratechangeEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> rateChangeEvent = const EventStreamProvider<Event>('ratechange');
+ @DomName('HTMLMediaElement.seekedEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> seekedEvent = const EventStreamProvider<Event>('seeked');
-@DomName('MutationObserver')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Experimental
-class MutationObserver native "*MutationObserver" {
+ @DomName('HTMLMediaElement.seekingEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> seekingEvent = const EventStreamProvider<Event>('seeking');
- @DomName('MutationObserver.disconnect')
+ @DomName('HTMLMediaElement.showEvent')
@DocsEditable
- void disconnect() native;
+ static const EventStreamProvider<Event> showEvent = const EventStreamProvider<Event>('show');
- @DomName('MutationObserver.observe')
+ @DomName('HTMLMediaElement.stalledEvent')
@DocsEditable
- void _observe(Node target, Map options) {
- var options_1 = convertDartToNative_Dictionary(options);
- __observe_1(target, options_1);
- return;
- }
- @JSName('observe')
- @DomName('MutationObserver.observe')
+ static const EventStreamProvider<Event> stalledEvent = const EventStreamProvider<Event>('stalled');
+
+ @DomName('HTMLMediaElement.suspendEvent')
@DocsEditable
- void __observe_1(Node target, options) native;
+ static const EventStreamProvider<Event> suspendEvent = const EventStreamProvider<Event>('suspend');
- @DomName('MutationObserver.takeRecords')
+ @DomName('HTMLMediaElement.timeupdateEvent')
@DocsEditable
- List<MutationRecord> takeRecords() native;
+ static const EventStreamProvider<Event> timeUpdateEvent = const EventStreamProvider<Event>('timeupdate');
- /**
- * Checks to see if the mutation observer API is supported on the current
- * platform.
- */
- static bool get supported {
- return JS('bool',
- '!!(window.MutationObserver || window.WebKitMutationObserver)');
- }
+ @DomName('HTMLMediaElement.volumechangeEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> volumeChangeEvent = const EventStreamProvider<Event>('volumechange');
- void observe(Node target,
- {Map options,
- bool childList,
- bool attributes,
- bool characterData,
- bool subtree,
- bool attributeOldValue,
- bool characterDataOldValue,
- List<String> attributeFilter}) {
+ @DomName('HTMLMediaElement.waitingEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> waitingEvent = const EventStreamProvider<Event>('waiting');
- // Parse options into map of known type.
- var parsedOptions = _createDict();
+ @DomName('HTMLMediaElement.webkitkeyaddedEvent')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ static const EventStreamProvider<MediaKeyEvent> keyAddedEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeyadded');
- if (options != null) {
- options.forEach((k, v) {
- if (_boolKeys.containsKey(k)) {
- _add(parsedOptions, k, true == v);
- } else if (k == 'attributeFilter') {
- _add(parsedOptions, k, _fixupList(v));
- } else {
- throw new ArgumentError(
- "Illegal MutationObserver.observe option '$k'");
- }
- });
- }
+ @DomName('HTMLMediaElement.webkitkeyerrorEvent')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ static const EventStreamProvider<MediaKeyEvent> keyErrorEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeyerror');
- // Override options passed in the map with named optional arguments.
- override(key, value) {
- if (value != null) _add(parsedOptions, key, value);
- }
+ @DomName('HTMLMediaElement.webkitkeymessageEvent')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ static const EventStreamProvider<MediaKeyEvent> keyMessageEvent = const EventStreamProvider<MediaKeyEvent>('webkitkeymessage');
- override('childList', childList);
- override('attributes', attributes);
- override('characterData', characterData);
- override('subtree', subtree);
- override('attributeOldValue', attributeOldValue);
- override('characterDataOldValue', characterDataOldValue);
- if (attributeFilter != null) {
- override('attributeFilter', _fixupList(attributeFilter));
- }
+ @DomName('HTMLMediaElement.webkitneedkeyEvent')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ static const EventStreamProvider<MediaKeyEvent> needKeyEvent = const EventStreamProvider<MediaKeyEvent>('webkitneedkey');
- _call(target, parsedOptions);
- }
+ static const int HAVE_CURRENT_DATA = 2;
- // TODO: Change to a set when const Sets are available.
- static final _boolKeys =
- const {'childList': true,
- 'attributes': true,
- 'characterData': true,
- 'subtree': true,
- 'attributeOldValue': true,
- 'characterDataOldValue': true };
+ static const int HAVE_ENOUGH_DATA = 4;
+ static const int HAVE_FUTURE_DATA = 3;
- static _createDict() => JS('var', '{}');
- static _add(m, String key, value) { JS('void', '#[#] = #', m, key, value); }
- static _fixupList(list) => list; // TODO: Ensure is a JavaScript Array.
+ static const int HAVE_METADATA = 1;
- // Call native function with no conversions.
- @JSName('observe')
- void _call(target, options) native;
+ static const int HAVE_NOTHING = 0;
- factory MutationObserver(MutationCallback callback) {
- // Dummy statement to mark types as instantiated.
- JS('MutationObserver|MutationRecord', '0');
+ static const int NETWORK_EMPTY = 0;
- return JS('MutationObserver',
- 'new(window.MutationObserver||window.WebKitMutationObserver||'
- 'window.MozMutationObserver)(#)',
- convertDartClosureToJS(callback, 2));
- }
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ static const int NETWORK_IDLE = 1;
+ static const int NETWORK_LOADING = 2;
-@DocsEditable
-@DomName('MutationRecord')
-class MutationRecord native "*MutationRecord" {
+ static const int NETWORK_NO_SOURCE = 3;
- @DomName('MutationRecord.addedNodes')
+ @DomName('HTMLMediaElement.autoplay')
@DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- final List<Node> addedNodes;
+ bool autoplay;
- @DomName('MutationRecord.attributeName')
+ @DomName('HTMLMediaElement.buffered')
@DocsEditable
- final String attributeName;
+ final TimeRanges buffered;
- @DomName('MutationRecord.attributeNamespace')
+ @DomName('HTMLMediaElement.controller')
@DocsEditable
- final String attributeNamespace;
+ MediaController controller;
- @DomName('MutationRecord.nextSibling')
+ @DomName('HTMLMediaElement.controls')
@DocsEditable
- final Node nextSibling;
+ bool controls;
- @DomName('MutationRecord.oldValue')
+ @DomName('HTMLMediaElement.currentSrc')
@DocsEditable
- final String oldValue;
+ final String currentSrc;
- @DomName('MutationRecord.previousSibling')
+ @DomName('HTMLMediaElement.currentTime')
@DocsEditable
- final Node previousSibling;
+ num currentTime;
- @DomName('MutationRecord.removedNodes')
+ @DomName('HTMLMediaElement.defaultMuted')
@DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- final List<Node> removedNodes;
+ bool defaultMuted;
- @DomName('MutationRecord.target')
+ @DomName('HTMLMediaElement.defaultPlaybackRate')
@DocsEditable
- final Node target;
+ num defaultPlaybackRate;
- @DomName('MutationRecord.type')
+ @DomName('HTMLMediaElement.duration')
@DocsEditable
- final String type;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DomName('Navigator')
-class Navigator native "*Navigator" {
-
- @DomName('Navigator.language')
- String get language => JS('String', '#.language || #.userLanguage', this,
- this);
+ final num duration;
- /**
- * Gets a stream (video and or audio) from the local computer.
- *
- * Use [MediaStream.supported] to check if this is supported by the current
- * platform.
- *
- * Example use:
- *
- * window.navigator.getUserMedia(audio:true, video: true).then((stream) {
- * var video = new VideoElement()
- * ..autoplay = true
- * ..src = Url.createObjectUrl(stream);
- * document.body.append(video);
- * });
- *
- * See also:
- * * [MediaStream.supported]
- */
- @DomName('Navigator.webkitGetUserMedia')
- @SupportedBrowser(SupportedBrowser.CHROME)
- @Experimental
- Future<LocalMediaStream> getUserMedia({bool audio: false,
- bool video: false}) {
- var completer = new Completer<LocalMediaStream>();
- var options = {
- 'audio': audio,
- 'video': video
- };
- _ensureGetUserMedia();
- this._getUserMedia(convertDartToNative_Dictionary(options),
- (stream) {
- completer.complete(stream);
- },
- (error) {
- completer.completeError(error);
- });
- return completer.future;
- }
+ @DomName('HTMLMediaElement.ended')
+ @DocsEditable
+ final bool ended;
- _ensureGetUserMedia() {
- if (JS('bool', '!(#.getUserMedia)', this)) {
- JS('void', '#.getUserMedia = '
- '(#.getUserMedia || #.webkitGetUserMedia || #.mozGetUserMedia ||'
- '#.msGetUserMedia)', this, this, this, this, this);
- }
- }
+ @DomName('HTMLMediaElement.error')
+ @DocsEditable
+ final MediaError error;
- @JSName('getUserMedia')
- void _getUserMedia(options, _NavigatorUserMediaSuccessCallback success,
- _NavigatorUserMediaErrorCallback error) native;
+ @DomName('HTMLMediaElement.initialTime')
+ @DocsEditable
+ final num initialTime;
+ @DomName('HTMLMediaElement.loop')
+ @DocsEditable
+ bool loop;
- @DomName('Navigator.appCodeName')
+ @DomName('HTMLMediaElement.mediaGroup')
@DocsEditable
- final String appCodeName;
+ String mediaGroup;
- @DomName('Navigator.appName')
+ @DomName('HTMLMediaElement.muted')
@DocsEditable
- final String appName;
+ bool muted;
- @DomName('Navigator.appVersion')
+ @DomName('HTMLMediaElement.networkState')
@DocsEditable
- final String appVersion;
+ final int networkState;
- @DomName('Navigator.cookieEnabled')
+ @DomName('HTMLMediaElement.paused')
@DocsEditable
- final bool cookieEnabled;
+ final bool paused;
- @DomName('Navigator.geolocation')
+ @DomName('HTMLMediaElement.playbackRate')
@DocsEditable
- final Geolocation geolocation;
+ num playbackRate;
- @DomName('Navigator.mimeTypes')
+ @DomName('HTMLMediaElement.played')
@DocsEditable
- final DomMimeTypeArray mimeTypes;
+ final TimeRanges played;
- @DomName('Navigator.onLine')
+ @DomName('HTMLMediaElement.preload')
@DocsEditable
- final bool onLine;
+ String preload;
- @DomName('Navigator.platform')
+ @DomName('HTMLMediaElement.readyState')
@DocsEditable
- final String platform;
+ final int readyState;
- @DomName('Navigator.plugins')
+ @DomName('HTMLMediaElement.seekable')
@DocsEditable
- final DomPluginArray plugins;
+ final TimeRanges seekable;
- @DomName('Navigator.product')
+ @DomName('HTMLMediaElement.seeking')
@DocsEditable
- final String product;
+ final bool seeking;
- @DomName('Navigator.productSub')
+ @DomName('HTMLMediaElement.src')
@DocsEditable
- final String productSub;
+ String src;
- @DomName('Navigator.userAgent')
+ @DomName('HTMLMediaElement.startTime')
@DocsEditable
- final String userAgent;
+ final num startTime;
- @DomName('Navigator.vendor')
+ @DomName('HTMLMediaElement.textTracks')
@DocsEditable
- final String vendor;
+ final TextTrackList textTracks;
- @DomName('Navigator.vendorSub')
+ @DomName('HTMLMediaElement.volume')
@DocsEditable
- final String vendorSub;
+ num volume;
- @JSName('webkitBattery')
- @DomName('Navigator.webkitBattery')
+ @JSName('webkitAudioDecodedByteCount')
+ @DomName('HTMLMediaElement.webkitAudioDecodedByteCount')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
- final BatteryManager battery;
+ final int audioDecodedByteCount;
- @DomName('Navigator.getStorageUpdates')
+ @JSName('webkitClosedCaptionsVisible')
+ @DomName('HTMLMediaElement.webkitClosedCaptionsVisible')
@DocsEditable
- void getStorageUpdates() native;
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ bool closedCaptionsVisible;
- @DomName('Navigator.javaEnabled')
+ @JSName('webkitHasClosedCaptions')
+ @DomName('HTMLMediaElement.webkitHasClosedCaptions')
@DocsEditable
- bool javaEnabled() native;
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ final bool hasClosedCaptions;
- @JSName('webkitGetGamepads')
- @DomName('Navigator.webkitGetGamepads')
+ @JSName('webkitPreservesPitch')
+ @DomName('HTMLMediaElement.webkitPreservesPitch')
@DocsEditable
@SupportedBrowser(SupportedBrowser.CHROME)
@SupportedBrowser(SupportedBrowser.SAFARI)
@Experimental
- @Returns('_GamepadList')
- @Creates('_GamepadList')
- List<Gamepad> getGamepads() native;
-
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('NavigatorUserMediaError')
-class NavigatorUserMediaError native "*NavigatorUserMediaError" {
-
- static const int PERMISSION_DENIED = 1;
+ bool preservesPitch;
- @DomName('NavigatorUserMediaError.code')
+ @JSName('webkitVideoDecodedByteCount')
+ @DomName('HTMLMediaElement.webkitVideoDecodedByteCount')
@DocsEditable
- final int code;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-typedef void _NavigatorUserMediaErrorCallback(NavigatorUserMediaError error);
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
-
-
-typedef void _NavigatorUserMediaSuccessCallback(LocalMediaStream stream);
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-/**
- * Lazy implementation of the child nodes of an element that does not request
- * the actual child nodes of an element until strictly necessary greatly
- * improving performance for the typical cases where it is not required.
- */
-class _ChildNodeListLazy implements List {
- final Node _this;
-
- _ChildNodeListLazy(this._this);
-
-
- Node get first {
- Node result = JS('Node|Null', '#.firstChild', _this);
- if (result == null) throw new StateError("No elements");
- return result;
- }
- Node get last {
- Node result = JS('Node|Null', '#.lastChild', _this);
- if (result == null) throw new StateError("No elements");
- return result;
- }
- Node get single {
- int l = this.length;
- if (l == 0) throw new StateError("No elements");
- if (l > 1) throw new StateError("More than one element");
- return JS('Node|Null', '#.firstChild', _this);
- }
-
- Node min([int compare(Node a, Node b)]) {
- return IterableMixinWorkaround.min(this, compare);
- }
-
- Node max([int compare(Node a, Node b)]) {
- return IterableMixinWorkaround.max(this, compare);
- }
-
- void add(Node value) {
- _this.append(value);
- }
-
- void addLast(Node value) {
- _this.append(value);
- }
-
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ final int videoDecodedByteCount;
- void addAll(Iterable<Node> iterable) {
- if (iterable is _ChildNodeListLazy) {
- if (!identical(iterable._this, _this)) {
- // Optimized route for copying between nodes.
- for (var i = 0, len = iterable.length; i < len; ++i) {
- // Should use $dom_firstChild, Bug 8886.
- _this.append(iterable[0]);
- }
- }
- return;
- }
- for (Node node in iterable) {
- _this.append(node);
- }
- }
+ @DomName('HTMLMediaElement.addTextTrack')
+ @DocsEditable
+ TextTrack addTextTrack(String kind, [String label, String language]) native;
- Node removeLast() {
- final result = last;
- if (result != null) {
- _this.$dom_removeChild(result);
- }
- return result;
- }
+ @DomName('HTMLMediaElement.canPlayType')
+ @DocsEditable
+ String canPlayType(String type, String keySystem) native;
- Node removeAt(int index) {
- var result = this[index];
- if (result != null) {
- _this.$dom_removeChild(result);
- }
- return result;
- }
+ @DomName('HTMLMediaElement.load')
+ @DocsEditable
+ void load() native;
- void remove(Object object) {
- if (object is! Node) return;
- Node node = object;
- if (!identical(_this, node.parentNode)) return;
- _this.$dom_removeChild(node);
- }
+ @DomName('HTMLMediaElement.pause')
+ @DocsEditable
+ void pause() native;
- void removeAll(Iterable elements) {
- IterableMixinWorkaround.removeAll(this, elements);
- }
+ @DomName('HTMLMediaElement.play')
+ @DocsEditable
+ void play() native;
- void retainAll(Iterable elements) {
- IterableMixinWorkaround.retainAll(this, elements);
- }
+ @JSName('webkitAddKey')
+ @DomName('HTMLMediaElement.webkitAddKey')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ void addKey(String keySystem, Uint8List key, [Uint8List initData, String sessionId]) native;
- void removeWhere(bool test(Node node)) {
- IterableMixinWorkaround.removeWhere(this, test);
- }
+ @JSName('webkitCancelKeyRequest')
+ @DomName('HTMLMediaElement.webkitCancelKeyRequest')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ void cancelKeyRequest(String keySystem, String sessionId) native;
- void retainWhere(bool test(Node node)) {
- IterableMixinWorkaround.retainWhere(this, test);
- }
+ @JSName('webkitGenerateKeyRequest')
+ @DomName('HTMLMediaElement.webkitGenerateKeyRequest')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ void generateKeyRequest(String keySystem, [Uint8List initData]) native;
- void clear() {
- _this.text = '';
- }
+ @DomName('HTMLMediaElement.oncanplay')
+ @DocsEditable
+ Stream<Event> get onCanPlay => canPlayEvent.forTarget(this);
- void operator []=(int index, Node value) {
- _this.$dom_replaceChild(value, this[index]);
- }
+ @DomName('HTMLMediaElement.oncanplaythrough')
+ @DocsEditable
+ Stream<Event> get onCanPlayThrough => canPlayThroughEvent.forTarget(this);
- Iterator<Node> get iterator => _this.$dom_childNodes.iterator;
+ @DomName('HTMLMediaElement.ondurationchange')
+ @DocsEditable
+ Stream<Event> get onDurationChange => durationChangeEvent.forTarget(this);
- // TODO(jacobr): We can implement these methods much more efficiently by
- // looking up the nodeList only once instead of once per iteration.
- bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
+ @DomName('HTMLMediaElement.onemptied')
+ @DocsEditable
+ Stream<Event> get onEmptied => emptiedEvent.forTarget(this);
- void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
+ @DomName('HTMLMediaElement.onended')
+ @DocsEditable
+ Stream<Event> get onEnded => endedEvent.forTarget(this);
- dynamic reduce(dynamic initialValue,
- dynamic combine(dynamic previousValue, Node element)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
+ @DomName('HTMLMediaElement.onloadeddata')
+ @DocsEditable
+ Stream<Event> get onLoadedData => loadedDataEvent.forTarget(this);
- String join([String separator]) {
- return IterableMixinWorkaround.joinList(this, separator);
- }
+ @DomName('HTMLMediaElement.onloadedmetadata')
+ @DocsEditable
+ Stream<Event> get onLoadedMetadata => loadedMetadataEvent.forTarget(this);
- Iterable map(f(Node element)) {
- return IterableMixinWorkaround.mapList(this, f);
- }
+ @DomName('HTMLMediaElement.onloadstart')
+ @DocsEditable
+ Stream<Event> get onLoadStart => loadStartEvent.forTarget(this);
- Iterable<Node> where(bool f(Node element)) {
- return IterableMixinWorkaround.where(this, f);
- }
+ @DomName('HTMLMediaElement.onpause')
+ @DocsEditable
+ Stream<Event> get onPause => pauseEvent.forTarget(this);
- Iterable expand(Iterable f(Node element)) {
- return IterableMixinWorkaround.expand(this, f);
- }
+ @DomName('HTMLMediaElement.onplay')
+ @DocsEditable
+ Stream<Event> get onPlay => playEvent.forTarget(this);
- bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
+ @DomName('HTMLMediaElement.onplaying')
+ @DocsEditable
+ Stream<Event> get onPlaying => playingEvent.forTarget(this);
- bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
+ @DomName('HTMLMediaElement.onprogress')
+ @DocsEditable
+ Stream<Event> get onProgress => progressEvent.forTarget(this);
- List<Node> toList({ bool growable: true }) =>
- new List<Node>.from(this, growable: growable);
- Set<Node> toSet() => new Set<Node>.from(this);
+ @DomName('HTMLMediaElement.onratechange')
+ @DocsEditable
+ Stream<Event> get onRateChange => rateChangeEvent.forTarget(this);
- bool get isEmpty => this.length == 0;
+ @DomName('HTMLMediaElement.onseeked')
+ @DocsEditable
+ Stream<Event> get onSeeked => seekedEvent.forTarget(this);
- // From List<Node>:
+ @DomName('HTMLMediaElement.onseeking')
+ @DocsEditable
+ Stream<Event> get onSeeking => seekingEvent.forTarget(this);
- Iterable<Node> take(int n) {
- return IterableMixinWorkaround.takeList(this, n);
- }
+ @DomName('HTMLMediaElement.onshow')
+ @DocsEditable
+ Stream<Event> get onShow => showEvent.forTarget(this);
- Iterable<Node> takeWhile(bool test(Node value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
+ @DomName('HTMLMediaElement.onstalled')
+ @DocsEditable
+ Stream<Event> get onStalled => stalledEvent.forTarget(this);
- Iterable<Node> skip(int n) {
- return IterableMixinWorkaround.skipList(this, n);
- }
+ @DomName('HTMLMediaElement.onsuspend')
+ @DocsEditable
+ Stream<Event> get onSuspend => suspendEvent.forTarget(this);
- Iterable<Node> skipWhile(bool test(Node value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
+ @DomName('HTMLMediaElement.ontimeupdate')
+ @DocsEditable
+ Stream<Event> get onTimeUpdate => timeUpdateEvent.forTarget(this);
- Node firstWhere(bool test(Node value), {Node orElse()}) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
+ @DomName('HTMLMediaElement.onvolumechange')
+ @DocsEditable
+ Stream<Event> get onVolumeChange => volumeChangeEvent.forTarget(this);
- Node lastWhere(bool test(Node value), {Node orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
+ @DomName('HTMLMediaElement.onwaiting')
+ @DocsEditable
+ Stream<Event> get onWaiting => waitingEvent.forTarget(this);
- Node singleWhere(bool test(Node value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
+ @DomName('HTMLMediaElement.onwebkitkeyadded')
+ @DocsEditable
+ Stream<MediaKeyEvent> get onKeyAdded => keyAddedEvent.forTarget(this);
- Node elementAt(int index) {
- return this[index];
- }
+ @DomName('HTMLMediaElement.onwebkitkeyerror')
+ @DocsEditable
+ Stream<MediaKeyEvent> get onKeyError => keyErrorEvent.forTarget(this);
- Iterable<Node> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
+ @DomName('HTMLMediaElement.onwebkitkeymessage')
+ @DocsEditable
+ Stream<MediaKeyEvent> get onKeyMessage => keyMessageEvent.forTarget(this);
- // TODO(jacobr): this could be implemented for child node lists.
- // The exception we throw here is misleading.
- void sort([int compare(Node a, Node b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
+ @DomName('HTMLMediaElement.onwebkitneedkey')
+ @DocsEditable
+ Stream<MediaKeyEvent> get onNeedKey => needKeyEvent.forTarget(this);
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- int indexOf(Node element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
- int lastIndexOf(Node element, [int start = 0]) =>
- Lists.lastIndexOf(this, element, start);
+@DocsEditable
+@DomName('MediaError')
+class MediaError native "*MediaError" {
- // FIXME: implement these.
- void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
- throw new UnsupportedError(
- "Cannot setRange on immutable List.");
- }
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError(
- "Cannot removeRange on immutable List.");
- }
- void insertRange(int start, int rangeLength, [Node initialValue]) {
- throw new UnsupportedError(
- "Cannot insertRange on immutable List.");
- }
- List<Node> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <Node>[]);
+ static const int MEDIA_ERR_ABORTED = 1;
- // -- end List<Node> mixins.
+ static const int MEDIA_ERR_DECODE = 3;
- // TODO(jacobr): benchmark whether this is more efficient or whether caching
- // a local copy of $dom_childNodes is more efficient.
- int get length => _this.$dom_childNodes.length;
+ static const int MEDIA_ERR_ENCRYPTED = 5;
- void set length(int value) {
- throw new UnsupportedError(
- "Cannot set length on immutable List.");
- }
+ static const int MEDIA_ERR_NETWORK = 2;
- Node operator[](int index) => _this.$dom_childNodes[index];
+ static const int MEDIA_ERR_SRC_NOT_SUPPORTED = 4;
- Map<int, Node> asMap() => IterableMixinWorkaround.asMapList(this);
+ @DomName('MediaError.code')
+ @DocsEditable
+ final int code;
}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
-@DomName('Node')
-class Node extends EventTarget native "*Node" {
- List<Node> get nodes {
- return new _ChildNodeListLazy(this);
- }
- void set nodes(Collection<Node> value) {
- // Copy list first since we don't want liveness during iteration.
- // TODO(jacobr): there is a better way to do this.
- List copy = new List.from(value);
- text = '';
- for (Node node in copy) {
- append(node);
- }
- }
+@DocsEditable
+@DomName('MediaKeyError')
+class MediaKeyError native "*MediaKeyError" {
- /**
- * Removes this node from the DOM.
- */
- @DomName('Node.removeChild')
- void remove() {
- // TODO(jacobr): should we throw an exception if parent is already null?
- // TODO(vsm): Use the native remove when available.
- if (this.parentNode != null) {
- final Node parent = this.parentNode;
- parentNode.$dom_removeChild(this);
- }
- }
+ static const int MEDIA_KEYERR_CLIENT = 2;
- /**
- * Replaces this node with another node.
- */
- @DomName('Node.replaceChild')
- Node replaceWith(Node otherNode) {
- try {
- final Node parent = this.parentNode;
- parent.$dom_replaceChild(otherNode, this);
- } catch (e) {
+ static const int MEDIA_KEYERR_DOMAIN = 6;
- };
- return this;
- }
+ static const int MEDIA_KEYERR_HARDWARECHANGE = 5;
- /**
- * Inserts all of the nodes into this node directly before refChild.
- *
- * See also:
- *
- * * [insertBefore]
- */
- Node insertAllBefore(Iterable<Node> newNodes, Node refChild) {
- if (newNodes is _ChildNodeListLazy) {
- if (identical(newNodes._this, this)) {
- throw new ArgumentError(newNodes);
- }
+ static const int MEDIA_KEYERR_OUTPUT = 4;
- // Optimized route for copying between nodes.
- for (var i = 0, len = newNodes.length; i < len; ++i) {
- // Should use $dom_firstChild, Bug 8886.
- this.insertBefore(newNodes[0], refChild);
- }
- } else {
- for (var node in newNodes) {
- this.insertBefore(node, refChild);
- }
- }
- }
+ static const int MEDIA_KEYERR_SERVICE = 3;
+ static const int MEDIA_KEYERR_UNKNOWN = 1;
- @JSName('childNodes')
- @DomName('Node.childNodes')
+ @DomName('MediaKeyError.code')
@DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- final List<Node> $dom_childNodes;
+ final int code;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
- @JSName('firstChild')
- @DomName('Node.firstChild')
- @DocsEditable
- final Node $dom_firstChild;
+@DocsEditable
+@DomName('MediaKeyEvent')
+class MediaKeyEvent extends Event native "*MediaKeyEvent" {
- @JSName('lastChild')
- @DomName('Node.lastChild')
+ @JSName('defaultURL')
+ @DomName('MediaKeyEvent.defaultURL')
@DocsEditable
- final Node $dom_lastChild;
+ final String defaultUrl;
- @JSName('localName')
- @DomName('Node.localName')
+ @DomName('MediaKeyEvent.errorCode')
@DocsEditable
- final String $dom_localName;
+ final MediaKeyError errorCode;
- @JSName('namespaceURI')
- @DomName('Node.namespaceURI')
+ @DomName('MediaKeyEvent.initData')
@DocsEditable
- final String $dom_namespaceUri;
+ @Returns('Uint8List')
+ @Creates('Uint8List')
+ final List<int> initData;
- @JSName('nextSibling')
- @DomName('Node.nextSibling')
+ @DomName('MediaKeyEvent.keySystem')
@DocsEditable
- final Node nextNode;
+ final String keySystem;
- @DomName('Node.nodeType')
+ @DomName('MediaKeyEvent.message')
@DocsEditable
- final int nodeType;
+ @Returns('Uint8List')
+ @Creates('Uint8List')
+ final List<int> message;
- @DomName('Node.nodeValue')
+ @DomName('MediaKeyEvent.sessionId')
@DocsEditable
- final String nodeValue;
+ final String sessionId;
- @JSName('ownerDocument')
- @DomName('Node.ownerDocument')
+ @DomName('MediaKeyEvent.systemCode')
@DocsEditable
- final Document document;
+ final int systemCode;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @JSName('parentElement')
- @DomName('Node.parentElement')
- @DocsEditable
- final Element parent;
- @DomName('Node.parentNode')
- @DocsEditable
- final Node parentNode;
+@DocsEditable
+@DomName('MediaList')
+class MediaList native "*MediaList" {
- @JSName('previousSibling')
- @DomName('Node.previousSibling')
+ @DomName('MediaList.length')
@DocsEditable
- final Node previousNode;
+ final int length;
- @JSName('textContent')
- @DomName('Node.textContent')
+ @DomName('MediaList.mediaText')
@DocsEditable
- String text;
+ String mediaText;
- @JSName('addEventListener')
- @DomName('Node.addEventListener')
+ @DomName('MediaList.appendMedium')
@DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+ void appendMedium(String newMedium) native;
- @JSName('appendChild')
- @DomName('Node.appendChild')
+ @DomName('MediaList.deleteMedium')
@DocsEditable
- Node append(Node newChild) native;
+ void deleteMedium(String oldMedium) native;
- @JSName('cloneNode')
- @DomName('Node.cloneNode')
+ @DomName('MediaList.item')
@DocsEditable
- Node clone(bool deep) native;
+ String item(int index) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('Node.contains')
- @DocsEditable
- bool contains(Node other) native;
- @DomName('Node.dispatchEvent')
- @DocsEditable
- bool dispatchEvent(Event event) native;
+@DocsEditable
+@DomName('MediaQueryList')
+class MediaQueryList native "*MediaQueryList" {
- @DomName('Node.hasChildNodes')
+ @DomName('MediaQueryList.matches')
@DocsEditable
- bool hasChildNodes() native;
+ final bool matches;
- @DomName('Node.insertBefore')
+ @DomName('MediaQueryList.media')
@DocsEditable
- Node insertBefore(Node newChild, Node refChild) native;
+ final String media;
- @JSName('removeChild')
- @DomName('Node.removeChild')
+ @DomName('MediaQueryList.addListener')
@DocsEditable
- Node $dom_removeChild(Node oldChild) native;
+ void addListener(MediaQueryListListener listener) native;
- @JSName('removeEventListener')
- @DomName('Node.removeEventListener')
+ @DomName('MediaQueryList.removeListener')
@DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ void removeListener(MediaQueryListListener listener) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @JSName('replaceChild')
- @DomName('Node.replaceChild')
- @DocsEditable
- Node $dom_replaceChild(Node newChild, Node oldChild) native;
+@DomName('MediaQueryListListener')
+abstract class MediaQueryListListener {
+
+ void queryChanged(MediaQueryList list);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -17725,89 +14883,171 @@ class Node extends EventTarget native "*Node" {
@DocsEditable
-@DomName('NodeFilter')
-class NodeFilter native "*NodeFilter" {
+@DomName('MediaSource')
+class MediaSource extends EventTarget native "*MediaSource" {
- static const int FILTER_ACCEPT = 1;
+ @DomName('MediaSource.MediaSource')
+ @DocsEditable
+ factory MediaSource() {
+ return MediaSource._create_1();
+ }
+ static MediaSource _create_1() => JS('MediaSource', 'new MediaSource()');
- static const int FILTER_REJECT = 2;
+ @DomName('MediaSource.activeSourceBuffers')
+ @DocsEditable
+ final SourceBufferList activeSourceBuffers;
- static const int FILTER_SKIP = 3;
+ @DomName('MediaSource.duration')
+ @DocsEditable
+ num duration;
- static const int SHOW_ALL = 0xFFFFFFFF;
+ @DomName('MediaSource.readyState')
+ @DocsEditable
+ final String readyState;
- static const int SHOW_ATTRIBUTE = 0x00000002;
+ @DomName('MediaSource.sourceBuffers')
+ @DocsEditable
+ final SourceBufferList sourceBuffers;
- static const int SHOW_CDATA_SECTION = 0x00000008;
+ @JSName('addEventListener')
+ @DomName('MediaSource.addEventListener')
+ @DocsEditable
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- static const int SHOW_COMMENT = 0x00000080;
+ @DomName('MediaSource.addSourceBuffer')
+ @DocsEditable
+ SourceBuffer addSourceBuffer(String type) native;
- static const int SHOW_DOCUMENT = 0x00000100;
+ @DomName('MediaSource.dispatchEvent')
+ @DocsEditable
+ bool dispatchEvent(Event event) native;
- static const int SHOW_DOCUMENT_FRAGMENT = 0x00000400;
+ @DomName('MediaSource.endOfStream')
+ @DocsEditable
+ void endOfStream(String error) native;
- static const int SHOW_DOCUMENT_TYPE = 0x00000200;
+ @JSName('removeEventListener')
+ @DomName('MediaSource.removeEventListener')
+ @DocsEditable
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
- static const int SHOW_ELEMENT = 0x00000001;
+ @DomName('MediaSource.removeSourceBuffer')
+ @DocsEditable
+ void removeSourceBuffer(SourceBuffer buffer) native;
+}
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- static const int SHOW_ENTITY = 0x00000020;
- static const int SHOW_ENTITY_REFERENCE = 0x00000010;
+@DomName('MediaStream')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@Experimental
+class MediaStream extends EventTarget native "*MediaStream" {
- static const int SHOW_NOTATION = 0x00000800;
+ @DomName('MediaStream.addtrackEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> addTrackEvent = const EventStreamProvider<Event>('addtrack');
- static const int SHOW_PROCESSING_INSTRUCTION = 0x00000040;
+ @DomName('MediaStream.endedEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
- static const int SHOW_TEXT = 0x00000004;
+ @DomName('MediaStream.removetrackEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> removeTrackEvent = const EventStreamProvider<Event>('removetrack');
- @DomName('NodeFilter.acceptNode')
+ @DomName('MediaStream.MediaStream')
@DocsEditable
- int acceptNode(Node n) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ factory MediaStream([stream_OR_tracks]) {
+ if (!?stream_OR_tracks) {
+ return MediaStream._create_1();
+ }
+ if ((stream_OR_tracks is MediaStream || stream_OR_tracks == null)) {
+ return MediaStream._create_2(stream_OR_tracks);
+ }
+ if ((stream_OR_tracks is List<MediaStreamTrack> || stream_OR_tracks == null)) {
+ return MediaStream._create_3(stream_OR_tracks);
+ }
+ throw new ArgumentError("Incorrect number or type of arguments");
+ }
+ static MediaStream _create_1() => JS('MediaStream', 'new MediaStream()');
+ static MediaStream _create_2(stream_OR_tracks) => JS('MediaStream', 'new MediaStream(#)', stream_OR_tracks);
+ static MediaStream _create_3(stream_OR_tracks) => JS('MediaStream', 'new MediaStream(#)', stream_OR_tracks);
+ @DomName('MediaStream.ended')
+ @DocsEditable
+ final bool ended;
-@DocsEditable
-@DomName('NodeIterator')
-class NodeIterator native "*NodeIterator" {
+ @DomName('MediaStream.id')
+ @DocsEditable
+ final String id;
- @DomName('NodeIterator.expandEntityReferences')
+ @DomName('MediaStream.label')
@DocsEditable
- final bool expandEntityReferences;
+ final String label;
- @DomName('NodeIterator.filter')
+ @JSName('addEventListener')
+ @DomName('MediaStream.addEventListener')
@DocsEditable
- final NodeFilter filter;
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('NodeIterator.pointerBeforeReferenceNode')
+ @DomName('MediaStream.addTrack')
@DocsEditable
- final bool pointerBeforeReferenceNode;
+ void addTrack(MediaStreamTrack track) native;
- @DomName('NodeIterator.referenceNode')
+ @DomName('MediaStream.dispatchEvent')
+ @DocsEditable
+ bool dispatchEvent(Event event) native;
+
+ @DomName('MediaStream.getAudioTracks')
+ @DocsEditable
+ List<MediaStreamTrack> getAudioTracks() native;
+
+ @DomName('MediaStream.getTrackById')
+ @DocsEditable
+ MediaStreamTrack getTrackById(String trackId) native;
+
+ @DomName('MediaStream.getVideoTracks')
@DocsEditable
- final Node referenceNode;
+ List<MediaStreamTrack> getVideoTracks() native;
- @DomName('NodeIterator.root')
+ @JSName('removeEventListener')
+ @DomName('MediaStream.removeEventListener')
@DocsEditable
- final Node root;
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('NodeIterator.whatToShow')
+ @DomName('MediaStream.removeTrack')
@DocsEditable
- final int whatToShow;
+ void removeTrack(MediaStreamTrack track) native;
- @DomName('NodeIterator.detach')
+ @DomName('MediaStream.onaddtrack')
@DocsEditable
- void detach() native;
+ Stream<Event> get onAddTrack => addTrackEvent.forTarget(this);
- @DomName('NodeIterator.nextNode')
+ @DomName('MediaStream.onended')
@DocsEditable
- Node nextNode() native;
+ Stream<Event> get onEnded => endedEvent.forTarget(this);
- @DomName('NodeIterator.previousNode')
+ @DomName('MediaStream.onremovetrack')
@DocsEditable
- Node previousNode() native;
+ Stream<Event> get onRemoveTrack => removeTrackEvent.forTarget(this);
+
+
+ /**
+ * Checks if the MediaStream APIs are supported on the current platform.
+ *
+ * See also:
+ *
+ * * [Navigator.getUserMedia]
+ */
+ static bool get supported =>
+ JS('bool', '''!!(#.getUserMedia || #.webkitGetUserMedia ||
+ #.mozGetUserMedia || #.msGetUserMedia)''',
+ window.navigator,
+ window.navigator,
+ window.navigator,
+ window.navigator);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -17815,202 +15055,229 @@ class NodeIterator native "*NodeIterator" {
@DocsEditable
-@DomName('NodeList')
-class NodeList implements JavaScriptIndexingBehavior, List<Node> native "*NodeList" {
-
- @DomName('NodeList.length')
- @DocsEditable
- int get length => JS("int", "#.length", this);
-
- Node operator[](int index) => JS("Node", "#[#]", this, index);
-
- void operator[]=(int index, Node value) {
- throw new UnsupportedError("Cannot assign element of immutable List.");
- }
- // -- start List<Node> mixins.
- // Node is the element type.
-
- // From Iterable<Node>:
-
- Iterator<Node> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<Node>(this);
- }
-
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Node)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
-
- bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
-
- void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
-
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
-
- Iterable map(f(Node element)) =>
- IterableMixinWorkaround.mapList(this, f);
+@DomName('MediaStreamEvent')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@Experimental
+class MediaStreamEvent extends Event native "*MediaStreamEvent" {
- Iterable<Node> where(bool f(Node element)) =>
- IterableMixinWorkaround.where(this, f);
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => Device.isEventTypeSupported('MediaStreamEvent');
- Iterable expand(Iterable f(Node element)) =>
- IterableMixinWorkaround.expand(this, f);
+ @DomName('MediaStreamEvent.stream')
+ @DocsEditable
+ final MediaStream stream;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
- bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
+@DocsEditable
+@DomName('MediaStreamTrack')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@Experimental
+class MediaStreamTrack extends EventTarget native "*MediaStreamTrack" {
- List<Node> toList({ bool growable: true }) =>
- new List<Node>.from(this, growable: growable);
+ @DomName('MediaStreamTrack.endedEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> endedEvent = const EventStreamProvider<Event>('ended');
- Set<Node> toSet() => new Set<Node>.from(this);
+ @DomName('MediaStreamTrack.muteEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> muteEvent = const EventStreamProvider<Event>('mute');
- bool get isEmpty => this.length == 0;
+ @DomName('MediaStreamTrack.unmuteEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> unmuteEvent = const EventStreamProvider<Event>('unmute');
- Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
+ @DomName('MediaStreamTrack.enabled')
+ @DocsEditable
+ bool enabled;
- Iterable<Node> takeWhile(bool test(Node value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
+ @DomName('MediaStreamTrack.id')
+ @DocsEditable
+ final String id;
- Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+ @DomName('MediaStreamTrack.kind')
+ @DocsEditable
+ final String kind;
- Iterable<Node> skipWhile(bool test(Node value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
+ @DomName('MediaStreamTrack.label')
+ @DocsEditable
+ final String label;
- Node firstWhere(bool test(Node value), { Node orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
+ @DomName('MediaStreamTrack.readyState')
+ @DocsEditable
+ final String readyState;
- Node lastWhere(bool test(Node value), {Node orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
+ @JSName('addEventListener')
+ @DomName('MediaStreamTrack.addEventListener')
+ @DocsEditable
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- Node singleWhere(bool test(Node value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
+ @DomName('MediaStreamTrack.dispatchEvent')
+ @DocsEditable
+ bool dispatchEvent(Event event) native;
- Node elementAt(int index) {
- return this[index];
- }
+ @JSName('removeEventListener')
+ @DomName('MediaStreamTrack.removeEventListener')
+ @DocsEditable
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
- // From Collection<Node>:
+ @DomName('MediaStreamTrack.onended')
+ @DocsEditable
+ Stream<Event> get onEnded => endedEvent.forTarget(this);
- void add(Node value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('MediaStreamTrack.onmute')
+ @DocsEditable
+ Stream<Event> get onMute => muteEvent.forTarget(this);
- void addLast(Node value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('MediaStreamTrack.onunmute')
+ @DocsEditable
+ Stream<Event> get onUnmute => unmuteEvent.forTarget(this);
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void addAll(Iterable<Node> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
- // From List<Node>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
+@DocsEditable
+@DomName('MediaStreamTrackEvent')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@Experimental
+class MediaStreamTrackEvent extends Event native "*MediaStreamTrackEvent" {
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => Device.isEventTypeSupported('MediaStreamTrackEvent');
- Iterable<Node> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
+ @DomName('MediaStreamTrackEvent.track')
+ @DocsEditable
+ final MediaStreamTrack track;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void sort([int compare(Node a, Node b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
- int indexOf(Node element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
+@DocsEditable
+@DomName('MemoryInfo')
+class MemoryInfo native "*MemoryInfo" {
- int lastIndexOf(Node element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
+ @DomName('MemoryInfo.jsHeapSizeLimit')
+ @DocsEditable
+ final int jsHeapSizeLimit;
- Node get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
+ @DomName('MemoryInfo.totalJSHeapSize')
+ @DocsEditable
+ final int totalJSHeapSize;
- Node get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
+ @DomName('MemoryInfo.usedJSHeapSize')
+ @DocsEditable
+ final int usedJSHeapSize;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- Node get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
- Node min([int compare(Node a, Node b)]) =>
- IterableMixinWorkaround.min(this, compare);
+@DocsEditable
+/**
+ * An HTML <menu> element.
+ *
+ * A <menu> element represents an unordered list of menu commands.
+ *
+ * See also:
+ *
+ * * [Menu Element](https://developer.mozilla.org/en-US/docs/HTML/Element/menu) from MDN.
+ * * [Menu Element](http://www.w3.org/TR/html5/the-menu-element.html#the-menu-element) from the W3C.
+ */
+@DomName('HTMLMenuElement')
+class MenuElement extends Element native "*HTMLMenuElement" {
- Node max([int compare(Node a, Node b)]) =>
- IterableMixinWorkaround.max(this, compare);
+ @DomName('HTMLMenuElement.HTMLMenuElement')
+ @DocsEditable
+ factory MenuElement() => document.$dom_createElement("menu");
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- Node removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
- Node removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+@DocsEditable
+@DomName('MessageChannel')
+class MessageChannel native "*MessageChannel" {
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
+ @DomName('MessageChannel.MessageChannel')
+ @DocsEditable
+ factory MessageChannel() {
+ return MessageChannel._create_1();
}
+ static MessageChannel _create_1() => JS('MessageChannel', 'new MessageChannel()');
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('MessageChannel.port1')
+ @DocsEditable
+ final MessagePort port1;
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('MessageChannel.port2')
+ @DocsEditable
+ final MessagePort port2;
+}
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void removeWhere(bool test(Node element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+// WARNING: Do not edit - generated code.
- void retainWhere(bool test(Node element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
- void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
+@DomName('MessageEvent')
+class MessageEvent extends Event native "*MessageEvent" {
+ factory MessageEvent(String type,
+ {bool canBubble: false, bool cancelable: false, Object data,
+ String origin, String lastEventId,
+ Window source, List messagePorts}) {
+ if (source == null) {
+ source = window;
+ }
+ var event = document.$dom_createEvent("MessageEvent");
+ event.$dom_initMessageEvent(type, canBubble, cancelable, data, origin,
+ lastEventId, source, messagePorts);
+ return event;
}
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
+ dynamic get data => convertNativeToDart_SerializedScriptValue(this._get_data);
+ @JSName('data')
+ @DomName('MessageEvent.data')
+ @DocsEditable
+ @annotation_Creates_SerializedScriptValue
+ @annotation_Returns_SerializedScriptValue
+ final dynamic _get_data;
- void insertRange(int start, int rangeLength, [Node initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
+ @DomName('MessageEvent.lastEventId')
+ @DocsEditable
+ final String lastEventId;
- List<Node> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <Node>[]);
+ @DomName('MessageEvent.origin')
+ @DocsEditable
+ final String origin;
- Map<int, Node> asMap() =>
- IterableMixinWorkaround.asMapList(this);
+ @DomName('MessageEvent.ports')
+ @DocsEditable
+ @Creates('=List')
+ final List ports;
- // -- end List<Node> mixins.
+ WindowBase get source => _convertNativeToDart_Window(this._get_source);
+ @JSName('source')
+ @DomName('MessageEvent.source')
+ @DocsEditable
+ @Creates('Window|=Object')
+ @Returns('Window|=Object')
+ final dynamic _get_source;
- @JSName('item')
- @DomName('NodeList.item')
+ @JSName('initMessageEvent')
+ @DomName('MessageEvent.initMessageEvent')
@DocsEditable
- Node _item(int index) native;
+ void $dom_initMessageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Object dataArg, String originArg, String lastEventIdArg, Window sourceArg, List messagePorts) native;
+
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -18018,367 +15285,514 @@ class NodeList implements JavaScriptIndexingBehavior, List<Node> native "*NodeLi
@DocsEditable
-@DomName('Notation')
-class Notation extends Node native "*Notation" {
+@DomName('MessagePort')
+class MessagePort extends EventTarget native "*MessagePort" {
- @DomName('Notation.publicId')
+ @DomName('MessagePort.messageEvent')
@DocsEditable
- final String publicId;
+ static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
- @DomName('Notation.systemId')
+ @JSName('addEventListener')
+ @DomName('MessagePort.addEventListener')
@DocsEditable
- final String systemId;
-}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+
+ @DomName('MessagePort.close')
+ @DocsEditable
+ void close() native;
+ @DomName('MessagePort.dispatchEvent')
+ @DocsEditable
+ bool dispatchEvent(Event evt) native;
-@DomName('Notification')
-class Notification extends EventTarget native "*Notification" {
- factory Notification(String title, [Map options]) {
- if (?options) {
- return JS('Notification', 'new Notification(#,#)', title,
- convertDartToNative_SerializedScriptValue(options));
- } else {
- return JS('Notification', 'new Notification(#)', title);
+ @DomName('MessagePort.postMessage')
+ @DocsEditable
+ void postMessage(/*any*/ message, [List messagePorts]) {
+ if (?messagePorts) {
+ var message_1 = convertDartToNative_SerializedScriptValue(message);
+ _postMessage_1(message_1, messagePorts);
+ return;
}
+ var message_2 = convertDartToNative_SerializedScriptValue(message);
+ _postMessage_2(message_2);
+ return;
}
-
- @DomName('Notification.clickEvent')
+ @JSName('postMessage')
+ @DomName('MessagePort.postMessage')
@DocsEditable
- static const EventStreamProvider<Event> clickEvent = const EventStreamProvider<Event>('click');
-
- @DomName('Notification.closeEvent')
+ void _postMessage_1(message, List messagePorts) native;
+ @JSName('postMessage')
+ @DomName('MessagePort.postMessage')
@DocsEditable
- static const EventStreamProvider<Event> closeEvent = const EventStreamProvider<Event>('close');
+ void _postMessage_2(message) native;
- @DomName('Notification.displayEvent')
+ @JSName('removeEventListener')
+ @DomName('MessagePort.removeEventListener')
@DocsEditable
- static const EventStreamProvider<Event> displayEvent = const EventStreamProvider<Event>('display');
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('Notification.errorEvent')
+ @DomName('MessagePort.start')
@DocsEditable
- static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+ void start() native;
- @DomName('Notification.showEvent')
+ @DomName('MessagePort.onmessage')
@DocsEditable
- static const EventStreamProvider<Event> showEvent = const EventStreamProvider<Event>('show');
+ Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('Notification.dir')
- @DocsEditable
- String dir;
- @DomName('Notification.permission')
+@DocsEditable
+@DomName('HTMLMetaElement')
+class MetaElement extends Element native "*HTMLMetaElement" {
+
+ @DomName('HTMLMetaElement.content')
@DocsEditable
- final String permission;
+ String content;
- @DomName('Notification.replaceId')
+ @DomName('HTMLMetaElement.httpEquiv')
@DocsEditable
- String replaceId;
+ String httpEquiv;
- @DomName('Notification.tag')
+ @DomName('HTMLMetaElement.name')
@DocsEditable
- String tag;
+ String name;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @JSName('addEventListener')
- @DomName('Notification.addEventListener')
+
+@DocsEditable
+@DomName('Metadata')
+class Metadata native "*Metadata" {
+
+ DateTime get modificationTime => _convertNativeToDart_DateTime(this._get_modificationTime);
+ @JSName('modificationTime')
+ @DomName('Metadata.modificationTime')
@DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+ final dynamic _get_modificationTime;
- @DomName('Notification.cancel')
+ @DomName('Metadata.size')
@DocsEditable
- void cancel() native;
+ final int size;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('Notification.close')
+// WARNING: Do not edit - generated code.
+
+
+typedef void MetadataCallback(Metadata metadata);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('HTMLMeterElement')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.SAFARI)
+class MeterElement extends Element native "*HTMLMeterElement" {
+
+ @DomName('HTMLMeterElement.HTMLMeterElement')
@DocsEditable
- void close() native;
+ factory MeterElement() => document.$dom_createElement("meter");
- @DomName('Notification.dispatchEvent')
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => Element.isTagSupported('meter');
+
+ @DomName('HTMLMeterElement.high')
@DocsEditable
- bool dispatchEvent(Event evt) native;
+ num high;
- @JSName('removeEventListener')
- @DomName('Notification.removeEventListener')
+ @DomName('HTMLMeterElement.labels')
@DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ @Returns('NodeList')
+ @Creates('NodeList')
+ final List<Node> labels;
- @JSName('requestPermission')
- @DomName('Notification.requestPermission')
+ @DomName('HTMLMeterElement.low')
@DocsEditable
- static void _requestPermission([_NotificationPermissionCallback callback]) native;
+ num low;
- @JSName('requestPermission')
- @DomName('Notification.requestPermission')
+ @DomName('HTMLMeterElement.max')
@DocsEditable
- static Future<String> requestPermission() {
- var completer = new Completer<String>();
- _requestPermission(
- (value) { completer.complete(value); });
- return completer.future;
- }
+ num max;
- @DomName('Notification.show')
+ @DomName('HTMLMeterElement.min')
@DocsEditable
- void show() native;
+ num min;
- @DomName('Notification.onclick')
+ @DomName('HTMLMeterElement.optimum')
@DocsEditable
- Stream<Event> get onClick => clickEvent.forTarget(this);
+ num optimum;
- @DomName('Notification.onclose')
+ @DomName('HTMLMeterElement.value')
@DocsEditable
- Stream<Event> get onClose => closeEvent.forTarget(this);
+ num value;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('Notification.ondisplay')
- @DocsEditable
- Stream<Event> get onDisplay => displayEvent.forTarget(this);
- @DomName('Notification.onerror')
- @DocsEditable
- Stream<Event> get onError => errorEvent.forTarget(this);
+@DocsEditable
+@DomName('HTMLModElement')
+class ModElement extends Element native "*HTMLModElement" {
- @DomName('Notification.onshow')
+ @DomName('HTMLModElement.cite')
@DocsEditable
- Stream<Event> get onShow => showEvent.forTarget(this);
+ String cite;
+ @DomName('HTMLModElement.dateTime')
+ @DocsEditable
+ String dateTime;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DocsEditable
-@DomName('NotificationCenter')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-@Experimental
-class NotificationCenter native "*NotificationCenter" {
+@DomName('MouseEvent')
+class MouseEvent extends UIEvent native "*MouseEvent" {
+ factory MouseEvent(String type,
+ {Window view, int detail: 0, int screenX: 0, int screenY: 0,
+ int clientX: 0, int clientY: 0, int button: 0, bool canBubble: true,
+ bool cancelable: true, bool ctrlKey: false, bool altKey: false,
+ bool shiftKey: false, bool metaKey: false, EventTarget relatedTarget}) {
- /// Checks if this type is supported on the current platform.
- static bool get supported => JS('bool', '!!(window.webkitNotifications)');
+ if (view == null) {
+ view = window;
+ }
+ var event = document.$dom_createEvent('MouseEvent');
+ event.$dom_initMouseEvent(type, canBubble, cancelable, view, detail,
+ screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey,
+ button, relatedTarget);
+ return event;
+ }
- @DomName('NotificationCenter.checkPermission')
+ @DomName('MouseEvent.altKey')
@DocsEditable
- int checkPermission() native;
+ final bool altKey;
- @JSName('createHTMLNotification')
- @DomName('NotificationCenter.createHTMLNotification')
+ @DomName('MouseEvent.button')
@DocsEditable
- Notification createHtmlNotification(String url) native;
+ final int button;
- @DomName('NotificationCenter.createNotification')
+ @JSName('clientX')
+ @DomName('MouseEvent.clientX')
@DocsEditable
- Notification createNotification(String iconUrl, String title, String body) native;
+ final int $dom_clientX;
- @JSName('requestPermission')
- @DomName('NotificationCenter.requestPermission')
+ @JSName('clientY')
+ @DomName('MouseEvent.clientY')
@DocsEditable
- void _requestPermission([VoidCallback callback]) native;
+ final int $dom_clientY;
- @JSName('requestPermission')
- @DomName('NotificationCenter.requestPermission')
+ @DomName('MouseEvent.ctrlKey')
@DocsEditable
- Future requestPermission() {
- var completer = new Completer();
- _requestPermission(
- () { completer.complete(); });
- return completer.future;
- }
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ final bool ctrlKey;
-// WARNING: Do not edit - generated code.
+ @DomName('MouseEvent.dataTransfer')
+ @DocsEditable
+ final DataTransfer dataTransfer;
+ @DomName('MouseEvent.fromElement')
+ @DocsEditable
+ final Node fromElement;
-typedef void _NotificationPermissionCallback(String permission);
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @DomName('MouseEvent.metaKey')
+ @DocsEditable
+ final bool metaKey;
+ EventTarget get relatedTarget => _convertNativeToDart_EventTarget(this._get_relatedTarget);
+ @JSName('relatedTarget')
+ @DomName('MouseEvent.relatedTarget')
+ @DocsEditable
+ @Creates('Node')
+ @Returns('EventTarget|=Object')
+ final dynamic _get_relatedTarget;
-@DocsEditable
-@DomName('HTMLOListElement')
-class OListElement extends Element native "*HTMLOListElement" {
+ @JSName('screenX')
+ @DomName('MouseEvent.screenX')
+ @DocsEditable
+ final int $dom_screenX;
- @DomName('HTMLOListElement.HTMLOListElement')
+ @JSName('screenY')
+ @DomName('MouseEvent.screenY')
@DocsEditable
- factory OListElement() => document.$dom_createElement("ol");
+ final int $dom_screenY;
- @DomName('HTMLOListElement.reversed')
+ @DomName('MouseEvent.shiftKey')
@DocsEditable
- bool reversed;
+ final bool shiftKey;
- @DomName('HTMLOListElement.start')
+ @DomName('MouseEvent.toElement')
@DocsEditable
- int start;
+ final Node toElement;
- @DomName('HTMLOListElement.type')
+ @JSName('webkitMovementX')
+ @DomName('MouseEvent.webkitMovementX')
@DocsEditable
- String type;
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ final int $dom_webkitMovementX;
+
+ @JSName('webkitMovementY')
+ @DomName('MouseEvent.webkitMovementY')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ final int $dom_webkitMovementY;
+
+ @DomName('MouseEvent.initMouseEvent')
+ @DocsEditable
+ void $dom_initMouseEvent(String type, bool canBubble, bool cancelable, Window view, int detail, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey, int button, EventTarget relatedTarget) {
+ var relatedTarget_1 = _convertDartToNative_EventTarget(relatedTarget);
+ _$dom_initMouseEvent_1(type, canBubble, cancelable, view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget_1);
+ return;
+ }
+ @JSName('initMouseEvent')
+ @DomName('MouseEvent.initMouseEvent')
+ @DocsEditable
+ void _$dom_initMouseEvent_1(type, canBubble, cancelable, Window view, detail, screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey, button, relatedTarget) native;
+
+
+ @deprecated
+ int get clientX => client.x;
+ @deprecated
+ int get clientY => client.y;
+ @deprecated
+ int get offsetX => offset.x;
+ @deprecated
+ int get offsetY => offset.y;
+ @deprecated
+ int get movementX => movement.x;
+ @deprecated
+ int get movementY => movement.y;
+ @deprecated
+ int get screenX => screen.x;
+ @deprecated
+ int get screenY => screen.y;
+
+ @DomName('MouseEvent.clientX')
+ @DomName('MouseEvent.clientY')
+ Point get client => new Point($dom_clientX, $dom_clientY);
+
+ @DomName('MouseEvent.movementX')
+ @DomName('MouseEvent.movementY')
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ Point get movement => new Point($dom_webkitMovementX, $dom_webkitMovementY);
+
+ /**
+ * The coordinates of the mouse pointer in target node coordinates.
+ *
+ * This value may vary between platforms if the target node moves
+ * after the event has fired or if the element has CSS transforms affecting
+ * it.
+ */
+ Point get offset {
+ if (JS('bool', '!!#.offsetX', this)) {
+ var x = JS('int', '#.offsetX', this);
+ var y = JS('int', '#.offsetX', this);
+ return new Point(x, y);
+ } else {
+ // Firefox does not support offsetX.
+ var target = this.target;
+ if (!(target is Element)) {
+ throw new UnsupportedError(
+ 'offsetX is only supported on elements');
+ }
+ return (this.client -
+ this.target.getBoundingClientRect().topLeft).toInt();
+ }
+ }
+
+ @DomName('MouseEvent.screenX')
+ @DomName('MouseEvent.screenY')
+ Point get screen => new Point($dom_screenX, $dom_screenY);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// WARNING: Do not edit - generated code.
-@DocsEditable
-@DomName('HTMLObjectElement')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.IE)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class ObjectElement extends Element native "*HTMLObjectElement" {
-
- @DomName('HTMLObjectElement.HTMLObjectElement')
- @DocsEditable
- factory ObjectElement() => document.$dom_createElement("object");
- /// Checks if this type is supported on the current platform.
- static bool get supported => Element.isTagSupported('object');
+typedef void MutationCallback(List<MutationRecord> mutations, MutationObserver observer);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('HTMLObjectElement.code')
- @DocsEditable
- String code;
- @DomName('HTMLObjectElement.data')
- @DocsEditable
- String data;
+@DomName('MutationEvent')
+class MutationEvent extends Event native "*MutationEvent" {
+ factory MutationEvent(String type,
+ {bool canBubble: false, bool cancelable: false, Node relatedNode,
+ String prevValue, String newValue, String attrName, int attrChange: 0}) {
- @DomName('HTMLObjectElement.form')
- @DocsEditable
- final FormElement form;
+ var event = document.$dom_createEvent('MutationEvent');
+ event.$dom_initMutationEvent(type, canBubble, cancelable, relatedNode,
+ prevValue, newValue, attrName, attrChange);
+ return event;
+ }
- @DomName('HTMLObjectElement.height')
- @DocsEditable
- String height;
+ static const int ADDITION = 2;
- @DomName('HTMLObjectElement.name')
- @DocsEditable
- String name;
+ static const int MODIFICATION = 1;
- @DomName('HTMLObjectElement.type')
- @DocsEditable
- String type;
+ static const int REMOVAL = 3;
- @DomName('HTMLObjectElement.useMap')
+ @DomName('MutationEvent.attrChange')
@DocsEditable
- String useMap;
+ final int attrChange;
- @DomName('HTMLObjectElement.validationMessage')
+ @DomName('MutationEvent.attrName')
@DocsEditable
- final String validationMessage;
+ final String attrName;
- @DomName('HTMLObjectElement.validity')
+ @DomName('MutationEvent.newValue')
@DocsEditable
- final ValidityState validity;
+ final String newValue;
- @DomName('HTMLObjectElement.width')
+ @DomName('MutationEvent.prevValue')
@DocsEditable
- String width;
+ final String prevValue;
- @DomName('HTMLObjectElement.willValidate')
+ @DomName('MutationEvent.relatedNode')
@DocsEditable
- final bool willValidate;
+ final Node relatedNode;
- @DomName('HTMLObjectElement.checkValidity')
+ @JSName('initMutationEvent')
+ @DomName('MutationEvent.initMutationEvent')
@DocsEditable
- bool checkValidity() native;
+ void $dom_initMutationEvent(String type, bool canBubble, bool cancelable, Node relatedNode, String prevValue, String newValue, String attrName, int attrChange) native;
- @DomName('HTMLObjectElement.setCustomValidity')
- @DocsEditable
- void setCustomValidity(String error) native;
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-@DocsEditable
-@DomName('OESElementIndexUint')
-class OesElementIndexUint native "*OESElementIndexUint" {
-}
+
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DocsEditable
-@DomName('OESStandardDerivatives')
-class OesStandardDerivatives native "*OESStandardDerivatives" {
-
- static const int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+@DomName('MutationObserver')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.SAFARI)
+@Experimental
+class MutationObserver native "*MutationObserver" {
+ @DomName('MutationObserver.disconnect')
+ @DocsEditable
+ void disconnect() native;
-@DocsEditable
-@DomName('OESTextureFloat')
-class OesTextureFloat native "*OESTextureFloat" {
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @DomName('MutationObserver.observe')
+ @DocsEditable
+ void _observe(Node target, Map options) {
+ var options_1 = convertDartToNative_Dictionary(options);
+ __observe_1(target, options_1);
+ return;
+ }
+ @JSName('observe')
+ @DomName('MutationObserver.observe')
+ @DocsEditable
+ void __observe_1(Node target, options) native;
+ @DomName('MutationObserver.takeRecords')
+ @DocsEditable
+ List<MutationRecord> takeRecords() native;
-@DocsEditable
-@DomName('OESTextureHalfFloat')
-class OesTextureHalfFloat native "*OESTextureHalfFloat" {
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ /**
+ * Checks to see if the mutation observer API is supported on the current
+ * platform.
+ */
+ static bool get supported {
+ return JS('bool',
+ '!!(window.MutationObserver || window.WebKitMutationObserver)');
+ }
+ void observe(Node target,
+ {Map options,
+ bool childList,
+ bool attributes,
+ bool characterData,
+ bool subtree,
+ bool attributeOldValue,
+ bool characterDataOldValue,
+ List<String> attributeFilter}) {
-@DocsEditable
-@DomName('OESVertexArrayObject')
-class OesVertexArrayObject native "*OESVertexArrayObject" {
+ // Parse options into map of known type.
+ var parsedOptions = _createDict();
- static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
+ if (options != null) {
+ options.forEach((k, v) {
+ if (_boolKeys.containsKey(k)) {
+ _add(parsedOptions, k, true == v);
+ } else if (k == 'attributeFilter') {
+ _add(parsedOptions, k, _fixupList(v));
+ } else {
+ throw new ArgumentError(
+ "Illegal MutationObserver.observe option '$k'");
+ }
+ });
+ }
- @JSName('bindVertexArrayOES')
- @DomName('OESVertexArrayObject.bindVertexArrayOES')
- @DocsEditable
- void bindVertexArray(WebGLVertexArrayObject arrayObject) native;
+ // Override options passed in the map with named optional arguments.
+ override(key, value) {
+ if (value != null) _add(parsedOptions, key, value);
+ }
- @JSName('createVertexArrayOES')
- @DomName('OESVertexArrayObject.createVertexArrayOES')
- @DocsEditable
- WebGLVertexArrayObject createVertexArray() native;
+ override('childList', childList);
+ override('attributes', attributes);
+ override('characterData', characterData);
+ override('subtree', subtree);
+ override('attributeOldValue', attributeOldValue);
+ override('characterDataOldValue', characterDataOldValue);
+ if (attributeFilter != null) {
+ override('attributeFilter', _fixupList(attributeFilter));
+ }
- @JSName('deleteVertexArrayOES')
- @DomName('OESVertexArrayObject.deleteVertexArrayOES')
- @DocsEditable
- void deleteVertexArray(WebGLVertexArrayObject arrayObject) native;
+ _call(target, parsedOptions);
+ }
- @JSName('isVertexArrayOES')
- @DomName('OESVertexArrayObject.isVertexArrayOES')
- @DocsEditable
- bool isVertexArray(WebGLVertexArrayObject arrayObject) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ // TODO: Change to a set when const Sets are available.
+ static final _boolKeys =
+ const {'childList': true,
+ 'attributes': true,
+ 'characterData': true,
+ 'subtree': true,
+ 'attributeOldValue': true,
+ 'characterDataOldValue': true };
-@DocsEditable
-@DomName('HTMLOptGroupElement')
-class OptGroupElement extends Element native "*HTMLOptGroupElement" {
+ static _createDict() => JS('var', '{}');
+ static _add(m, String key, value) { JS('void', '#[#] = #', m, key, value); }
+ static _fixupList(list) => list; // TODO: Ensure is a JavaScript Array.
- @DomName('HTMLOptGroupElement.HTMLOptGroupElement')
- @DocsEditable
- factory OptGroupElement() => document.$dom_createElement("optgroup");
+ // Call native function with no conversions.
+ @JSName('observe')
+ void _call(target, options) native;
- @DomName('HTMLOptGroupElement.disabled')
- @DocsEditable
- bool disabled;
+ factory MutationObserver(MutationCallback callback) {
+ // Dummy statement to mark types as instantiated.
+ JS('MutationObserver|MutationRecord', '0');
- @DomName('HTMLOptGroupElement.label')
- @DocsEditable
- String label;
+ return JS('MutationObserver',
+ 'new(window.MutationObserver||window.WebKitMutationObserver||'
+ 'window.MozMutationObserver)(#)',
+ convertDartClosureToJS(callback, 2));
+ }
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -18386,192 +15800,195 @@ class OptGroupElement extends Element native "*HTMLOptGroupElement" {
@DocsEditable
-@DomName('HTMLOptionElement')
-class OptionElement extends Element native "*HTMLOptionElement" {
+@DomName('MutationRecord')
+class MutationRecord native "*MutationRecord" {
- @DomName('HTMLOptionElement.HTMLOptionElement')
+ @DomName('MutationRecord.addedNodes')
@DocsEditable
- factory OptionElement([String data, String value, bool defaultSelected, bool selected]) {
- if (?selected) {
- return OptionElement._create_1(data, value, defaultSelected, selected);
- }
- if (?defaultSelected) {
- return OptionElement._create_2(data, value, defaultSelected);
- }
- if (?value) {
- return OptionElement._create_3(data, value);
- }
- if (?data) {
- return OptionElement._create_4(data);
- }
- return OptionElement._create_5();
- }
- static OptionElement _create_1(data, value, defaultSelected, selected) => JS('OptionElement', 'new Option(#,#,#,#)', data, value, defaultSelected, selected);
- static OptionElement _create_2(data, value, defaultSelected) => JS('OptionElement', 'new Option(#,#,#)', data, value, defaultSelected);
- static OptionElement _create_3(data, value) => JS('OptionElement', 'new Option(#,#)', data, value);
- static OptionElement _create_4(data) => JS('OptionElement', 'new Option(#)', data);
- static OptionElement _create_5() => JS('OptionElement', 'new Option()');
+ @Returns('NodeList')
+ @Creates('NodeList')
+ final List<Node> addedNodes;
- @DomName('HTMLOptionElement.defaultSelected')
+ @DomName('MutationRecord.attributeName')
@DocsEditable
- bool defaultSelected;
+ final String attributeName;
- @DomName('HTMLOptionElement.disabled')
+ @DomName('MutationRecord.attributeNamespace')
@DocsEditable
- bool disabled;
+ final String attributeNamespace;
- @DomName('HTMLOptionElement.form')
+ @DomName('MutationRecord.nextSibling')
@DocsEditable
- final FormElement form;
+ final Node nextSibling;
- @DomName('HTMLOptionElement.index')
+ @DomName('MutationRecord.oldValue')
+ @DocsEditable
+ final String oldValue;
+
+ @DomName('MutationRecord.previousSibling')
@DocsEditable
- final int index;
+ final Node previousSibling;
- @DomName('HTMLOptionElement.label')
+ @DomName('MutationRecord.removedNodes')
@DocsEditable
- String label;
+ @Returns('NodeList')
+ @Creates('NodeList')
+ final List<Node> removedNodes;
- @DomName('HTMLOptionElement.selected')
+ @DomName('MutationRecord.target')
@DocsEditable
- bool selected;
+ final Node target;
- @DomName('HTMLOptionElement.value')
+ @DomName('MutationRecord.type')
@DocsEditable
- String value;
+ final String type;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DocsEditable
-@DomName('HTMLOutputElement')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class OutputElement extends Element native "*HTMLOutputElement" {
+@DomName('Navigator')
+class Navigator native "*Navigator" {
- @DomName('HTMLOutputElement.HTMLOutputElement')
- @DocsEditable
- factory OutputElement() => document.$dom_createElement("output");
+ @DomName('Navigator.language')
+ String get language => JS('String', '#.language || #.userLanguage', this,
+ this);
- /// Checks if this type is supported on the current platform.
- static bool get supported => Element.isTagSupported('output');
+ /**
+ * Gets a stream (video and or audio) from the local computer.
+ *
+ * Use [MediaStream.supported] to check if this is supported by the current
+ * platform.
+ *
+ * Example use:
+ *
+ * window.navigator.getUserMedia(audio:true, video: true).then((stream) {
+ * var video = new VideoElement()
+ * ..autoplay = true
+ * ..src = Url.createObjectUrl(stream);
+ * document.body.append(video);
+ * });
+ *
+ * See also:
+ * * [MediaStream.supported]
+ */
+ @DomName('Navigator.webkitGetUserMedia')
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @Experimental
+ Future<LocalMediaStream> getUserMedia({bool audio: false,
+ bool video: false}) {
+ var completer = new Completer<LocalMediaStream>();
+ var options = {
+ 'audio': audio,
+ 'video': video
+ };
+ _ensureGetUserMedia();
+ this._getUserMedia(convertDartToNative_Dictionary(options),
+ (stream) {
+ completer.complete(stream);
+ },
+ (error) {
+ completer.completeError(error);
+ });
+ return completer.future;
+ }
- @DomName('HTMLOutputElement.defaultValue')
- @DocsEditable
- String defaultValue;
+ _ensureGetUserMedia() {
+ if (JS('bool', '!(#.getUserMedia)', this)) {
+ JS('void', '#.getUserMedia = '
+ '(#.getUserMedia || #.webkitGetUserMedia || #.mozGetUserMedia ||'
+ '#.msGetUserMedia)', this, this, this, this, this);
+ }
+ }
- @DomName('HTMLOutputElement.form')
- @DocsEditable
- final FormElement form;
+ @JSName('getUserMedia')
+ void _getUserMedia(options, _NavigatorUserMediaSuccessCallback success,
+ _NavigatorUserMediaErrorCallback error) native;
- @DomName('HTMLOutputElement.htmlFor')
- @DocsEditable
- final DomSettableTokenList htmlFor;
- @DomName('HTMLOutputElement.labels')
+ @DomName('Navigator.appCodeName')
@DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- final List<Node> labels;
+ final String appCodeName;
- @DomName('HTMLOutputElement.name')
+ @DomName('Navigator.appName')
@DocsEditable
- String name;
+ final String appName;
- @DomName('HTMLOutputElement.type')
+ @DomName('Navigator.appVersion')
@DocsEditable
- final String type;
+ final String appVersion;
- @DomName('HTMLOutputElement.validationMessage')
+ @DomName('Navigator.cookieEnabled')
@DocsEditable
- final String validationMessage;
+ final bool cookieEnabled;
- @DomName('HTMLOutputElement.validity')
+ @DomName('Navigator.geolocation')
@DocsEditable
- final ValidityState validity;
+ final Geolocation geolocation;
- @DomName('HTMLOutputElement.value')
+ @DomName('Navigator.mimeTypes')
@DocsEditable
- String value;
+ final DomMimeTypeArray mimeTypes;
- @DomName('HTMLOutputElement.willValidate')
+ @DomName('Navigator.onLine')
@DocsEditable
- final bool willValidate;
+ final bool onLine;
- @DomName('HTMLOutputElement.checkValidity')
+ @DomName('Navigator.platform')
@DocsEditable
- bool checkValidity() native;
+ final String platform;
- @DomName('HTMLOutputElement.setCustomValidity')
+ @DomName('Navigator.plugins')
@DocsEditable
- void setCustomValidity(String error) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('OverflowEvent')
-class OverflowEvent extends Event native "*OverflowEvent" {
-
- static const int BOTH = 2;
-
- static const int HORIZONTAL = 0;
-
- static const int VERTICAL = 1;
+ final DomPluginArray plugins;
- @DomName('OverflowEvent.horizontalOverflow')
+ @DomName('Navigator.product')
@DocsEditable
- final bool horizontalOverflow;
+ final String product;
- @DomName('OverflowEvent.orient')
+ @DomName('Navigator.productSub')
@DocsEditable
- final int orient;
+ final String productSub;
- @DomName('OverflowEvent.verticalOverflow')
+ @DomName('Navigator.userAgent')
@DocsEditable
- final bool verticalOverflow;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('PagePopupController')
-class PagePopupController native "*PagePopupController" {
+ final String userAgent;
- @DomName('PagePopupController.closePopup')
+ @DomName('Navigator.vendor')
@DocsEditable
- void closePopup() native;
+ final String vendor;
- @DomName('PagePopupController.formatMonth')
+ @DomName('Navigator.vendorSub')
@DocsEditable
- String formatMonth(int year, int zeroBaseMonth) native;
+ final String vendorSub;
- @DomName('PagePopupController.formatShortMonth')
+ @JSName('webkitBattery')
+ @DomName('Navigator.webkitBattery')
@DocsEditable
- String formatShortMonth(int year, int zeroBaseMonth) native;
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ final BatteryManager battery;
- @DomName('PagePopupController.histogramEnumeration')
+ @DomName('Navigator.getStorageUpdates')
@DocsEditable
- void histogramEnumeration(String name, int sample, int boundaryValue) native;
+ void getStorageUpdates() native;
- @DomName('PagePopupController.localizeNumberString')
+ @DomName('Navigator.javaEnabled')
@DocsEditable
- String localizeNumberString(String numberString) native;
+ bool javaEnabled() native;
- @DomName('PagePopupController.setValue')
+ @JSName('webkitGetGamepads')
+ @DomName('Navigator.webkitGetGamepads')
@DocsEditable
- void setValue(String value) native;
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ @Returns('_GamepadList')
+ @Creates('_GamepadList')
+ List<Gamepad> getGamepads() native;
- @DomName('PagePopupController.setValueAndClosePopup')
- @DocsEditable
- void setValueAndClosePopup(int numberValue, String stringValue) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -18579,717 +15996,737 @@ class PagePopupController native "*PagePopupController" {
@DocsEditable
-@DomName('PageTransitionEvent')
-class PageTransitionEvent extends Event native "*PageTransitionEvent" {
+@DomName('NavigatorUserMediaError')
+class NavigatorUserMediaError native "*NavigatorUserMediaError" {
- @DomName('PageTransitionEvent.persisted')
+ static const int PERMISSION_DENIED = 1;
+
+ @DomName('NavigatorUserMediaError.code')
@DocsEditable
- final bool persisted;
+ final int code;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// WARNING: Do not edit - generated code.
-@DocsEditable
-@DomName('HTMLParagraphElement')
-class ParagraphElement extends Element native "*HTMLParagraphElement" {
- @DomName('HTMLParagraphElement.HTMLParagraphElement')
- @DocsEditable
- factory ParagraphElement() => document.$dom_createElement("p");
-}
+typedef void _NavigatorUserMediaErrorCallback(NavigatorUserMediaError error);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// WARNING: Do not edit - generated code.
-@DocsEditable
-@DomName('HTMLParamElement')
-class ParamElement extends Element native "*HTMLParamElement" {
-
- @DomName('HTMLParamElement.HTMLParamElement')
- @DocsEditable
- factory ParamElement() => document.$dom_createElement("param");
-
- @DomName('HTMLParamElement.name')
- @DocsEditable
- String name;
- @DomName('HTMLParamElement.value')
- @DocsEditable
- String value;
-}
+typedef void _NavigatorUserMediaSuccessCallback(LocalMediaStream stream);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DocsEditable
-@DomName('Performance')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE)
-class Performance extends EventTarget native "*Performance" {
-
- /// Checks if this type is supported on the current platform.
- static bool get supported => JS('bool', '!!(window.performance)');
+/**
+ * Lazy implementation of the child nodes of an element that does not request
+ * the actual child nodes of an element until strictly necessary greatly
+ * improving performance for the typical cases where it is not required.
+ */
+class _ChildNodeListLazy implements List {
+ final Node _this;
- @DomName('Performance.memory')
- @DocsEditable
- final MemoryInfo memory;
+ _ChildNodeListLazy(this._this);
- @DomName('Performance.navigation')
- @DocsEditable
- final PerformanceNavigation navigation;
- @DomName('Performance.timing')
- @DocsEditable
- final PerformanceTiming timing;
+ Node get first {
+ Node result = JS('Node|Null', '#.firstChild', _this);
+ if (result == null) throw new StateError("No elements");
+ return result;
+ }
+ Node get last {
+ Node result = JS('Node|Null', '#.lastChild', _this);
+ if (result == null) throw new StateError("No elements");
+ return result;
+ }
+ Node get single {
+ int l = this.length;
+ if (l == 0) throw new StateError("No elements");
+ if (l > 1) throw new StateError("More than one element");
+ return JS('Node|Null', '#.firstChild', _this);
+ }
- @DomName('Performance.now')
- @DocsEditable
- num now() native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ Node min([int compare(Node a, Node b)]) {
+ return IterableMixinWorkaround.min(this, compare);
+ }
+ Node max([int compare(Node a, Node b)]) {
+ return IterableMixinWorkaround.max(this, compare);
+ }
-@DocsEditable
-@DomName('PerformanceNavigation')
-class PerformanceNavigation native "*PerformanceNavigation" {
+ void add(Node value) {
+ _this.append(value);
+ }
- static const int TYPE_BACK_FORWARD = 2;
+ void addLast(Node value) {
+ _this.append(value);
+ }
- static const int TYPE_NAVIGATE = 0;
- static const int TYPE_RELOAD = 1;
+ void addAll(Iterable<Node> iterable) {
+ if (iterable is _ChildNodeListLazy) {
+ if (!identical(iterable._this, _this)) {
+ // Optimized route for copying between nodes.
+ for (var i = 0, len = iterable.length; i < len; ++i) {
+ // Should use $dom_firstChild, Bug 8886.
+ _this.append(iterable[0]);
+ }
+ }
+ return;
+ }
+ for (Node node in iterable) {
+ _this.append(node);
+ }
+ }
- static const int TYPE_RESERVED = 255;
+ Node removeLast() {
+ final result = last;
+ if (result != null) {
+ _this.$dom_removeChild(result);
+ }
+ return result;
+ }
- @DomName('PerformanceNavigation.redirectCount')
- @DocsEditable
- final int redirectCount;
+ Node removeAt(int index) {
+ var result = this[index];
+ if (result != null) {
+ _this.$dom_removeChild(result);
+ }
+ return result;
+ }
- @DomName('PerformanceNavigation.type')
- @DocsEditable
- final int type;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ void remove(Object object) {
+ if (object is! Node) return;
+ Node node = object;
+ if (!identical(_this, node.parentNode)) return;
+ _this.$dom_removeChild(node);
+ }
+ void removeAll(Iterable elements) {
+ IterableMixinWorkaround.removeAll(this, elements);
+ }
-@DocsEditable
-@DomName('PerformanceTiming')
-class PerformanceTiming native "*PerformanceTiming" {
+ void retainAll(Iterable elements) {
+ IterableMixinWorkaround.retainAll(this, elements);
+ }
- @DomName('PerformanceTiming.connectEnd')
- @DocsEditable
- final int connectEnd;
+ void removeWhere(bool test(Node node)) {
+ IterableMixinWorkaround.removeWhere(this, test);
+ }
- @DomName('PerformanceTiming.connectStart')
- @DocsEditable
- final int connectStart;
+ void retainWhere(bool test(Node node)) {
+ IterableMixinWorkaround.retainWhere(this, test);
+ }
- @DomName('PerformanceTiming.domComplete')
- @DocsEditable
- final int domComplete;
+ void clear() {
+ _this.text = '';
+ }
- @DomName('PerformanceTiming.domContentLoadedEventEnd')
- @DocsEditable
- final int domContentLoadedEventEnd;
+ void operator []=(int index, Node value) {
+ _this.$dom_replaceChild(value, this[index]);
+ }
- @DomName('PerformanceTiming.domContentLoadedEventStart')
- @DocsEditable
- final int domContentLoadedEventStart;
+ Iterator<Node> get iterator => _this.$dom_childNodes.iterator;
- @DomName('PerformanceTiming.domInteractive')
- @DocsEditable
- final int domInteractive;
+ // TODO(jacobr): We can implement these methods much more efficiently by
+ // looking up the nodeList only once instead of once per iteration.
+ bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
- @DomName('PerformanceTiming.domLoading')
- @DocsEditable
- final int domLoading;
+ void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
- @DomName('PerformanceTiming.domainLookupEnd')
- @DocsEditable
- final int domainLookupEnd;
+ dynamic reduce(dynamic initialValue,
+ dynamic combine(dynamic previousValue, Node element)) {
+ return IterableMixinWorkaround.reduce(this, initialValue, combine);
+ }
- @DomName('PerformanceTiming.domainLookupStart')
- @DocsEditable
- final int domainLookupStart;
+ String join([String separator]) {
+ return IterableMixinWorkaround.joinList(this, separator);
+ }
- @DomName('PerformanceTiming.fetchStart')
- @DocsEditable
- final int fetchStart;
+ Iterable map(f(Node element)) {
+ return IterableMixinWorkaround.mapList(this, f);
+ }
- @DomName('PerformanceTiming.loadEventEnd')
- @DocsEditable
- final int loadEventEnd;
+ Iterable<Node> where(bool f(Node element)) {
+ return IterableMixinWorkaround.where(this, f);
+ }
- @DomName('PerformanceTiming.loadEventStart')
- @DocsEditable
- final int loadEventStart;
+ Iterable expand(Iterable f(Node element)) {
+ return IterableMixinWorkaround.expand(this, f);
+ }
- @DomName('PerformanceTiming.navigationStart')
- @DocsEditable
- final int navigationStart;
+ bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
- @DomName('PerformanceTiming.redirectEnd')
- @DocsEditable
- final int redirectEnd;
+ bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
- @DomName('PerformanceTiming.redirectStart')
- @DocsEditable
- final int redirectStart;
+ List<Node> toList({ bool growable: true }) =>
+ new List<Node>.from(this, growable: growable);
+ Set<Node> toSet() => new Set<Node>.from(this);
- @DomName('PerformanceTiming.requestStart')
- @DocsEditable
- final int requestStart;
+ bool get isEmpty => this.length == 0;
- @DomName('PerformanceTiming.responseEnd')
- @DocsEditable
- final int responseEnd;
+ // From List<Node>:
- @DomName('PerformanceTiming.responseStart')
- @DocsEditable
- final int responseStart;
+ Iterable<Node> take(int n) {
+ return IterableMixinWorkaround.takeList(this, n);
+ }
- @DomName('PerformanceTiming.secureConnectionStart')
- @DocsEditable
- final int secureConnectionStart;
+ Iterable<Node> takeWhile(bool test(Node value)) {
+ return IterableMixinWorkaround.takeWhile(this, test);
+ }
- @DomName('PerformanceTiming.unloadEventEnd')
- @DocsEditable
- final int unloadEventEnd;
+ Iterable<Node> skip(int n) {
+ return IterableMixinWorkaround.skipList(this, n);
+ }
- @DomName('PerformanceTiming.unloadEventStart')
- @DocsEditable
- final int unloadEventStart;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ Iterable<Node> skipWhile(bool test(Node value)) {
+ return IterableMixinWorkaround.skipWhile(this, test);
+ }
+
+ Node firstWhere(bool test(Node value), {Node orElse()}) {
+ return IterableMixinWorkaround.firstWhere(this, test, orElse);
+ }
+ Node lastWhere(bool test(Node value), {Node orElse()}) {
+ return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+ }
-@DocsEditable
-@DomName('PopStateEvent')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class PopStateEvent extends Event native "*PopStateEvent" {
+ Node singleWhere(bool test(Node value)) {
+ return IterableMixinWorkaround.singleWhere(this, test);
+ }
- dynamic get state => convertNativeToDart_SerializedScriptValue(this._get_state);
- @JSName('state')
- @DomName('PopStateEvent.state')
- @DocsEditable
- @annotation_Creates_SerializedScriptValue
- @annotation_Returns_SerializedScriptValue
- final dynamic _get_state;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ Node elementAt(int index) {
+ return this[index];
+ }
-// WARNING: Do not edit - generated code.
+ Iterable<Node> get reversed {
+ return IterableMixinWorkaround.reversedList(this);
+ }
+ // TODO(jacobr): this could be implemented for child node lists.
+ // The exception we throw here is misleading.
+ void sort([int compare(Node a, Node b)]) {
+ throw new UnsupportedError("Cannot sort immutable List.");
+ }
-typedef void _PositionCallback(Geoposition position);
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ int indexOf(Node element, [int start = 0]) =>
+ Lists.indexOf(this, element, start, this.length);
+ int lastIndexOf(Node element, [int start = 0]) =>
+ Lists.lastIndexOf(this, element, start);
-@DocsEditable
-@DomName('PositionError')
-class PositionError native "*PositionError" {
+ // FIXME: implement these.
+ void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
+ throw new UnsupportedError(
+ "Cannot setRange on immutable List.");
+ }
+ void removeRange(int start, int rangeLength) {
+ throw new UnsupportedError(
+ "Cannot removeRange on immutable List.");
+ }
+ void insertRange(int start, int rangeLength, [Node initialValue]) {
+ throw new UnsupportedError(
+ "Cannot insertRange on immutable List.");
+ }
+ List<Node> getRange(int start, int rangeLength) =>
+ Lists.getRange(this, start, rangeLength, <Node>[]);
- static const int PERMISSION_DENIED = 1;
+ // -- end List<Node> mixins.
- static const int POSITION_UNAVAILABLE = 2;
+ // TODO(jacobr): benchmark whether this is more efficient or whether caching
+ // a local copy of $dom_childNodes is more efficient.
+ int get length => _this.$dom_childNodes.length;
- static const int TIMEOUT = 3;
+ void set length(int value) {
+ throw new UnsupportedError(
+ "Cannot set length on immutable List.");
+ }
- @DomName('PositionError.code')
- @DocsEditable
- final int code;
+ Node operator[](int index) => _this.$dom_childNodes[index];
- @DomName('PositionError.message')
- @DocsEditable
- final String message;
+ Map<int, Node> asMap() => IterableMixinWorkaround.asMapList(this);
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-// WARNING: Do not edit - generated code.
+@DomName('Node')
+class Node extends EventTarget native "*Node" {
+ List<Node> get nodes {
+ return new _ChildNodeListLazy(this);
+ }
-typedef void _PositionErrorCallback(PositionError error);
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ void set nodes(Collection<Node> value) {
+ // Copy list first since we don't want liveness during iteration.
+ // TODO(jacobr): there is a better way to do this.
+ List copy = new List.from(value);
+ text = '';
+ for (Node node in copy) {
+ append(node);
+ }
+ }
+ /**
+ * Removes this node from the DOM.
+ */
+ @DomName('Node.removeChild')
+ void remove() {
+ // TODO(jacobr): should we throw an exception if parent is already null?
+ // TODO(vsm): Use the native remove when available.
+ if (this.parentNode != null) {
+ final Node parent = this.parentNode;
+ parentNode.$dom_removeChild(this);
+ }
+ }
-@DocsEditable
-@DomName('HTMLPreElement')
-class PreElement extends Element native "*HTMLPreElement" {
+ /**
+ * Replaces this node with another node.
+ */
+ @DomName('Node.replaceChild')
+ Node replaceWith(Node otherNode) {
+ try {
+ final Node parent = this.parentNode;
+ parent.$dom_replaceChild(otherNode, this);
+ } catch (e) {
- @DomName('HTMLPreElement.HTMLPreElement')
- @DocsEditable
- factory PreElement() => document.$dom_createElement("pre");
+ };
+ return this;
+ }
- @DomName('HTMLPreElement.wrap')
- @DocsEditable
- bool wrap;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ /**
+ * Inserts all of the nodes into this node directly before refChild.
+ *
+ * See also:
+ *
+ * * [insertBefore]
+ */
+ Node insertAllBefore(Iterable<Node> newNodes, Node refChild) {
+ if (newNodes is _ChildNodeListLazy) {
+ if (identical(newNodes._this, this)) {
+ throw new ArgumentError(newNodes);
+ }
+ // Optimized route for copying between nodes.
+ for (var i = 0, len = newNodes.length; i < len; ++i) {
+ // Should use $dom_firstChild, Bug 8886.
+ this.insertBefore(newNodes[0], refChild);
+ }
+ } else {
+ for (var node in newNodes) {
+ this.insertBefore(node, refChild);
+ }
+ }
+ }
-@DocsEditable
-@DomName('ProcessingInstruction')
-class ProcessingInstruction extends Node native "*ProcessingInstruction" {
- @DomName('ProcessingInstruction.data')
+ @JSName('childNodes')
+ @DomName('Node.childNodes')
@DocsEditable
- String data;
+ @Returns('NodeList')
+ @Creates('NodeList')
+ final List<Node> $dom_childNodes;
- @DomName('ProcessingInstruction.sheet')
+ @JSName('firstChild')
+ @DomName('Node.firstChild')
@DocsEditable
- final StyleSheet sheet;
+ final Node $dom_firstChild;
- @DomName('ProcessingInstruction.target')
+ @JSName('lastChild')
+ @DomName('Node.lastChild')
@DocsEditable
- final String target;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('HTMLProgressElement')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.FIREFOX)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class ProgressElement extends Element native "*HTMLProgressElement" {
+ final Node $dom_lastChild;
- @DomName('HTMLProgressElement.HTMLProgressElement')
+ @JSName('localName')
+ @DomName('Node.localName')
@DocsEditable
- factory ProgressElement() => document.$dom_createElement("progress");
-
- /// Checks if this type is supported on the current platform.
- static bool get supported => Element.isTagSupported('progress');
+ final String $dom_localName;
- @DomName('HTMLProgressElement.labels')
+ @JSName('namespaceURI')
+ @DomName('Node.namespaceURI')
@DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- final List<Node> labels;
+ final String $dom_namespaceUri;
- @DomName('HTMLProgressElement.max')
+ @JSName('nextSibling')
+ @DomName('Node.nextSibling')
@DocsEditable
- num max;
+ final Node nextNode;
- @DomName('HTMLProgressElement.position')
+ @DomName('Node.nodeType')
@DocsEditable
- final num position;
+ final int nodeType;
- @DomName('HTMLProgressElement.value')
+ @DomName('Node.nodeValue')
@DocsEditable
- num value;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
+ final String nodeValue;
-@DocsEditable
-@DomName('ProgressEvent')
-class ProgressEvent extends Event native "*ProgressEvent" {
+ @JSName('ownerDocument')
+ @DomName('Node.ownerDocument')
+ @DocsEditable
+ final Document document;
- @DomName('ProgressEvent.lengthComputable')
+ @JSName('parentElement')
+ @DomName('Node.parentElement')
@DocsEditable
- final bool lengthComputable;
+ final Element parent;
- @DomName('ProgressEvent.loaded')
+ @DomName('Node.parentNode')
@DocsEditable
- final int loaded;
+ final Node parentNode;
- @DomName('ProgressEvent.total')
+ @JSName('previousSibling')
+ @DomName('Node.previousSibling')
@DocsEditable
- final int total;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ final Node previousNode;
+ @JSName('textContent')
+ @DomName('Node.textContent')
+ @DocsEditable
+ String text;
-@DocsEditable
-@DomName('HTMLQuoteElement')
-class QuoteElement extends Element native "*HTMLQuoteElement" {
+ @JSName('addEventListener')
+ @DomName('Node.addEventListener')
+ @DocsEditable
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('HTMLQuoteElement.cite')
+ @JSName('appendChild')
+ @DomName('Node.appendChild')
@DocsEditable
- String cite;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ Node append(Node newChild) native;
-// WARNING: Do not edit - generated code.
+ @JSName('cloneNode')
+ @DomName('Node.cloneNode')
+ @DocsEditable
+ Node clone(bool deep) native;
+ @DomName('Node.contains')
+ @DocsEditable
+ bool contains(Node other) native;
-typedef void _RtcErrorCallback(String errorInformation);
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @DomName('Node.dispatchEvent')
+ @DocsEditable
+ bool dispatchEvent(Event event) native;
-// WARNING: Do not edit - generated code.
+ @DomName('Node.hasChildNodes')
+ @DocsEditable
+ bool hasChildNodes() native;
+ @DomName('Node.insertBefore')
+ @DocsEditable
+ Node insertBefore(Node newChild, Node refChild) native;
-typedef void _RtcSessionDescriptionCallback(RtcSessionDescription sdp);
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @JSName('removeChild')
+ @DomName('Node.removeChild')
+ @DocsEditable
+ Node $dom_removeChild(Node oldChild) native;
-// WARNING: Do not edit - generated code.
+ @JSName('removeEventListener')
+ @DomName('Node.removeEventListener')
+ @DocsEditable
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ @JSName('replaceChild')
+ @DomName('Node.replaceChild')
+ @DocsEditable
+ Node $dom_replaceChild(Node newChild, Node oldChild) native;
-typedef void RtcStatsCallback(RtcStatsResponse response);
+}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable
-@DomName('RadioNodeList')
-class RadioNodeList extends NodeList native "*RadioNodeList" {
-
- @DomName('RadioNodeList.value')
- @DocsEditable
- String value;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+@DomName('NodeFilter')
+class NodeFilter native "*NodeFilter" {
-// WARNING: Do not edit - generated code.
+ static const int FILTER_ACCEPT = 1;
+ static const int FILTER_REJECT = 2;
-@DomName('Range')
-class Range native "*Range" {
- factory Range() => document.$dom_createRange();
+ static const int FILTER_SKIP = 3;
+ static const int SHOW_ALL = 0xFFFFFFFF;
- static const int END_TO_END = 2;
+ static const int SHOW_ATTRIBUTE = 0x00000002;
- static const int END_TO_START = 3;
+ static const int SHOW_CDATA_SECTION = 0x00000008;
- static const int NODE_AFTER = 1;
+ static const int SHOW_COMMENT = 0x00000080;
- static const int NODE_BEFORE = 0;
+ static const int SHOW_DOCUMENT = 0x00000100;
- static const int NODE_BEFORE_AND_AFTER = 2;
+ static const int SHOW_DOCUMENT_FRAGMENT = 0x00000400;
- static const int NODE_INSIDE = 3;
+ static const int SHOW_DOCUMENT_TYPE = 0x00000200;
- static const int START_TO_END = 1;
+ static const int SHOW_ELEMENT = 0x00000001;
- static const int START_TO_START = 0;
+ static const int SHOW_ENTITY = 0x00000020;
- @DomName('Range.collapsed')
- @DocsEditable
- final bool collapsed;
+ static const int SHOW_ENTITY_REFERENCE = 0x00000010;
- @DomName('Range.commonAncestorContainer')
- @DocsEditable
- final Node commonAncestorContainer;
+ static const int SHOW_NOTATION = 0x00000800;
- @DomName('Range.endContainer')
- @DocsEditable
- final Node endContainer;
+ static const int SHOW_PROCESSING_INSTRUCTION = 0x00000040;
- @DomName('Range.endOffset')
- @DocsEditable
- final int endOffset;
+ static const int SHOW_TEXT = 0x00000004;
- @DomName('Range.startContainer')
+ @DomName('NodeFilter.acceptNode')
@DocsEditable
- final Node startContainer;
+ int acceptNode(Node n) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('Range.startOffset')
- @DocsEditable
- final int startOffset;
- @DomName('Range.cloneContents')
- @DocsEditable
- DocumentFragment cloneContents() native;
+@DocsEditable
+@DomName('NodeIterator')
+class NodeIterator native "*NodeIterator" {
- @DomName('Range.cloneRange')
+ @DomName('NodeIterator.expandEntityReferences')
@DocsEditable
- Range cloneRange() native;
+ final bool expandEntityReferences;
- @DomName('Range.collapse')
+ @DomName('NodeIterator.filter')
@DocsEditable
- void collapse(bool toStart) native;
+ final NodeFilter filter;
- @DomName('Range.compareNode')
+ @DomName('NodeIterator.pointerBeforeReferenceNode')
@DocsEditable
- int compareNode(Node refNode) native;
+ final bool pointerBeforeReferenceNode;
- @DomName('Range.comparePoint')
+ @DomName('NodeIterator.referenceNode')
@DocsEditable
- int comparePoint(Node refNode, int offset) native;
+ final Node referenceNode;
- @DomName('Range.createContextualFragment')
+ @DomName('NodeIterator.root')
@DocsEditable
- DocumentFragment createContextualFragment(String html) native;
+ final Node root;
- @DomName('Range.deleteContents')
+ @DomName('NodeIterator.whatToShow')
@DocsEditable
- void deleteContents() native;
+ final int whatToShow;
- @DomName('Range.detach')
+ @DomName('NodeIterator.detach')
@DocsEditable
void detach() native;
- @DomName('Range.expand')
+ @DomName('NodeIterator.nextNode')
@DocsEditable
- void expand(String unit) native;
+ Node nextNode() native;
- @DomName('Range.extractContents')
+ @DomName('NodeIterator.previousNode')
@DocsEditable
- DocumentFragment extractContents() native;
+ Node previousNode() native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('Range.getBoundingClientRect')
- @DocsEditable
- Rect getBoundingClientRect() native;
- @DomName('Range.getClientRects')
- @DocsEditable
- @Returns('_ClientRectList')
- @Creates('_ClientRectList')
- List<Rect> getClientRects() native;
+@DocsEditable
+@DomName('NodeList')
+class NodeList implements JavaScriptIndexingBehavior, List<Node> native "*NodeList" {
- @DomName('Range.insertNode')
+ @DomName('NodeList.length')
@DocsEditable
- void insertNode(Node newNode) native;
+ int get length => JS("int", "#.length", this);
- @DomName('Range.intersectsNode')
- @DocsEditable
- bool intersectsNode(Node refNode) native;
+ Node operator[](int index) => JS("Node", "#[#]", this, index);
- @DomName('Range.isPointInRange')
- @DocsEditable
- bool isPointInRange(Node refNode, int offset) native;
+ void operator[]=(int index, Node value) {
+ throw new UnsupportedError("Cannot assign element of immutable List.");
+ }
+ // -- start List<Node> mixins.
+ // Node is the element type.
- @DomName('Range.selectNode')
- @DocsEditable
- void selectNode(Node refNode) native;
+ // From Iterable<Node>:
- @DomName('Range.selectNodeContents')
- @DocsEditable
- void selectNodeContents(Node refNode) native;
+ Iterator<Node> get iterator {
+ // Note: NodeLists are not fixed size. And most probably length shouldn't
+ // be cached in both iterator _and_ forEach method. For now caching it
+ // for consistency.
+ return new FixedSizeListIterator<Node>(this);
+ }
- @DomName('Range.setEnd')
- @DocsEditable
- void setEnd(Node refNode, int offset) native;
+ dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Node)) {
+ return IterableMixinWorkaround.reduce(this, initialValue, combine);
+ }
- @DomName('Range.setEndAfter')
- @DocsEditable
- void setEndAfter(Node refNode) native;
+ bool contains(Node element) => IterableMixinWorkaround.contains(this, element);
- @DomName('Range.setEndBefore')
- @DocsEditable
- void setEndBefore(Node refNode) native;
+ void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f);
- @DomName('Range.setStart')
- @DocsEditable
- void setStart(Node refNode, int offset) native;
+ String join([String separator]) =>
+ IterableMixinWorkaround.joinList(this, separator);
- @DomName('Range.setStartAfter')
- @DocsEditable
- void setStartAfter(Node refNode) native;
+ Iterable map(f(Node element)) =>
+ IterableMixinWorkaround.mapList(this, f);
- @DomName('Range.setStartBefore')
- @DocsEditable
- void setStartBefore(Node refNode) native;
+ Iterable<Node> where(bool f(Node element)) =>
+ IterableMixinWorkaround.where(this, f);
- @DomName('Range.surroundContents')
- @DocsEditable
- void surroundContents(Node newParent) native;
+ Iterable expand(Iterable f(Node element)) =>
+ IterableMixinWorkaround.expand(this, f);
- @DomName('Range.toString')
- @DocsEditable
- String toString() native;
+ bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
+ List<Node> toList({ bool growable: true }) =>
+ new List<Node>.from(this, growable: growable);
-@DocsEditable
-@DomName('RangeException')
-class RangeException native "*RangeException" {
+ Set<Node> toSet() => new Set<Node>.from(this);
- static const int BAD_BOUNDARYPOINTS_ERR = 1;
+ bool get isEmpty => this.length == 0;
- static const int INVALID_NODE_TYPE_ERR = 2;
+ Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
- @DomName('RangeException.code')
- @DocsEditable
- final int code;
+ Iterable<Node> takeWhile(bool test(Node value)) {
+ return IterableMixinWorkaround.takeWhile(this, test);
+ }
- @DomName('RangeException.message')
- @DocsEditable
- final String message;
+ Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
- @DomName('RangeException.name')
- @DocsEditable
- final String name;
+ Iterable<Node> skipWhile(bool test(Node value)) {
+ return IterableMixinWorkaround.skipWhile(this, test);
+ }
- @DomName('RangeException.toString')
- @DocsEditable
- String toString() native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ Node firstWhere(bool test(Node value), { Node orElse() }) {
+ return IterableMixinWorkaround.firstWhere(this, test, orElse);
+ }
-// WARNING: Do not edit - generated code.
+ Node lastWhere(bool test(Node value), {Node orElse()}) {
+ return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+ }
+ Node singleWhere(bool test(Node value)) {
+ return IterableMixinWorkaround.singleWhere(this, test);
+ }
-typedef void RequestAnimationFrameCallback(num highResTime);
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ Node elementAt(int index) {
+ return this[index];
+ }
+ // From Collection<Node>:
-@DocsEditable
-@DomName('RTCDataChannel')
-class RtcDataChannel extends EventTarget native "*RTCDataChannel" {
+ void add(Node value) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('RTCDataChannel.closeEvent')
- @DocsEditable
- static const EventStreamProvider<Event> closeEvent = const EventStreamProvider<Event>('close');
+ void addLast(Node value) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('RTCDataChannel.errorEvent')
- @DocsEditable
- static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
+ void addAll(Iterable<Node> iterable) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('RTCDataChannel.messageEvent')
- @DocsEditable
- static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
+ // From List<Node>:
+ void set length(int value) {
+ throw new UnsupportedError("Cannot resize immutable List.");
+ }
- @DomName('RTCDataChannel.openEvent')
- @DocsEditable
- static const EventStreamProvider<Event> openEvent = const EventStreamProvider<Event>('open');
+ void clear() {
+ throw new UnsupportedError("Cannot clear immutable List.");
+ }
- @DomName('RTCDataChannel.binaryType')
- @DocsEditable
- String binaryType;
+ Iterable<Node> get reversed {
+ return IterableMixinWorkaround.reversedList(this);
+ }
- @DomName('RTCDataChannel.bufferedAmount')
- @DocsEditable
- final int bufferedAmount;
+ void sort([int compare(Node a, Node b)]) {
+ throw new UnsupportedError("Cannot sort immutable List.");
+ }
- @DomName('RTCDataChannel.label')
- @DocsEditable
- final String label;
+ int indexOf(Node element, [int start = 0]) =>
+ Lists.indexOf(this, element, start, this.length);
- @DomName('RTCDataChannel.readyState')
- @DocsEditable
- final String readyState;
+ int lastIndexOf(Node element, [int start]) {
+ if (start == null) start = length - 1;
+ return Lists.lastIndexOf(this, element, start);
+ }
- @DomName('RTCDataChannel.reliable')
- @DocsEditable
- final bool reliable;
+ Node get first {
+ if (this.length > 0) return this[0];
+ throw new StateError("No elements");
+ }
- @JSName('addEventListener')
- @DomName('RTCDataChannel.addEventListener')
- @DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+ Node get last {
+ if (this.length > 0) return this[this.length - 1];
+ throw new StateError("No elements");
+ }
- @DomName('RTCDataChannel.close')
- @DocsEditable
- void close() native;
+ Node get single {
+ if (length == 1) return this[0];
+ if (length == 0) throw new StateError("No elements");
+ throw new StateError("More than one element");
+ }
- @DomName('RTCDataChannel.dispatchEvent')
- @DocsEditable
- bool dispatchEvent(Event event) native;
+ Node min([int compare(Node a, Node b)]) =>
+ IterableMixinWorkaround.min(this, compare);
- @JSName('removeEventListener')
- @DomName('RTCDataChannel.removeEventListener')
- @DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ Node max([int compare(Node a, Node b)]) =>
+ IterableMixinWorkaround.max(this, compare);
- @DomName('RTCDataChannel.send')
- @DocsEditable
- void send(data) native;
+ Node removeAt(int pos) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('RTCDataChannel.onclose')
- @DocsEditable
- Stream<Event> get onClose => closeEvent.forTarget(this);
+ Node removeLast() {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('RTCDataChannel.onerror')
- @DocsEditable
- Stream<Event> get onError => errorEvent.forTarget(this);
+ void remove(Object object) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('RTCDataChannel.onmessage')
- @DocsEditable
- Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
+ void removeAll(Iterable elements) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('RTCDataChannel.onopen')
- @DocsEditable
- Stream<Event> get onOpen => openEvent.forTarget(this);
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ void retainAll(Iterable elements) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+ void removeWhere(bool test(Node element)) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
-@DocsEditable
-@DomName('RTCDataChannelEvent')
-class RtcDataChannelEvent extends Event native "*RTCDataChannelEvent" {
+ void retainWhere(bool test(Node element)) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('RTCDataChannelEvent.channel')
- @DocsEditable
- final RtcDataChannel channel;
-}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ void setRange(int start, int rangeLength, List<Node> from, [int startFrom]) {
+ throw new UnsupportedError("Cannot setRange on immutable List.");
+ }
+ void removeRange(int start, int rangeLength) {
+ throw new UnsupportedError("Cannot removeRange on immutable List.");
+ }
-@DomName('RTCIceCandidate')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Experimental
-class RtcIceCandidate native "*RTCIceCandidate" {
- factory RtcIceCandidate(Map dictionary) {
- return JS('RtcIceCandidate', 'new RTCIceCandidate(#)',
- convertDartToNative_SerializedScriptValue(dictionary));
+ void insertRange(int start, int rangeLength, [Node initialValue]) {
+ throw new UnsupportedError("Cannot insertRange on immutable List.");
}
- @DomName('RTCIceCandidate.candidate')
- @DocsEditable
- final String candidate;
+ List<Node> getRange(int start, int rangeLength) =>
+ Lists.getRange(this, start, rangeLength, <Node>[]);
- @DomName('RTCIceCandidate.sdpMLineIndex')
- @DocsEditable
- final int sdpMLineIndex;
+ Map<int, Node> asMap() =>
+ IterableMixinWorkaround.asMapList(this);
- @DomName('RTCIceCandidate.sdpMid')
- @DocsEditable
- final String sdpMid;
+ // -- end List<Node> mixins.
+ @JSName('item')
+ @DomName('NodeList.item')
+ @DocsEditable
+ Node _item(int index) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -19297,369 +16734,306 @@ class RtcIceCandidate native "*RTCIceCandidate" {
@DocsEditable
-@DomName('RTCIceCandidateEvent')
-class RtcIceCandidateEvent extends Event native "*RTCIceCandidateEvent" {
+@DomName('Notation')
+class Notation extends Node native "*Notation" {
- @DomName('RTCIceCandidateEvent.candidate')
+ @DomName('Notation.publicId')
@DocsEditable
- final RtcIceCandidate candidate;
+ final String publicId;
+
+ @DomName('Notation.systemId')
+ @DocsEditable
+ final String systemId;
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DomName('RTCPeerConnection')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Experimental
-class RtcPeerConnection extends EventTarget native "*RTCPeerConnection" {
- factory RtcPeerConnection(Map rtcIceServers, [Map mediaConstraints]) {
- var constructorName = JS('RtcPeerConnection', 'window[#]',
- '${Device.propertyPrefix}RTCPeerConnection');
- if (?mediaConstraints) {
- return JS('RtcPeerConnection', 'new #(#,#)', constructorName,
- convertDartToNative_SerializedScriptValue(rtcIceServers),
- convertDartToNative_SerializedScriptValue(mediaConstraints));
+@DomName('Notification')
+class Notification extends EventTarget native "*Notification" {
+ factory Notification(String title, [Map options]) {
+ if (?options) {
+ return JS('Notification', 'new Notification(#,#)', title,
+ convertDartToNative_SerializedScriptValue(options));
} else {
- return JS('RtcPeerConnection', 'new #(#)', constructorName,
- convertDartToNative_SerializedScriptValue(rtcIceServers));
- }
- }
-
- /**
- * Checks if Real Time Communication (RTC) APIs are supported and enabled on
- * the current platform.
- */
- static bool get supported {
- // Currently in Firefox some of the RTC elements are defined but throw an
- // error unless the user has specifically enabled them in their
- // about:config. So we have to construct an element to actually test if RTC
- // is supported at at the given time.
- try {
- var c = new RtcPeerConnection({"iceServers": [ {"url":"stun:foo.com"}]});
- return c is RtcPeerConnection;
- } catch (_) {}
- return false;
- }
-
- @DomName('RTCPeerConnection.addstreamEvent')
- @DocsEditable
- static const EventStreamProvider<MediaStreamEvent> addStreamEvent = const EventStreamProvider<MediaStreamEvent>('addstream');
-
- @DomName('RTCPeerConnection.datachannelEvent')
- @DocsEditable
- static const EventStreamProvider<RtcDataChannelEvent> dataChannelEvent = const EventStreamProvider<RtcDataChannelEvent>('datachannel');
-
- @DomName('RTCPeerConnection.gatheringchangeEvent')
- @DocsEditable
- static const EventStreamProvider<Event> gatheringChangeEvent = const EventStreamProvider<Event>('gatheringchange');
-
- @DomName('RTCPeerConnection.icecandidateEvent')
- @DocsEditable
- static const EventStreamProvider<RtcIceCandidateEvent> iceCandidateEvent = const EventStreamProvider<RtcIceCandidateEvent>('icecandidate');
-
- @DomName('RTCPeerConnection.icechangeEvent')
- @DocsEditable
- static const EventStreamProvider<Event> iceChangeEvent = const EventStreamProvider<Event>('icechange');
+ return JS('Notification', 'new Notification(#)', title);
+ }
+ }
- @DomName('RTCPeerConnection.negotiationneededEvent')
+ @DomName('Notification.clickEvent')
@DocsEditable
- static const EventStreamProvider<Event> negotiationNeededEvent = const EventStreamProvider<Event>('negotiationneeded');
+ static const EventStreamProvider<Event> clickEvent = const EventStreamProvider<Event>('click');
- @DomName('RTCPeerConnection.removestreamEvent')
+ @DomName('Notification.closeEvent')
@DocsEditable
- static const EventStreamProvider<MediaStreamEvent> removeStreamEvent = const EventStreamProvider<MediaStreamEvent>('removestream');
+ static const EventStreamProvider<Event> closeEvent = const EventStreamProvider<Event>('close');
- @DomName('RTCPeerConnection.statechangeEvent')
+ @DomName('Notification.displayEvent')
@DocsEditable
- static const EventStreamProvider<Event> stateChangeEvent = const EventStreamProvider<Event>('statechange');
+ static const EventStreamProvider<Event> displayEvent = const EventStreamProvider<Event>('display');
- @DomName('RTCPeerConnection.iceConnectionState')
+ @DomName('Notification.errorEvent')
@DocsEditable
- final String iceConnectionState;
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
- @DomName('RTCPeerConnection.iceGatheringState')
+ @DomName('Notification.showEvent')
@DocsEditable
- final String iceGatheringState;
+ static const EventStreamProvider<Event> showEvent = const EventStreamProvider<Event>('show');
- @DomName('RTCPeerConnection.localDescription')
+ @DomName('Notification.dir')
@DocsEditable
- final RtcSessionDescription localDescription;
+ String dir;
- @DomName('RTCPeerConnection.readyState')
+ @DomName('Notification.permission')
@DocsEditable
- final String readyState;
+ final String permission;
- @DomName('RTCPeerConnection.remoteDescription')
+ @DomName('Notification.replaceId')
@DocsEditable
- final RtcSessionDescription remoteDescription;
+ String replaceId;
- @DomName('RTCPeerConnection.signalingState')
+ @DomName('Notification.tag')
@DocsEditable
- final String signalingState;
+ String tag;
@JSName('addEventListener')
- @DomName('RTCPeerConnection.addEventListener')
+ @DomName('Notification.addEventListener')
@DocsEditable
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('RTCPeerConnection.addIceCandidate')
+ @DomName('Notification.cancel')
@DocsEditable
- void addIceCandidate(RtcIceCandidate candidate) native;
+ void cancel() native;
- @DomName('RTCPeerConnection.addStream')
+ @DomName('Notification.close')
@DocsEditable
- void addStream(MediaStream stream, [Map mediaConstraints]) {
- if (?mediaConstraints) {
- var mediaConstraints_1 = convertDartToNative_Dictionary(mediaConstraints);
- _addStream_1(stream, mediaConstraints_1);
- return;
- }
- _addStream_2(stream);
- return;
- }
- @JSName('addStream')
- @DomName('RTCPeerConnection.addStream')
+ void close() native;
+
+ @DomName('Notification.dispatchEvent')
@DocsEditable
- void _addStream_1(MediaStream stream, mediaConstraints) native;
- @JSName('addStream')
- @DomName('RTCPeerConnection.addStream')
+ bool dispatchEvent(Event evt) native;
+
+ @JSName('removeEventListener')
+ @DomName('Notification.removeEventListener')
@DocsEditable
- void _addStream_2(MediaStream stream) native;
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('RTCPeerConnection.close')
+ @JSName('requestPermission')
+ @DomName('Notification.requestPermission')
@DocsEditable
- void close() native;
+ static void _requestPermission([_NotificationPermissionCallback callback]) native;
- @DomName('RTCPeerConnection.createAnswer')
+ @JSName('requestPermission')
+ @DomName('Notification.requestPermission')
@DocsEditable
- void _createAnswer(_RtcSessionDescriptionCallback successCallback, [_RtcErrorCallback failureCallback, Map mediaConstraints]) {
- if (?mediaConstraints) {
- var mediaConstraints_1 = convertDartToNative_Dictionary(mediaConstraints);
- __createAnswer_1(successCallback, failureCallback, mediaConstraints_1);
- return;
- }
- __createAnswer_2(successCallback, failureCallback);
- return;
+ static Future<String> requestPermission() {
+ var completer = new Completer<String>();
+ _requestPermission(
+ (value) { completer.complete(value); });
+ return completer.future;
}
- @JSName('createAnswer')
- @DomName('RTCPeerConnection.createAnswer')
+
+ @DomName('Notification.show')
@DocsEditable
- void __createAnswer_1(_RtcSessionDescriptionCallback successCallback, _RtcErrorCallback failureCallback, mediaConstraints) native;
- @JSName('createAnswer')
- @DomName('RTCPeerConnection.createAnswer')
+ void show() native;
+
+ @DomName('Notification.onclick')
@DocsEditable
- void __createAnswer_2(_RtcSessionDescriptionCallback successCallback, _RtcErrorCallback failureCallback) native;
+ Stream<Event> get onClick => clickEvent.forTarget(this);
- @JSName('createAnswer')
- @DomName('RTCPeerConnection.createAnswer')
+ @DomName('Notification.onclose')
@DocsEditable
- Future<RtcSessionDescription> createAnswer([Map mediaConstraints]) {
- var completer = new Completer<RtcSessionDescription>();
- _createAnswer(mediaConstraints,
- (value) { completer.complete(value); },
- (error) { completer.completeError(error); });
- return completer.future;
- }
+ Stream<Event> get onClose => closeEvent.forTarget(this);
- @JSName('createDTMFSender')
- @DomName('RTCPeerConnection.createDTMFSender')
+ @DomName('Notification.ondisplay')
@DocsEditable
- RtcdtmfSender createDtmfSender(MediaStreamTrack track) native;
+ Stream<Event> get onDisplay => displayEvent.forTarget(this);
- @DomName('RTCPeerConnection.createDataChannel')
+ @DomName('Notification.onerror')
@DocsEditable
- RtcDataChannel createDataChannel(String label, [Map options]) {
- if (?options) {
- var options_1 = convertDartToNative_Dictionary(options);
- return _createDataChannel_1(label, options_1);
- }
- return _createDataChannel_2(label);
- }
- @JSName('createDataChannel')
- @DomName('RTCPeerConnection.createDataChannel')
+ Stream<Event> get onError => errorEvent.forTarget(this);
+
+ @DomName('Notification.onshow')
@DocsEditable
- RtcDataChannel _createDataChannel_1(label, options) native;
- @JSName('createDataChannel')
- @DomName('RTCPeerConnection.createDataChannel')
+ Stream<Event> get onShow => showEvent.forTarget(this);
+
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('NotificationCenter')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.SAFARI)
+@Experimental
+class NotificationCenter native "*NotificationCenter" {
+
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => JS('bool', '!!(window.webkitNotifications)');
+
+ @DomName('NotificationCenter.checkPermission')
@DocsEditable
- RtcDataChannel _createDataChannel_2(label) native;
+ int checkPermission() native;
- @DomName('RTCPeerConnection.createOffer')
+ @JSName('createHTMLNotification')
+ @DomName('NotificationCenter.createHTMLNotification')
@DocsEditable
- void _createOffer(_RtcSessionDescriptionCallback successCallback, [_RtcErrorCallback failureCallback, Map mediaConstraints]) {
- if (?mediaConstraints) {
- var mediaConstraints_1 = convertDartToNative_Dictionary(mediaConstraints);
- __createOffer_1(successCallback, failureCallback, mediaConstraints_1);
- return;
- }
- __createOffer_2(successCallback, failureCallback);
- return;
- }
- @JSName('createOffer')
- @DomName('RTCPeerConnection.createOffer')
+ Notification createHtmlNotification(String url) native;
+
+ @DomName('NotificationCenter.createNotification')
@DocsEditable
- void __createOffer_1(_RtcSessionDescriptionCallback successCallback, _RtcErrorCallback failureCallback, mediaConstraints) native;
- @JSName('createOffer')
- @DomName('RTCPeerConnection.createOffer')
+ Notification createNotification(String iconUrl, String title, String body) native;
+
+ @JSName('requestPermission')
+ @DomName('NotificationCenter.requestPermission')
@DocsEditable
- void __createOffer_2(_RtcSessionDescriptionCallback successCallback, _RtcErrorCallback failureCallback) native;
+ void _requestPermission([VoidCallback callback]) native;
- @JSName('createOffer')
- @DomName('RTCPeerConnection.createOffer')
+ @JSName('requestPermission')
+ @DomName('NotificationCenter.requestPermission')
@DocsEditable
- Future<RtcSessionDescription> createOffer([Map mediaConstraints]) {
- var completer = new Completer<RtcSessionDescription>();
- _createOffer(mediaConstraints,
- (value) { completer.complete(value); },
- (error) { completer.completeError(error); });
+ Future requestPermission() {
+ var completer = new Completer();
+ _requestPermission(
+ () { completer.complete(); });
return completer.future;
}
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('RTCPeerConnection.dispatchEvent')
- @DocsEditable
- bool dispatchEvent(Event event) native;
+// WARNING: Do not edit - generated code.
- @DomName('RTCPeerConnection.getLocalStreams')
- @DocsEditable
- List<MediaStream> getLocalStreams() native;
- @DomName('RTCPeerConnection.getRemoteStreams')
- @DocsEditable
- List<MediaStream> getRemoteStreams() native;
+typedef void _NotificationPermissionCallback(String permission);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('RTCPeerConnection.getStats')
- @DocsEditable
- void getStats(RtcStatsCallback successCallback, MediaStreamTrack selector) native;
- @JSName('removeEventListener')
- @DomName('RTCPeerConnection.removeEventListener')
+@DocsEditable
+@DomName('HTMLOListElement')
+class OListElement extends Element native "*HTMLOListElement" {
+
+ @DomName('HTMLOListElement.HTMLOListElement')
@DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ factory OListElement() => document.$dom_createElement("ol");
- @DomName('RTCPeerConnection.removeStream')
+ @DomName('HTMLOListElement.reversed')
@DocsEditable
- void removeStream(MediaStream stream) native;
+ bool reversed;
- @JSName('setLocalDescription')
- @DomName('RTCPeerConnection.setLocalDescription')
+ @DomName('HTMLOListElement.start')
@DocsEditable
- void _setLocalDescription(RtcSessionDescription description, [VoidCallback successCallback, _RtcErrorCallback failureCallback]) native;
+ int start;
- @JSName('setLocalDescription')
- @DomName('RTCPeerConnection.setLocalDescription')
+ @DomName('HTMLOListElement.type')
@DocsEditable
- Future setLocalDescription(RtcSessionDescription description) {
- var completer = new Completer();
- _setLocalDescription(description,
- () { completer.complete(); },
- (error) { completer.completeError(error); });
- return completer.future;
- }
+ String type;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('HTMLObjectElement')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.IE)
+@SupportedBrowser(SupportedBrowser.SAFARI)
+class ObjectElement extends Element native "*HTMLObjectElement" {
- @JSName('setRemoteDescription')
- @DomName('RTCPeerConnection.setRemoteDescription')
+ @DomName('HTMLObjectElement.HTMLObjectElement')
@DocsEditable
- void _setRemoteDescription(RtcSessionDescription description, [VoidCallback successCallback, _RtcErrorCallback failureCallback]) native;
+ factory ObjectElement() => document.$dom_createElement("object");
- @JSName('setRemoteDescription')
- @DomName('RTCPeerConnection.setRemoteDescription')
- @DocsEditable
- Future setRemoteDescription(RtcSessionDescription description) {
- var completer = new Completer();
- _setRemoteDescription(description,
- () { completer.complete(); },
- (error) { completer.completeError(error); });
- return completer.future;
- }
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => Element.isTagSupported('object');
- @DomName('RTCPeerConnection.updateIce')
+ @DomName('HTMLObjectElement.code')
@DocsEditable
- void updateIce([Map configuration, Map mediaConstraints]) {
- if (?mediaConstraints) {
- var configuration_1 = convertDartToNative_Dictionary(configuration);
- var mediaConstraints_2 = convertDartToNative_Dictionary(mediaConstraints);
- _updateIce_1(configuration_1, mediaConstraints_2);
- return;
- }
- if (?configuration) {
- var configuration_3 = convertDartToNative_Dictionary(configuration);
- _updateIce_2(configuration_3);
- return;
- }
- _updateIce_3();
- return;
- }
- @JSName('updateIce')
- @DomName('RTCPeerConnection.updateIce')
+ String code;
+
+ @DomName('HTMLObjectElement.data')
@DocsEditable
- void _updateIce_1(configuration, mediaConstraints) native;
- @JSName('updateIce')
- @DomName('RTCPeerConnection.updateIce')
+ String data;
+
+ @DomName('HTMLObjectElement.form')
@DocsEditable
- void _updateIce_2(configuration) native;
- @JSName('updateIce')
- @DomName('RTCPeerConnection.updateIce')
+ final FormElement form;
+
+ @DomName('HTMLObjectElement.height')
@DocsEditable
- void _updateIce_3() native;
+ String height;
- @DomName('RTCPeerConnection.onaddstream')
+ @DomName('HTMLObjectElement.name')
@DocsEditable
- Stream<MediaStreamEvent> get onAddStream => addStreamEvent.forTarget(this);
+ String name;
- @DomName('RTCPeerConnection.ondatachannel')
+ @DomName('HTMLObjectElement.type')
@DocsEditable
- Stream<RtcDataChannelEvent> get onDataChannel => dataChannelEvent.forTarget(this);
+ String type;
- @DomName('RTCPeerConnection.ongatheringchange')
+ @DomName('HTMLObjectElement.useMap')
@DocsEditable
- Stream<Event> get onGatheringChange => gatheringChangeEvent.forTarget(this);
+ String useMap;
- @DomName('RTCPeerConnection.onicecandidate')
+ @DomName('HTMLObjectElement.validationMessage')
@DocsEditable
- Stream<RtcIceCandidateEvent> get onIceCandidate => iceCandidateEvent.forTarget(this);
+ final String validationMessage;
- @DomName('RTCPeerConnection.onicechange')
+ @DomName('HTMLObjectElement.validity')
@DocsEditable
- Stream<Event> get onIceChange => iceChangeEvent.forTarget(this);
+ final ValidityState validity;
- @DomName('RTCPeerConnection.onnegotiationneeded')
+ @DomName('HTMLObjectElement.width')
@DocsEditable
- Stream<Event> get onNegotiationNeeded => negotiationNeededEvent.forTarget(this);
+ String width;
- @DomName('RTCPeerConnection.onremovestream')
+ @DomName('HTMLObjectElement.willValidate')
@DocsEditable
- Stream<MediaStreamEvent> get onRemoveStream => removeStreamEvent.forTarget(this);
+ final bool willValidate;
- @DomName('RTCPeerConnection.onstatechange')
+ @DomName('HTMLObjectElement.checkValidity')
@DocsEditable
- Stream<Event> get onStateChange => stateChangeEvent.forTarget(this);
+ bool checkValidity() native;
+ @DomName('HTMLObjectElement.setCustomValidity')
+ @DocsEditable
+ void setCustomValidity(String error) native;
}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+@DocsEditable
+@DomName('OESElementIndexUint')
+class OesElementIndexUint native "*OESElementIndexUint" {
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DomName('RTCSessionDescription')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@Experimental
-class RtcSessionDescription native "*RTCSessionDescription" {
- factory RtcSessionDescription(Map dictionary) {
- return JS('RtcSessionDescription', 'new RTCSessionDescription(#)',
- convertDartToNative_SerializedScriptValue(dictionary));
- }
+@DocsEditable
+@DomName('OESStandardDerivatives')
+class OesStandardDerivatives native "*OESStandardDerivatives" {
- @DomName('RTCSessionDescription.sdp')
- @DocsEditable
- String sdp;
+ static const int FRAGMENT_SHADER_DERIVATIVE_HINT_OES = 0x8B8B;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('RTCSessionDescription.type')
- @DocsEditable
- String type;
+@DocsEditable
+@DomName('OESTextureFloat')
+class OesTextureFloat native "*OESTextureFloat" {
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -19667,22 +17041,39 @@ class RtcSessionDescription native "*RTCSessionDescription" {
@DocsEditable
-@DomName('RTCStatsElement')
-class RtcStatsElement native "*RTCStatsElement" {
+@DomName('OESTextureHalfFloat')
+class OesTextureHalfFloat native "*OESTextureHalfFloat" {
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- DateTime get timestamp => _convertNativeToDart_DateTime(this._get_timestamp);
- @JSName('timestamp')
- @DomName('RTCStatsElement.timestamp')
+
+@DocsEditable
+@DomName('OESVertexArrayObject')
+class OesVertexArrayObject native "*OESVertexArrayObject" {
+
+ static const int VERTEX_ARRAY_BINDING_OES = 0x85B5;
+
+ @JSName('bindVertexArrayOES')
+ @DomName('OESVertexArrayObject.bindVertexArrayOES')
@DocsEditable
- final dynamic _get_timestamp;
+ void bindVertexArray(WebGLVertexArrayObject arrayObject) native;
- @DomName('RTCStatsElement.names')
+ @JSName('createVertexArrayOES')
+ @DomName('OESVertexArrayObject.createVertexArrayOES')
@DocsEditable
- List<String> names() native;
+ WebGLVertexArrayObject createVertexArray() native;
- @DomName('RTCStatsElement.stat')
+ @JSName('deleteVertexArrayOES')
+ @DomName('OESVertexArrayObject.deleteVertexArrayOES')
@DocsEditable
- String stat(String name) native;
+ void deleteVertexArray(WebGLVertexArrayObject arrayObject) native;
+
+ @JSName('isVertexArrayOES')
+ @DomName('OESVertexArrayObject.isVertexArrayOES')
+ @DocsEditable
+ bool isVertexArray(WebGLVertexArrayObject arrayObject) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -19690,16 +17081,20 @@ class RtcStatsElement native "*RTCStatsElement" {
@DocsEditable
-@DomName('RTCStatsReport')
-class RtcStatsReport native "*RTCStatsReport" {
+@DomName('HTMLOptGroupElement')
+class OptGroupElement extends Element native "*HTMLOptGroupElement" {
- @DomName('RTCStatsReport.local')
+ @DomName('HTMLOptGroupElement.HTMLOptGroupElement')
@DocsEditable
- final RtcStatsElement local;
+ factory OptGroupElement() => document.$dom_createElement("optgroup");
- @DomName('RTCStatsReport.remote')
+ @DomName('HTMLOptGroupElement.disabled')
@DocsEditable
- final RtcStatsElement remote;
+ bool disabled;
+
+ @DomName('HTMLOptGroupElement.label')
+ @DocsEditable
+ String label;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -19707,12 +17102,59 @@ class RtcStatsReport native "*RTCStatsReport" {
@DocsEditable
-@DomName('RTCStatsResponse')
-class RtcStatsResponse native "*RTCStatsResponse" {
+@DomName('HTMLOptionElement')
+class OptionElement extends Element native "*HTMLOptionElement" {
- @DomName('RTCStatsResponse.result')
+ @DomName('HTMLOptionElement.HTMLOptionElement')
@DocsEditable
- List<RtcStatsReport> result() native;
+ factory OptionElement([String data, String value, bool defaultSelected, bool selected]) {
+ if (?selected) {
+ return OptionElement._create_1(data, value, defaultSelected, selected);
+ }
+ if (?defaultSelected) {
+ return OptionElement._create_2(data, value, defaultSelected);
+ }
+ if (?value) {
+ return OptionElement._create_3(data, value);
+ }
+ if (?data) {
+ return OptionElement._create_4(data);
+ }
+ return OptionElement._create_5();
+ }
+ static OptionElement _create_1(data, value, defaultSelected, selected) => JS('OptionElement', 'new Option(#,#,#,#)', data, value, defaultSelected, selected);
+ static OptionElement _create_2(data, value, defaultSelected) => JS('OptionElement', 'new Option(#,#,#)', data, value, defaultSelected);
+ static OptionElement _create_3(data, value) => JS('OptionElement', 'new Option(#,#)', data, value);
+ static OptionElement _create_4(data) => JS('OptionElement', 'new Option(#)', data);
+ static OptionElement _create_5() => JS('OptionElement', 'new Option()');
+
+ @DomName('HTMLOptionElement.defaultSelected')
+ @DocsEditable
+ bool defaultSelected;
+
+ @DomName('HTMLOptionElement.disabled')
+ @DocsEditable
+ bool disabled;
+
+ @DomName('HTMLOptionElement.form')
+ @DocsEditable
+ final FormElement form;
+
+ @DomName('HTMLOptionElement.index')
+ @DocsEditable
+ final int index;
+
+ @DomName('HTMLOptionElement.label')
+ @DocsEditable
+ String label;
+
+ @DomName('HTMLOptionElement.selected')
+ @DocsEditable
+ bool selected;
+
+ @DomName('HTMLOptionElement.value')
+ @DocsEditable
+ String value;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -19720,48 +17162,68 @@ class RtcStatsResponse native "*RTCStatsResponse" {
@DocsEditable
-@DomName('RTCDTMFSender')
-class RtcdtmfSender extends EventTarget native "*RTCDTMFSender" {
+@DomName('HTMLOutputElement')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.SAFARI)
+class OutputElement extends Element native "*HTMLOutputElement" {
+
+ @DomName('HTMLOutputElement.HTMLOutputElement')
+ @DocsEditable
+ factory OutputElement() => document.$dom_createElement("output");
+
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => Element.isTagSupported('output');
+
+ @DomName('HTMLOutputElement.defaultValue')
+ @DocsEditable
+ String defaultValue;
+
+ @DomName('HTMLOutputElement.form')
+ @DocsEditable
+ final FormElement form;
+
+ @DomName('HTMLOutputElement.htmlFor')
+ @DocsEditable
+ final DomSettableTokenList htmlFor;
- @JSName('canInsertDTMF')
- @DomName('RTCDTMFSender.canInsertDTMF')
+ @DomName('HTMLOutputElement.labels')
@DocsEditable
- final bool canInsertDtmf;
+ @Returns('NodeList')
+ @Creates('NodeList')
+ final List<Node> labels;
- @DomName('RTCDTMFSender.duration')
+ @DomName('HTMLOutputElement.name')
@DocsEditable
- final int duration;
+ String name;
- @DomName('RTCDTMFSender.interToneGap')
+ @DomName('HTMLOutputElement.type')
@DocsEditable
- final int interToneGap;
+ final String type;
- @DomName('RTCDTMFSender.toneBuffer')
+ @DomName('HTMLOutputElement.validationMessage')
@DocsEditable
- final String toneBuffer;
+ final String validationMessage;
- @DomName('RTCDTMFSender.track')
+ @DomName('HTMLOutputElement.validity')
@DocsEditable
- final MediaStreamTrack track;
+ final ValidityState validity;
- @JSName('addEventListener')
- @DomName('RTCDTMFSender.addEventListener')
+ @DomName('HTMLOutputElement.value')
@DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+ String value;
- @DomName('RTCDTMFSender.dispatchEvent')
+ @DomName('HTMLOutputElement.willValidate')
@DocsEditable
- bool dispatchEvent(Event event) native;
+ final bool willValidate;
- @JSName('insertDTMF')
- @DomName('RTCDTMFSender.insertDTMF')
+ @DomName('HTMLOutputElement.checkValidity')
@DocsEditable
- void insertDtmf(String tones, [int duration, int interToneGap]) native;
+ bool checkValidity() native;
- @JSName('removeEventListener')
- @DomName('RTCDTMFSender.removeEventListener')
+ @DomName('HTMLOutputElement.setCustomValidity')
@DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ void setCustomValidity(String error) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -19769,64 +17231,63 @@ class RtcdtmfSender extends EventTarget native "*RTCDTMFSender" {
@DocsEditable
-@DomName('RTCDTMFToneChangeEvent')
-class RtcdtmfToneChangeEvent extends Event native "*RTCDTMFToneChangeEvent" {
+@DomName('OverflowEvent')
+class OverflowEvent extends Event native "*OverflowEvent" {
- @DomName('RTCDTMFToneChangeEvent.tone')
+ static const int BOTH = 2;
+
+ static const int HORIZONTAL = 0;
+
+ static const int VERTICAL = 1;
+
+ @DomName('OverflowEvent.horizontalOverflow')
@DocsEditable
- final String tone;
+ final bool horizontalOverflow;
+
+ @DomName('OverflowEvent.orient')
+ @DocsEditable
+ final int orient;
+
+ @DomName('OverflowEvent.verticalOverflow')
+ @DocsEditable
+ final bool verticalOverflow;
}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable
-@DomName('Screen')
-class Screen native "*Screen" {
-
- @DomName('Screen.availHeight')
- @DomName('Screen.availLeft')
- @DomName('Screen.availTop')
- @DomName('Screen.availWidth')
- Rect get available => new Rect($dom_availLeft, $dom_availTop, $dom_availWidth,
- $dom_availHeight);
-
- @JSName('availHeight')
- @DomName('Screen.availHeight')
- @DocsEditable
- final int $dom_availHeight;
+@DomName('PagePopupController')
+class PagePopupController native "*PagePopupController" {
- @JSName('availLeft')
- @DomName('Screen.availLeft')
+ @DomName('PagePopupController.closePopup')
@DocsEditable
- final int $dom_availLeft;
+ void closePopup() native;
- @JSName('availTop')
- @DomName('Screen.availTop')
+ @DomName('PagePopupController.formatMonth')
@DocsEditable
- final int $dom_availTop;
+ String formatMonth(int year, int zeroBaseMonth) native;
- @JSName('availWidth')
- @DomName('Screen.availWidth')
+ @DomName('PagePopupController.formatShortMonth')
@DocsEditable
- final int $dom_availWidth;
+ String formatShortMonth(int year, int zeroBaseMonth) native;
- @DomName('Screen.colorDepth')
+ @DomName('PagePopupController.histogramEnumeration')
@DocsEditable
- final int colorDepth;
+ void histogramEnumeration(String name, int sample, int boundaryValue) native;
- @DomName('Screen.height')
+ @DomName('PagePopupController.localizeNumberString')
@DocsEditable
- final int height;
+ String localizeNumberString(String numberString) native;
- @DomName('Screen.pixelDepth')
+ @DomName('PagePopupController.setValue')
@DocsEditable
- final int pixelDepth;
+ void setValue(String value) native;
- @DomName('Screen.width')
+ @DomName('PagePopupController.setValueAndClosePopup')
@DocsEditable
- final int width;
+ void setValueAndClosePopup(int numberValue, String stringValue) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -19834,44 +17295,46 @@ class Screen native "*Screen" {
@DocsEditable
-@DomName('HTMLScriptElement')
-class ScriptElement extends Element native "*HTMLScriptElement" {
+@DomName('PageTransitionEvent')
+class PageTransitionEvent extends Event native "*PageTransitionEvent" {
- @DomName('HTMLScriptElement.HTMLScriptElement')
+ @DomName('PageTransitionEvent.persisted')
@DocsEditable
- factory ScriptElement() => document.$dom_createElement("script");
+ final bool persisted;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('HTMLScriptElement.async')
- @DocsEditable
- bool async;
- @DomName('HTMLScriptElement.charset')
- @DocsEditable
- String charset;
+@DocsEditable
+@DomName('HTMLParagraphElement')
+class ParagraphElement extends Element native "*HTMLParagraphElement" {
- @DomName('HTMLScriptElement.crossOrigin')
+ @DomName('HTMLParagraphElement.HTMLParagraphElement')
@DocsEditable
- String crossOrigin;
+ factory ParagraphElement() => document.$dom_createElement("p");
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('HTMLScriptElement.defer')
- @DocsEditable
- bool defer;
- @DomName('HTMLScriptElement.event')
- @DocsEditable
- String event;
+@DocsEditable
+@DomName('HTMLParamElement')
+class ParamElement extends Element native "*HTMLParamElement" {
- @DomName('HTMLScriptElement.htmlFor')
+ @DomName('HTMLParamElement.HTMLParamElement')
@DocsEditable
- String htmlFor;
+ factory ParamElement() => document.$dom_createElement("param");
- @DomName('HTMLScriptElement.src')
+ @DomName('HTMLParamElement.name')
@DocsEditable
- String src;
+ String name;
- @DomName('HTMLScriptElement.type')
+ @DomName('HTMLParamElement.value')
@DocsEditable
- String type;
+ String value;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -19879,24 +17342,30 @@ class ScriptElement extends Element native "*HTMLScriptElement" {
@DocsEditable
-@DomName('ScriptProfile')
-class ScriptProfile native "*ScriptProfile" {
+@DomName('Performance')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.IE)
+class Performance extends EventTarget native "*Performance" {
- @DomName('ScriptProfile.head')
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => JS('bool', '!!(window.performance)');
+
+ @DomName('Performance.memory')
@DocsEditable
- final ScriptProfileNode head;
+ final MemoryInfo memory;
- @DomName('ScriptProfile.idleTime')
+ @DomName('Performance.navigation')
@DocsEditable
- final num idleTime;
+ final PerformanceNavigation navigation;
- @DomName('ScriptProfile.title')
+ @DomName('Performance.timing')
@DocsEditable
- final String title;
+ final PerformanceTiming timing;
- @DomName('ScriptProfile.uid')
+ @DomName('Performance.now')
@DocsEditable
- final int uid;
+ num now() native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -19904,175 +17373,169 @@ class ScriptProfile native "*ScriptProfile" {
@DocsEditable
-@DomName('ScriptProfileNode')
-class ScriptProfileNode native "*ScriptProfileNode" {
-
- @JSName('callUID')
- @DomName('ScriptProfileNode.callUID')
- @DocsEditable
- final int callUid;
-
- @DomName('ScriptProfileNode.functionName')
- @DocsEditable
- final String functionName;
-
- @DomName('ScriptProfileNode.lineNumber')
- @DocsEditable
- final int lineNumber;
+@DomName('PerformanceNavigation')
+class PerformanceNavigation native "*PerformanceNavigation" {
- @DomName('ScriptProfileNode.numberOfCalls')
- @DocsEditable
- final int numberOfCalls;
+ static const int TYPE_BACK_FORWARD = 2;
- @DomName('ScriptProfileNode.selfTime')
- @DocsEditable
- final num selfTime;
+ static const int TYPE_NAVIGATE = 0;
- @DomName('ScriptProfileNode.totalTime')
- @DocsEditable
- final num totalTime;
+ static const int TYPE_RELOAD = 1;
- @DomName('ScriptProfileNode.url')
- @DocsEditable
- final String url;
+ static const int TYPE_RESERVED = 255;
- @DomName('ScriptProfileNode.visible')
+ @DomName('PerformanceNavigation.redirectCount')
@DocsEditable
- final bool visible;
+ final int redirectCount;
- @DomName('ScriptProfileNode.children')
+ @DomName('PerformanceNavigation.type')
@DocsEditable
- List<ScriptProfileNode> children() native;
+ final int type;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DomName('HTMLSelectElement')
-class SelectElement extends Element native "*HTMLSelectElement" {
+@DocsEditable
+@DomName('PerformanceTiming')
+class PerformanceTiming native "*PerformanceTiming" {
- @DomName('HTMLSelectElement.HTMLSelectElement')
+ @DomName('PerformanceTiming.connectEnd')
@DocsEditable
- factory SelectElement() => document.$dom_createElement("select");
+ final int connectEnd;
- @DomName('HTMLSelectElement.autofocus')
+ @DomName('PerformanceTiming.connectStart')
@DocsEditable
- bool autofocus;
+ final int connectStart;
- @DomName('HTMLSelectElement.disabled')
+ @DomName('PerformanceTiming.domComplete')
@DocsEditable
- bool disabled;
+ final int domComplete;
- @DomName('HTMLSelectElement.form')
+ @DomName('PerformanceTiming.domContentLoadedEventEnd')
@DocsEditable
- final FormElement form;
+ final int domContentLoadedEventEnd;
+
+ @DomName('PerformanceTiming.domContentLoadedEventStart')
+ @DocsEditable
+ final int domContentLoadedEventStart;
- @DomName('HTMLSelectElement.labels')
+ @DomName('PerformanceTiming.domInteractive')
@DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- final List<Node> labels;
+ final int domInteractive;
- @DomName('HTMLSelectElement.length')
+ @DomName('PerformanceTiming.domLoading')
@DocsEditable
- int length;
+ final int domLoading;
- @DomName('HTMLSelectElement.multiple')
+ @DomName('PerformanceTiming.domainLookupEnd')
@DocsEditable
- bool multiple;
+ final int domainLookupEnd;
- @DomName('HTMLSelectElement.name')
+ @DomName('PerformanceTiming.domainLookupStart')
@DocsEditable
- String name;
+ final int domainLookupStart;
- @DomName('HTMLSelectElement.required')
+ @DomName('PerformanceTiming.fetchStart')
@DocsEditable
- bool required;
+ final int fetchStart;
- @DomName('HTMLSelectElement.selectedIndex')
+ @DomName('PerformanceTiming.loadEventEnd')
@DocsEditable
- int selectedIndex;
+ final int loadEventEnd;
- @DomName('HTMLSelectElement.size')
+ @DomName('PerformanceTiming.loadEventStart')
@DocsEditable
- int size;
+ final int loadEventStart;
- @DomName('HTMLSelectElement.type')
+ @DomName('PerformanceTiming.navigationStart')
@DocsEditable
- final String type;
+ final int navigationStart;
- @DomName('HTMLSelectElement.validationMessage')
+ @DomName('PerformanceTiming.redirectEnd')
@DocsEditable
- final String validationMessage;
+ final int redirectEnd;
- @DomName('HTMLSelectElement.validity')
+ @DomName('PerformanceTiming.redirectStart')
@DocsEditable
- final ValidityState validity;
+ final int redirectStart;
- @DomName('HTMLSelectElement.value')
+ @DomName('PerformanceTiming.requestStart')
@DocsEditable
- String value;
+ final int requestStart;
- @DomName('HTMLSelectElement.willValidate')
+ @DomName('PerformanceTiming.responseEnd')
@DocsEditable
- final bool willValidate;
+ final int responseEnd;
- @DomName('HTMLSelectElement.checkValidity')
+ @DomName('PerformanceTiming.responseStart')
@DocsEditable
- bool checkValidity() native;
+ final int responseStart;
- @DomName('HTMLSelectElement.item')
+ @DomName('PerformanceTiming.secureConnectionStart')
@DocsEditable
- Node item(int index) native;
+ final int secureConnectionStart;
- @DomName('HTMLSelectElement.namedItem')
+ @DomName('PerformanceTiming.unloadEventEnd')
@DocsEditable
- Node namedItem(String name) native;
+ final int unloadEventEnd;
- @DomName('HTMLSelectElement.setCustomValidity')
+ @DomName('PerformanceTiming.unloadEventStart')
@DocsEditable
- void setCustomValidity(String error) native;
+ final int unloadEventStart;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- // Override default options, since IE returns SelectElement itself and it
- // does not operate as a List.
- List<OptionElement> get options {
- var options = this.children.where((e) => e is OptionElement).toList();
- return new UnmodifiableListView<OptionElement>(options);
- }
+@DocsEditable
+@DomName('PopStateEvent')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.IE, '10')
+@SupportedBrowser(SupportedBrowser.SAFARI)
+class PopStateEvent extends Event native "*PopStateEvent" {
- List<OptionElement> get selectedOptions {
- // IE does not change the selected flag for single-selection items.
- if (this.multiple) {
- var options = this.options.where((o) => o.selected).toList();
- return new UnmodifiableListView<OptionElement>(options);
- } else {
- return [this.options[this.selectedIndex]];
- }
- }
+ dynamic get state => convertNativeToDart_SerializedScriptValue(this._get_state);
+ @JSName('state')
+ @DomName('PopStateEvent.state')
+ @DocsEditable
+ @annotation_Creates_SerializedScriptValue
+ @annotation_Returns_SerializedScriptValue
+ final dynamic _get_state;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// WARNING: Do not edit - generated code.
+
+
+typedef void _PositionCallback(Geoposition position);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
@DocsEditable
-@DomName('HTMLShadowElement')
-@SupportedBrowser(SupportedBrowser.CHROME, '26')
-@Experimental
-class ShadowElement extends Element native "*HTMLShadowElement" {
+@DomName('PositionError')
+class PositionError native "*PositionError" {
- /// Checks if this type is supported on the current platform.
- static bool get supported => Element.isTagSupported('shadow');
+ static const int PERMISSION_DENIED = 1;
- @DomName('HTMLShadowElement.olderShadowRoot')
+ static const int POSITION_UNAVAILABLE = 2;
+
+ static const int TIMEOUT = 3;
+
+ @DomName('PositionError.code')
@DocsEditable
- final ShadowRoot olderShadowRoot;
+ final int code;
- @DomName('HTMLShadowElement.resetStyleInheritance')
+ @DomName('PositionError.message')
@DocsEditable
- bool resetStyleInheritance;
+ final String message;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -20081,59 +17544,82 @@ class ShadowElement extends Element native "*HTMLShadowElement" {
// WARNING: Do not edit - generated code.
-@DomName('ShadowRoot')
-@SupportedBrowser(SupportedBrowser.CHROME, '26')
-@Experimental
-class ShadowRoot extends DocumentFragment native "*ShadowRoot" {
+typedef void _PositionErrorCallback(PositionError error);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('ShadowRoot.activeElement')
- @DocsEditable
- final Element activeElement;
- @DomName('ShadowRoot.applyAuthorStyles')
+@DocsEditable
+@DomName('HTMLPreElement')
+class PreElement extends Element native "*HTMLPreElement" {
+
+ @DomName('HTMLPreElement.HTMLPreElement')
@DocsEditable
- bool applyAuthorStyles;
+ factory PreElement() => document.$dom_createElement("pre");
- @JSName('innerHTML')
- @DomName('ShadowRoot.innerHTML')
+ @DomName('HTMLPreElement.wrap')
@DocsEditable
- String innerHtml;
+ bool wrap;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('ShadowRoot.resetStyleInheritance')
+
+@DocsEditable
+@DomName('ProcessingInstruction')
+class ProcessingInstruction extends Node native "*ProcessingInstruction" {
+
+ @DomName('ProcessingInstruction.data')
@DocsEditable
- bool resetStyleInheritance;
+ String data;
- @JSName('cloneNode')
- @DomName('ShadowRoot.cloneNode')
+ @DomName('ProcessingInstruction.sheet')
@DocsEditable
- Node clone(bool deep) native;
+ final StyleSheet sheet;
- @DomName('ShadowRoot.elementFromPoint')
+ @DomName('ProcessingInstruction.target')
@DocsEditable
- Element elementFromPoint(int x, int y) native;
+ final String target;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('ShadowRoot.getElementById')
+
+@DocsEditable
+@DomName('HTMLProgressElement')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.FIREFOX)
+@SupportedBrowser(SupportedBrowser.IE, '10')
+@SupportedBrowser(SupportedBrowser.SAFARI)
+class ProgressElement extends Element native "*HTMLProgressElement" {
+
+ @DomName('HTMLProgressElement.HTMLProgressElement')
@DocsEditable
- Element getElementById(String elementId) native;
+ factory ProgressElement() => document.$dom_createElement("progress");
- @DomName('ShadowRoot.getElementsByClassName')
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => Element.isTagSupported('progress');
+
+ @DomName('HTMLProgressElement.labels')
@DocsEditable
@Returns('NodeList')
@Creates('NodeList')
- List<Node> getElementsByClassName(String className) native;
+ final List<Node> labels;
- @DomName('ShadowRoot.getElementsByTagName')
+ @DomName('HTMLProgressElement.max')
@DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- List<Node> getElementsByTagName(String tagName) native;
+ num max;
- @DomName('ShadowRoot.getSelection')
+ @DomName('HTMLProgressElement.position')
@DocsEditable
- DomSelection getSelection() native;
+ final num position;
- static bool get supported =>
- JS('bool', '!!(Element.prototype.webkitCreateShadowRoot)');
+ @DomName('HTMLProgressElement.value')
+ @DocsEditable
+ num value;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -20141,310 +17627,345 @@ class ShadowRoot extends DocumentFragment native "*ShadowRoot" {
@DocsEditable
-@DomName('SharedWorker')
-class SharedWorker extends AbstractWorker native "*SharedWorker" {
+@DomName('ProgressEvent')
+class ProgressEvent extends Event native "*ProgressEvent" {
- @DomName('SharedWorker.SharedWorker')
+ @DomName('ProgressEvent.lengthComputable')
@DocsEditable
- factory SharedWorker(String scriptURL, [String name]) {
- if (?name) {
- return SharedWorker._create_1(scriptURL, name);
- }
- return SharedWorker._create_2(scriptURL);
- }
- static SharedWorker _create_1(scriptURL, name) => JS('SharedWorker', 'new SharedWorker(#,#)', scriptURL, name);
- static SharedWorker _create_2(scriptURL) => JS('SharedWorker', 'new SharedWorker(#)', scriptURL);
+ final bool lengthComputable;
- @DomName('SharedWorker.port')
+ @DomName('ProgressEvent.loaded')
@DocsEditable
- final MessagePort port;
+ final int loaded;
+
+ @DomName('ProgressEvent.total')
+ @DocsEditable
+ final int total;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('HTMLQuoteElement')
+class QuoteElement extends Element native "*HTMLQuoteElement" {
+
+ @DomName('HTMLQuoteElement.cite')
+ @DocsEditable
+ String cite;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// WARNING: Do not edit - generated code.
+
+
+typedef void _RtcErrorCallback(String errorInformation);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
-@DocsEditable
-@DomName('SharedWorkerContext')
-class SharedWorkerContext extends WorkerContext native "*SharedWorkerContext" {
-
- @DomName('SharedWorkerContext.connectEvent')
- @DocsEditable
- static const EventStreamProvider<Event> connectEvent = const EventStreamProvider<Event>('connect');
-
- @DomName('SharedWorkerContext.name')
- @DocsEditable
- final String name;
- @DomName('SharedWorkerContext.onconnect')
- @DocsEditable
- Stream<Event> get onConnect => connectEvent.forTarget(this);
-}
+typedef void _RtcSessionDescriptionCallback(RtcSessionDescription sdp);
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// WARNING: Do not edit - generated code.
-@DocsEditable
-@DomName('SourceBuffer')
-class SourceBuffer native "*SourceBuffer" {
- @DomName('SourceBuffer.buffered')
- @DocsEditable
- final TimeRanges buffered;
+typedef void RtcStatsCallback(RtcStatsResponse response);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('SourceBuffer.timestampOffset')
- @DocsEditable
- num timestampOffset;
- @DomName('SourceBuffer.abort')
- @DocsEditable
- void abort() native;
+@DocsEditable
+@DomName('RadioNodeList')
+class RadioNodeList extends NodeList native "*RadioNodeList" {
- @DomName('SourceBuffer.append')
+ @DomName('RadioNodeList.value')
@DocsEditable
- void append(Uint8Array data) native;
+ String value;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// WARNING: Do not edit - generated code.
-@DocsEditable
-@DomName('SourceBufferList')
-class SourceBufferList extends EventTarget implements JavaScriptIndexingBehavior, List<SourceBuffer> native "*SourceBufferList" {
- @DomName('SourceBufferList.length')
+@DomName('Range')
+class Range native "*Range" {
+ factory Range() => document.$dom_createRange();
+
+
+ static const int END_TO_END = 2;
+
+ static const int END_TO_START = 3;
+
+ static const int NODE_AFTER = 1;
+
+ static const int NODE_BEFORE = 0;
+
+ static const int NODE_BEFORE_AND_AFTER = 2;
+
+ static const int NODE_INSIDE = 3;
+
+ static const int START_TO_END = 1;
+
+ static const int START_TO_START = 0;
+
+ @DomName('Range.collapsed')
@DocsEditable
- int get length => JS("int", "#.length", this);
+ final bool collapsed;
- SourceBuffer operator[](int index) => JS("SourceBuffer", "#[#]", this, index);
+ @DomName('Range.commonAncestorContainer')
+ @DocsEditable
+ final Node commonAncestorContainer;
- void operator[]=(int index, SourceBuffer value) {
- throw new UnsupportedError("Cannot assign element of immutable List.");
- }
- // -- start List<SourceBuffer> mixins.
- // SourceBuffer is the element type.
+ @DomName('Range.endContainer')
+ @DocsEditable
+ final Node endContainer;
- // From Iterable<SourceBuffer>:
+ @DomName('Range.endOffset')
+ @DocsEditable
+ final int endOffset;
- Iterator<SourceBuffer> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<SourceBuffer>(this);
- }
+ @DomName('Range.startContainer')
+ @DocsEditable
+ final Node startContainer;
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, SourceBuffer)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
+ @DomName('Range.startOffset')
+ @DocsEditable
+ final int startOffset;
- bool contains(SourceBuffer element) => IterableMixinWorkaround.contains(this, element);
+ @DomName('Range.cloneContents')
+ @DocsEditable
+ DocumentFragment cloneContents() native;
- void forEach(void f(SourceBuffer element)) => IterableMixinWorkaround.forEach(this, f);
+ @DomName('Range.cloneRange')
+ @DocsEditable
+ Range cloneRange() native;
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
+ @DomName('Range.collapse')
+ @DocsEditable
+ void collapse(bool toStart) native;
- Iterable map(f(SourceBuffer element)) =>
- IterableMixinWorkaround.mapList(this, f);
+ @DomName('Range.compareNode')
+ @DocsEditable
+ int compareNode(Node refNode) native;
- Iterable<SourceBuffer> where(bool f(SourceBuffer element)) =>
- IterableMixinWorkaround.where(this, f);
+ @DomName('Range.comparePoint')
+ @DocsEditable
+ int comparePoint(Node refNode, int offset) native;
- Iterable expand(Iterable f(SourceBuffer element)) =>
- IterableMixinWorkaround.expand(this, f);
+ @DomName('Range.createContextualFragment')
+ @DocsEditable
+ DocumentFragment createContextualFragment(String html) native;
- bool every(bool f(SourceBuffer element)) => IterableMixinWorkaround.every(this, f);
+ @DomName('Range.deleteContents')
+ @DocsEditable
+ void deleteContents() native;
- bool any(bool f(SourceBuffer element)) => IterableMixinWorkaround.any(this, f);
+ @DomName('Range.detach')
+ @DocsEditable
+ void detach() native;
- List<SourceBuffer> toList({ bool growable: true }) =>
- new List<SourceBuffer>.from(this, growable: growable);
+ @DomName('Range.expand')
+ @DocsEditable
+ void expand(String unit) native;
- Set<SourceBuffer> toSet() => new Set<SourceBuffer>.from(this);
+ @DomName('Range.extractContents')
+ @DocsEditable
+ DocumentFragment extractContents() native;
- bool get isEmpty => this.length == 0;
+ @DomName('Range.getBoundingClientRect')
+ @DocsEditable
+ Rect getBoundingClientRect() native;
- Iterable<SourceBuffer> take(int n) => IterableMixinWorkaround.takeList(this, n);
+ @DomName('Range.getClientRects')
+ @DocsEditable
+ @Returns('_ClientRectList')
+ @Creates('_ClientRectList')
+ List<Rect> getClientRects() native;
- Iterable<SourceBuffer> takeWhile(bool test(SourceBuffer value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
+ @DomName('Range.insertNode')
+ @DocsEditable
+ void insertNode(Node newNode) native;
- Iterable<SourceBuffer> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+ @DomName('Range.intersectsNode')
+ @DocsEditable
+ bool intersectsNode(Node refNode) native;
- Iterable<SourceBuffer> skipWhile(bool test(SourceBuffer value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
+ @DomName('Range.isPointInRange')
+ @DocsEditable
+ bool isPointInRange(Node refNode, int offset) native;
- SourceBuffer firstWhere(bool test(SourceBuffer value), { SourceBuffer orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
+ @DomName('Range.selectNode')
+ @DocsEditable
+ void selectNode(Node refNode) native;
- SourceBuffer lastWhere(bool test(SourceBuffer value), {SourceBuffer orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
+ @DomName('Range.selectNodeContents')
+ @DocsEditable
+ void selectNodeContents(Node refNode) native;
- SourceBuffer singleWhere(bool test(SourceBuffer value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
+ @DomName('Range.setEnd')
+ @DocsEditable
+ void setEnd(Node refNode, int offset) native;
- SourceBuffer elementAt(int index) {
- return this[index];
- }
+ @DomName('Range.setEndAfter')
+ @DocsEditable
+ void setEndAfter(Node refNode) native;
- // From Collection<SourceBuffer>:
+ @DomName('Range.setEndBefore')
+ @DocsEditable
+ void setEndBefore(Node refNode) native;
- void add(SourceBuffer value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('Range.setStart')
+ @DocsEditable
+ void setStart(Node refNode, int offset) native;
- void addLast(SourceBuffer value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('Range.setStartAfter')
+ @DocsEditable
+ void setStartAfter(Node refNode) native;
- void addAll(Iterable<SourceBuffer> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('Range.setStartBefore')
+ @DocsEditable
+ void setStartBefore(Node refNode) native;
- // From List<SourceBuffer>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
+ @DomName('Range.surroundContents')
+ @DocsEditable
+ void surroundContents(Node newParent) native;
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
+ @DomName('Range.toString')
+ @DocsEditable
+ String toString() native;
- Iterable<SourceBuffer> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void sort([int compare(SourceBuffer a, SourceBuffer b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
- int indexOf(SourceBuffer element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
+@DocsEditable
+@DomName('RangeException')
+class RangeException native "*RangeException" {
- int lastIndexOf(SourceBuffer element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
+ static const int BAD_BOUNDARYPOINTS_ERR = 1;
- SourceBuffer get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
+ static const int INVALID_NODE_TYPE_ERR = 2;
- SourceBuffer get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
+ @DomName('RangeException.code')
+ @DocsEditable
+ final int code;
- SourceBuffer get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
+ @DomName('RangeException.message')
+ @DocsEditable
+ final String message;
- SourceBuffer min([int compare(SourceBuffer a, SourceBuffer b)]) =>
- IterableMixinWorkaround.min(this, compare);
+ @DomName('RangeException.name')
+ @DocsEditable
+ final String name;
- SourceBuffer max([int compare(SourceBuffer a, SourceBuffer b)]) =>
- IterableMixinWorkaround.max(this, compare);
+ @DomName('RangeException.toString')
+ @DocsEditable
+ String toString() native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- SourceBuffer removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+// WARNING: Do not edit - generated code.
- SourceBuffer removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+typedef void RequestAnimationFrameCallback(num highResTime);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+@DocsEditable
+@DomName('RTCDataChannel')
+class RtcDataChannel extends EventTarget native "*RTCDataChannel" {
- void removeWhere(bool test(SourceBuffer element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('RTCDataChannel.closeEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> closeEvent = const EventStreamProvider<Event>('close');
- void retainWhere(bool test(SourceBuffer element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('RTCDataChannel.errorEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> errorEvent = const EventStreamProvider<Event>('error');
- void setRange(int start, int rangeLength, List<SourceBuffer> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
+ @DomName('RTCDataChannel.messageEvent')
+ @DocsEditable
+ static const EventStreamProvider<MessageEvent> messageEvent = const EventStreamProvider<MessageEvent>('message');
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
+ @DomName('RTCDataChannel.openEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> openEvent = const EventStreamProvider<Event>('open');
- void insertRange(int start, int rangeLength, [SourceBuffer initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
+ @DomName('RTCDataChannel.binaryType')
+ @DocsEditable
+ String binaryType;
- List<SourceBuffer> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <SourceBuffer>[]);
+ @DomName('RTCDataChannel.bufferedAmount')
+ @DocsEditable
+ final int bufferedAmount;
- Map<int, SourceBuffer> asMap() =>
- IterableMixinWorkaround.asMapList(this);
+ @DomName('RTCDataChannel.label')
+ @DocsEditable
+ final String label;
- // -- end List<SourceBuffer> mixins.
+ @DomName('RTCDataChannel.readyState')
+ @DocsEditable
+ final String readyState;
+
+ @DomName('RTCDataChannel.reliable')
+ @DocsEditable
+ final bool reliable;
@JSName('addEventListener')
- @DomName('SourceBufferList.addEventListener')
+ @DomName('RTCDataChannel.addEventListener')
@DocsEditable
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('SourceBufferList.dispatchEvent')
+ @DomName('RTCDataChannel.close')
@DocsEditable
- bool dispatchEvent(Event event) native;
+ void close() native;
- @DomName('SourceBufferList.item')
+ @DomName('RTCDataChannel.dispatchEvent')
@DocsEditable
- SourceBuffer item(int index) native;
+ bool dispatchEvent(Event event) native;
@JSName('removeEventListener')
- @DomName('SourceBufferList.removeEventListener')
+ @DomName('RTCDataChannel.removeEventListener')
@DocsEditable
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @DomName('RTCDataChannel.send')
+ @DocsEditable
+ void send(data) native;
-@DocsEditable
-@DomName('HTMLSourceElement')
-class SourceElement extends Element native "*HTMLSourceElement" {
-
- @DomName('HTMLSourceElement.HTMLSourceElement')
+ @DomName('RTCDataChannel.onclose')
@DocsEditable
- factory SourceElement() => document.$dom_createElement("source");
+ Stream<Event> get onClose => closeEvent.forTarget(this);
- @DomName('HTMLSourceElement.media')
+ @DomName('RTCDataChannel.onerror')
@DocsEditable
- String media;
+ Stream<Event> get onError => errorEvent.forTarget(this);
- @DomName('HTMLSourceElement.src')
+ @DomName('RTCDataChannel.onmessage')
@DocsEditable
- String src;
+ Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
- @DomName('HTMLSourceElement.type')
+ @DomName('RTCDataChannel.onopen')
@DocsEditable
- String type;
+ Stream<Event> get onOpen => openEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -20452,36 +17973,39 @@ class SourceElement extends Element native "*HTMLSourceElement" {
@DocsEditable
-@DomName('HTMLSpanElement')
-class SpanElement extends Element native "*HTMLSpanElement" {
+@DomName('RTCDataChannelEvent')
+class RtcDataChannelEvent extends Event native "*RTCDataChannelEvent" {
- @DomName('HTMLSpanElement.HTMLSpanElement')
+ @DomName('RTCDataChannelEvent.channel')
@DocsEditable
- factory SpanElement() => document.$dom_createElement("span");
+ final RtcDataChannel channel;
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DocsEditable
-@DomName('SpeechGrammar')
-class SpeechGrammar native "*SpeechGrammar" {
+@DomName('RTCIceCandidate')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@Experimental
+class RtcIceCandidate native "*RTCIceCandidate" {
+ factory RtcIceCandidate(Map dictionary) {
+ return JS('RtcIceCandidate', 'new RTCIceCandidate(#)',
+ convertDartToNative_SerializedScriptValue(dictionary));
+ }
- @DomName('SpeechGrammar.SpeechGrammar')
+ @DomName('RTCIceCandidate.candidate')
@DocsEditable
- factory SpeechGrammar() {
- return SpeechGrammar._create_1();
- }
- static SpeechGrammar _create_1() => JS('SpeechGrammar', 'new SpeechGrammar()');
+ final String candidate;
- @DomName('SpeechGrammar.src')
+ @DomName('RTCIceCandidate.sdpMLineIndex')
@DocsEditable
- String src;
+ final int sdpMLineIndex;
- @DomName('SpeechGrammar.weight')
+ @DomName('RTCIceCandidate.sdpMid')
@DocsEditable
- num weight;
+ final String sdpMid;
+
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -20489,400 +18013,536 @@ class SpeechGrammar native "*SpeechGrammar" {
@DocsEditable
-@DomName('SpeechGrammarList')
-class SpeechGrammarList implements JavaScriptIndexingBehavior, List<SpeechGrammar> native "*SpeechGrammarList" {
-
- @DomName('SpeechGrammarList.SpeechGrammarList')
- @DocsEditable
- factory SpeechGrammarList() {
- return SpeechGrammarList._create_1();
- }
- static SpeechGrammarList _create_1() => JS('SpeechGrammarList', 'new SpeechGrammarList()');
+@DomName('RTCIceCandidateEvent')
+class RtcIceCandidateEvent extends Event native "*RTCIceCandidateEvent" {
- @DomName('SpeechGrammarList.length')
+ @DomName('RTCIceCandidateEvent.candidate')
@DocsEditable
- int get length => JS("int", "#.length", this);
-
- SpeechGrammar operator[](int index) => JS("SpeechGrammar", "#[#]", this, index);
-
- void operator[]=(int index, SpeechGrammar value) {
- throw new UnsupportedError("Cannot assign element of immutable List.");
- }
- // -- start List<SpeechGrammar> mixins.
- // SpeechGrammar is the element type.
-
- // From Iterable<SpeechGrammar>:
+ final RtcIceCandidate candidate;
+}
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- Iterator<SpeechGrammar> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<SpeechGrammar>(this);
- }
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, SpeechGrammar)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
+@DomName('RTCPeerConnection')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@Experimental
+class RtcPeerConnection extends EventTarget native "*RTCPeerConnection" {
+ factory RtcPeerConnection(Map rtcIceServers, [Map mediaConstraints]) {
+ var constructorName = JS('RtcPeerConnection', 'window[#]',
+ '${Device.propertyPrefix}RTCPeerConnection');
+ if (?mediaConstraints) {
+ return JS('RtcPeerConnection', 'new #(#,#)', constructorName,
+ convertDartToNative_SerializedScriptValue(rtcIceServers),
+ convertDartToNative_SerializedScriptValue(mediaConstraints));
+ } else {
+ return JS('RtcPeerConnection', 'new #(#)', constructorName,
+ convertDartToNative_SerializedScriptValue(rtcIceServers));
+ }
}
- bool contains(SpeechGrammar element) => IterableMixinWorkaround.contains(this, element);
-
- void forEach(void f(SpeechGrammar element)) => IterableMixinWorkaround.forEach(this, f);
-
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
-
- Iterable map(f(SpeechGrammar element)) =>
- IterableMixinWorkaround.mapList(this, f);
-
- Iterable<SpeechGrammar> where(bool f(SpeechGrammar element)) =>
- IterableMixinWorkaround.where(this, f);
-
- Iterable expand(Iterable f(SpeechGrammar element)) =>
- IterableMixinWorkaround.expand(this, f);
-
- bool every(bool f(SpeechGrammar element)) => IterableMixinWorkaround.every(this, f);
+ /**
+ * Checks if Real Time Communication (RTC) APIs are supported and enabled on
+ * the current platform.
+ */
+ static bool get supported {
+ // Currently in Firefox some of the RTC elements are defined but throw an
+ // error unless the user has specifically enabled them in their
+ // about:config. So we have to construct an element to actually test if RTC
+ // is supported at at the given time.
+ try {
+ var c = new RtcPeerConnection({"iceServers": [ {"url":"stun:foo.com"}]});
+ return c is RtcPeerConnection;
+ } catch (_) {}
+ return false;
+ }
- bool any(bool f(SpeechGrammar element)) => IterableMixinWorkaround.any(this, f);
+ @DomName('RTCPeerConnection.addstreamEvent')
+ @DocsEditable
+ static const EventStreamProvider<MediaStreamEvent> addStreamEvent = const EventStreamProvider<MediaStreamEvent>('addstream');
- List<SpeechGrammar> toList({ bool growable: true }) =>
- new List<SpeechGrammar>.from(this, growable: growable);
+ @DomName('RTCPeerConnection.datachannelEvent')
+ @DocsEditable
+ static const EventStreamProvider<RtcDataChannelEvent> dataChannelEvent = const EventStreamProvider<RtcDataChannelEvent>('datachannel');
- Set<SpeechGrammar> toSet() => new Set<SpeechGrammar>.from(this);
+ @DomName('RTCPeerConnection.gatheringchangeEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> gatheringChangeEvent = const EventStreamProvider<Event>('gatheringchange');
- bool get isEmpty => this.length == 0;
+ @DomName('RTCPeerConnection.icecandidateEvent')
+ @DocsEditable
+ static const EventStreamProvider<RtcIceCandidateEvent> iceCandidateEvent = const EventStreamProvider<RtcIceCandidateEvent>('icecandidate');
- Iterable<SpeechGrammar> take(int n) => IterableMixinWorkaround.takeList(this, n);
+ @DomName('RTCPeerConnection.icechangeEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> iceChangeEvent = const EventStreamProvider<Event>('icechange');
- Iterable<SpeechGrammar> takeWhile(bool test(SpeechGrammar value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
+ @DomName('RTCPeerConnection.negotiationneededEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> negotiationNeededEvent = const EventStreamProvider<Event>('negotiationneeded');
- Iterable<SpeechGrammar> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+ @DomName('RTCPeerConnection.removestreamEvent')
+ @DocsEditable
+ static const EventStreamProvider<MediaStreamEvent> removeStreamEvent = const EventStreamProvider<MediaStreamEvent>('removestream');
- Iterable<SpeechGrammar> skipWhile(bool test(SpeechGrammar value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
+ @DomName('RTCPeerConnection.statechangeEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> stateChangeEvent = const EventStreamProvider<Event>('statechange');
- SpeechGrammar firstWhere(bool test(SpeechGrammar value), { SpeechGrammar orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
+ @DomName('RTCPeerConnection.iceConnectionState')
+ @DocsEditable
+ final String iceConnectionState;
- SpeechGrammar lastWhere(bool test(SpeechGrammar value), {SpeechGrammar orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
+ @DomName('RTCPeerConnection.iceGatheringState')
+ @DocsEditable
+ final String iceGatheringState;
- SpeechGrammar singleWhere(bool test(SpeechGrammar value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
+ @DomName('RTCPeerConnection.localDescription')
+ @DocsEditable
+ final RtcSessionDescription localDescription;
- SpeechGrammar elementAt(int index) {
- return this[index];
- }
+ @DomName('RTCPeerConnection.readyState')
+ @DocsEditable
+ final String readyState;
- // From Collection<SpeechGrammar>:
+ @DomName('RTCPeerConnection.remoteDescription')
+ @DocsEditable
+ final RtcSessionDescription remoteDescription;
- void add(SpeechGrammar value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('RTCPeerConnection.signalingState')
+ @DocsEditable
+ final String signalingState;
- void addLast(SpeechGrammar value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @JSName('addEventListener')
+ @DomName('RTCPeerConnection.addEventListener')
+ @DocsEditable
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- void addAll(Iterable<SpeechGrammar> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('RTCPeerConnection.addIceCandidate')
+ @DocsEditable
+ void addIceCandidate(RtcIceCandidate candidate) native;
- // From List<SpeechGrammar>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
+ @DomName('RTCPeerConnection.addStream')
+ @DocsEditable
+ void addStream(MediaStream stream, [Map mediaConstraints]) {
+ if (?mediaConstraints) {
+ var mediaConstraints_1 = convertDartToNative_Dictionary(mediaConstraints);
+ _addStream_1(stream, mediaConstraints_1);
+ return;
+ }
+ _addStream_2(stream);
+ return;
}
+ @JSName('addStream')
+ @DomName('RTCPeerConnection.addStream')
+ @DocsEditable
+ void _addStream_1(MediaStream stream, mediaConstraints) native;
+ @JSName('addStream')
+ @DomName('RTCPeerConnection.addStream')
+ @DocsEditable
+ void _addStream_2(MediaStream stream) native;
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
+ @DomName('RTCPeerConnection.close')
+ @DocsEditable
+ void close() native;
- Iterable<SpeechGrammar> get reversed {
- return IterableMixinWorkaround.reversedList(this);
+ @DomName('RTCPeerConnection.createAnswer')
+ @DocsEditable
+ void _createAnswer(_RtcSessionDescriptionCallback successCallback, [_RtcErrorCallback failureCallback, Map mediaConstraints]) {
+ if (?mediaConstraints) {
+ var mediaConstraints_1 = convertDartToNative_Dictionary(mediaConstraints);
+ __createAnswer_1(successCallback, failureCallback, mediaConstraints_1);
+ return;
+ }
+ __createAnswer_2(successCallback, failureCallback);
+ return;
}
+ @JSName('createAnswer')
+ @DomName('RTCPeerConnection.createAnswer')
+ @DocsEditable
+ void __createAnswer_1(_RtcSessionDescriptionCallback successCallback, _RtcErrorCallback failureCallback, mediaConstraints) native;
+ @JSName('createAnswer')
+ @DomName('RTCPeerConnection.createAnswer')
+ @DocsEditable
+ void __createAnswer_2(_RtcSessionDescriptionCallback successCallback, _RtcErrorCallback failureCallback) native;
- void sort([int compare(SpeechGrammar a, SpeechGrammar b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
+ @JSName('createAnswer')
+ @DomName('RTCPeerConnection.createAnswer')
+ @DocsEditable
+ Future<RtcSessionDescription> createAnswer([Map mediaConstraints]) {
+ var completer = new Completer<RtcSessionDescription>();
+ _createAnswer(mediaConstraints,
+ (value) { completer.complete(value); },
+ (error) { completer.completeError(error); });
+ return completer.future;
}
- int indexOf(SpeechGrammar element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
-
- int lastIndexOf(SpeechGrammar element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
+ @JSName('createDTMFSender')
+ @DomName('RTCPeerConnection.createDTMFSender')
+ @DocsEditable
+ RtcdtmfSender createDtmfSender(MediaStreamTrack track) native;
- SpeechGrammar get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
+ @DomName('RTCPeerConnection.createDataChannel')
+ @DocsEditable
+ RtcDataChannel createDataChannel(String label, [Map options]) {
+ if (?options) {
+ var options_1 = convertDartToNative_Dictionary(options);
+ return _createDataChannel_1(label, options_1);
+ }
+ return _createDataChannel_2(label);
}
+ @JSName('createDataChannel')
+ @DomName('RTCPeerConnection.createDataChannel')
+ @DocsEditable
+ RtcDataChannel _createDataChannel_1(label, options) native;
+ @JSName('createDataChannel')
+ @DomName('RTCPeerConnection.createDataChannel')
+ @DocsEditable
+ RtcDataChannel _createDataChannel_2(label) native;
- SpeechGrammar get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
+ @DomName('RTCPeerConnection.createOffer')
+ @DocsEditable
+ void _createOffer(_RtcSessionDescriptionCallback successCallback, [_RtcErrorCallback failureCallback, Map mediaConstraints]) {
+ if (?mediaConstraints) {
+ var mediaConstraints_1 = convertDartToNative_Dictionary(mediaConstraints);
+ __createOffer_1(successCallback, failureCallback, mediaConstraints_1);
+ return;
+ }
+ __createOffer_2(successCallback, failureCallback);
+ return;
}
+ @JSName('createOffer')
+ @DomName('RTCPeerConnection.createOffer')
+ @DocsEditable
+ void __createOffer_1(_RtcSessionDescriptionCallback successCallback, _RtcErrorCallback failureCallback, mediaConstraints) native;
+ @JSName('createOffer')
+ @DomName('RTCPeerConnection.createOffer')
+ @DocsEditable
+ void __createOffer_2(_RtcSessionDescriptionCallback successCallback, _RtcErrorCallback failureCallback) native;
- SpeechGrammar get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
+ @JSName('createOffer')
+ @DomName('RTCPeerConnection.createOffer')
+ @DocsEditable
+ Future<RtcSessionDescription> createOffer([Map mediaConstraints]) {
+ var completer = new Completer<RtcSessionDescription>();
+ _createOffer(mediaConstraints,
+ (value) { completer.complete(value); },
+ (error) { completer.completeError(error); });
+ return completer.future;
}
- SpeechGrammar min([int compare(SpeechGrammar a, SpeechGrammar b)]) =>
- IterableMixinWorkaround.min(this, compare);
-
- SpeechGrammar max([int compare(SpeechGrammar a, SpeechGrammar b)]) =>
- IterableMixinWorkaround.max(this, compare);
+ @DomName('RTCPeerConnection.dispatchEvent')
+ @DocsEditable
+ bool dispatchEvent(Event event) native;
- SpeechGrammar removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('RTCPeerConnection.getLocalStreams')
+ @DocsEditable
+ List<MediaStream> getLocalStreams() native;
- SpeechGrammar removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('RTCPeerConnection.getRemoteStreams')
+ @DocsEditable
+ List<MediaStream> getRemoteStreams() native;
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('RTCPeerConnection.getStats')
+ @DocsEditable
+ void getStats(RtcStatsCallback successCallback, MediaStreamTrack selector) native;
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @JSName('removeEventListener')
+ @DomName('RTCPeerConnection.removeEventListener')
+ @DocsEditable
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('RTCPeerConnection.removeStream')
+ @DocsEditable
+ void removeStream(MediaStream stream) native;
- void removeWhere(bool test(SpeechGrammar element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @JSName('setLocalDescription')
+ @DomName('RTCPeerConnection.setLocalDescription')
+ @DocsEditable
+ void _setLocalDescription(RtcSessionDescription description, [VoidCallback successCallback, _RtcErrorCallback failureCallback]) native;
- void retainWhere(bool test(SpeechGrammar element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
+ @JSName('setLocalDescription')
+ @DomName('RTCPeerConnection.setLocalDescription')
+ @DocsEditable
+ Future setLocalDescription(RtcSessionDescription description) {
+ var completer = new Completer();
+ _setLocalDescription(description,
+ () { completer.complete(); },
+ (error) { completer.completeError(error); });
+ return completer.future;
}
- void setRange(int start, int rangeLength, List<SpeechGrammar> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
+ @JSName('setRemoteDescription')
+ @DomName('RTCPeerConnection.setRemoteDescription')
+ @DocsEditable
+ void _setRemoteDescription(RtcSessionDescription description, [VoidCallback successCallback, _RtcErrorCallback failureCallback]) native;
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
+ @JSName('setRemoteDescription')
+ @DomName('RTCPeerConnection.setRemoteDescription')
+ @DocsEditable
+ Future setRemoteDescription(RtcSessionDescription description) {
+ var completer = new Completer();
+ _setRemoteDescription(description,
+ () { completer.complete(); },
+ (error) { completer.completeError(error); });
+ return completer.future;
}
- void insertRange(int start, int rangeLength, [SpeechGrammar initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
+ @DomName('RTCPeerConnection.updateIce')
+ @DocsEditable
+ void updateIce([Map configuration, Map mediaConstraints]) {
+ if (?mediaConstraints) {
+ var configuration_1 = convertDartToNative_Dictionary(configuration);
+ var mediaConstraints_2 = convertDartToNative_Dictionary(mediaConstraints);
+ _updateIce_1(configuration_1, mediaConstraints_2);
+ return;
+ }
+ if (?configuration) {
+ var configuration_3 = convertDartToNative_Dictionary(configuration);
+ _updateIce_2(configuration_3);
+ return;
+ }
+ _updateIce_3();
+ return;
}
+ @JSName('updateIce')
+ @DomName('RTCPeerConnection.updateIce')
+ @DocsEditable
+ void _updateIce_1(configuration, mediaConstraints) native;
+ @JSName('updateIce')
+ @DomName('RTCPeerConnection.updateIce')
+ @DocsEditable
+ void _updateIce_2(configuration) native;
+ @JSName('updateIce')
+ @DomName('RTCPeerConnection.updateIce')
+ @DocsEditable
+ void _updateIce_3() native;
- List<SpeechGrammar> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <SpeechGrammar>[]);
-
- Map<int, SpeechGrammar> asMap() =>
- IterableMixinWorkaround.asMapList(this);
+ @DomName('RTCPeerConnection.onaddstream')
+ @DocsEditable
+ Stream<MediaStreamEvent> get onAddStream => addStreamEvent.forTarget(this);
- // -- end List<SpeechGrammar> mixins.
+ @DomName('RTCPeerConnection.ondatachannel')
+ @DocsEditable
+ Stream<RtcDataChannelEvent> get onDataChannel => dataChannelEvent.forTarget(this);
- @DomName('SpeechGrammarList.addFromString')
+ @DomName('RTCPeerConnection.ongatheringchange')
@DocsEditable
- void addFromString(String string, [num weight]) native;
+ Stream<Event> get onGatheringChange => gatheringChangeEvent.forTarget(this);
- @DomName('SpeechGrammarList.addFromUri')
+ @DomName('RTCPeerConnection.onicecandidate')
@DocsEditable
- void addFromUri(String src, [num weight]) native;
+ Stream<RtcIceCandidateEvent> get onIceCandidate => iceCandidateEvent.forTarget(this);
- @DomName('SpeechGrammarList.item')
+ @DomName('RTCPeerConnection.onicechange')
@DocsEditable
- SpeechGrammar item(int index) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ Stream<Event> get onIceChange => iceChangeEvent.forTarget(this);
+ @DomName('RTCPeerConnection.onnegotiationneeded')
+ @DocsEditable
+ Stream<Event> get onNegotiationNeeded => negotiationNeededEvent.forTarget(this);
-@DocsEditable
-@DomName('SpeechInputEvent')
-class SpeechInputEvent extends Event native "*SpeechInputEvent" {
+ @DomName('RTCPeerConnection.onremovestream')
+ @DocsEditable
+ Stream<MediaStreamEvent> get onRemoveStream => removeStreamEvent.forTarget(this);
- @DomName('SpeechInputEvent.results')
+ @DomName('RTCPeerConnection.onstatechange')
@DocsEditable
- @Returns('_SpeechInputResultList')
- @Creates('_SpeechInputResultList')
- final List<SpeechInputResult> results;
+ Stream<Event> get onStateChange => stateChangeEvent.forTarget(this);
+
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+
+
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DocsEditable
-@DomName('SpeechInputResult')
-class SpeechInputResult native "*SpeechInputResult" {
+@DomName('RTCSessionDescription')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@Experimental
+class RtcSessionDescription native "*RTCSessionDescription" {
+ factory RtcSessionDescription(Map dictionary) {
+ return JS('RtcSessionDescription', 'new RTCSessionDescription(#)',
+ convertDartToNative_SerializedScriptValue(dictionary));
+ }
- @DomName('SpeechInputResult.confidence')
+ @DomName('RTCSessionDescription.sdp')
@DocsEditable
- final num confidence;
+ String sdp;
- @DomName('SpeechInputResult.utterance')
+ @DomName('RTCSessionDescription.type')
@DocsEditable
- final String utterance;
+ String type;
+
}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DomName('SpeechRecognition')
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Experimental
-class SpeechRecognition extends EventTarget native "*SpeechRecognition" {
-
- @DomName('SpeechRecognition.audioendEvent')
- @DocsEditable
- static const EventStreamProvider<Event> audioEndEvent = const EventStreamProvider<Event>('audioend');
+@DocsEditable
+@DomName('RTCStatsElement')
+class RtcStatsElement native "*RTCStatsElement" {
- @DomName('SpeechRecognition.audiostartEvent')
+ DateTime get timestamp => _convertNativeToDart_DateTime(this._get_timestamp);
+ @JSName('timestamp')
+ @DomName('RTCStatsElement.timestamp')
@DocsEditable
- static const EventStreamProvider<Event> audioStartEvent = const EventStreamProvider<Event>('audiostart');
+ final dynamic _get_timestamp;
- @DomName('SpeechRecognition.endEvent')
+ @DomName('RTCStatsElement.names')
@DocsEditable
- static const EventStreamProvider<Event> endEvent = const EventStreamProvider<Event>('end');
+ List<String> names() native;
- @DomName('SpeechRecognition.errorEvent')
+ @DomName('RTCStatsElement.stat')
@DocsEditable
- static const EventStreamProvider<SpeechRecognitionError> errorEvent = const EventStreamProvider<SpeechRecognitionError>('error');
+ String stat(String name) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('SpeechRecognition.nomatchEvent')
- @DocsEditable
- static const EventStreamProvider<SpeechRecognitionEvent> noMatchEvent = const EventStreamProvider<SpeechRecognitionEvent>('nomatch');
- @DomName('SpeechRecognition.resultEvent')
- @DocsEditable
- static const EventStreamProvider<SpeechRecognitionEvent> resultEvent = const EventStreamProvider<SpeechRecognitionEvent>('result');
+@DocsEditable
+@DomName('RTCStatsReport')
+class RtcStatsReport native "*RTCStatsReport" {
- @DomName('SpeechRecognition.soundendEvent')
+ @DomName('RTCStatsReport.local')
@DocsEditable
- static const EventStreamProvider<Event> soundEndEvent = const EventStreamProvider<Event>('soundend');
+ final RtcStatsElement local;
- @DomName('SpeechRecognition.soundstartEvent')
+ @DomName('RTCStatsReport.remote')
@DocsEditable
- static const EventStreamProvider<Event> soundStartEvent = const EventStreamProvider<Event>('soundstart');
+ final RtcStatsElement remote;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('SpeechRecognition.speechendEvent')
- @DocsEditable
- static const EventStreamProvider<Event> speechEndEvent = const EventStreamProvider<Event>('speechend');
- @DomName('SpeechRecognition.speechstartEvent')
- @DocsEditable
- static const EventStreamProvider<Event> speechStartEvent = const EventStreamProvider<Event>('speechstart');
+@DocsEditable
+@DomName('RTCStatsResponse')
+class RtcStatsResponse native "*RTCStatsResponse" {
- @DomName('SpeechRecognition.startEvent')
+ @DomName('RTCStatsResponse.result')
@DocsEditable
- static const EventStreamProvider<Event> startEvent = const EventStreamProvider<Event>('start');
+ List<RtcStatsReport> result() native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- /// Checks if this type is supported on the current platform.
- static bool get supported => JS('bool', '!!(window.SpeechRecognition || window.webkitSpeechRecognition)');
- @DomName('SpeechRecognition.continuous')
- @DocsEditable
- bool continuous;
+@DocsEditable
+@DomName('RTCDTMFSender')
+class RtcdtmfSender extends EventTarget native "*RTCDTMFSender" {
- @DomName('SpeechRecognition.grammars')
+ @JSName('canInsertDTMF')
+ @DomName('RTCDTMFSender.canInsertDTMF')
@DocsEditable
- SpeechGrammarList grammars;
+ final bool canInsertDtmf;
- @DomName('SpeechRecognition.interimResults')
+ @DomName('RTCDTMFSender.duration')
@DocsEditable
- bool interimResults;
+ final int duration;
- @DomName('SpeechRecognition.lang')
+ @DomName('RTCDTMFSender.interToneGap')
@DocsEditable
- String lang;
+ final int interToneGap;
- @DomName('SpeechRecognition.maxAlternatives')
+ @DomName('RTCDTMFSender.toneBuffer')
@DocsEditable
- int maxAlternatives;
+ final String toneBuffer;
- @DomName('SpeechRecognition.abort')
+ @DomName('RTCDTMFSender.track')
@DocsEditable
- void abort() native;
+ final MediaStreamTrack track;
@JSName('addEventListener')
- @DomName('SpeechRecognition.addEventListener')
+ @DomName('RTCDTMFSender.addEventListener')
@DocsEditable
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('SpeechRecognition.dispatchEvent')
+ @DomName('RTCDTMFSender.dispatchEvent')
@DocsEditable
- bool dispatchEvent(Event evt) native;
+ bool dispatchEvent(Event event) native;
+
+ @JSName('insertDTMF')
+ @DomName('RTCDTMFSender.insertDTMF')
+ @DocsEditable
+ void insertDtmf(String tones, [int duration, int interToneGap]) native;
@JSName('removeEventListener')
- @DomName('SpeechRecognition.removeEventListener')
+ @DomName('RTCDTMFSender.removeEventListener')
@DocsEditable
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('SpeechRecognition.start')
- @DocsEditable
- void start() native;
- @DomName('SpeechRecognition.stop')
+@DocsEditable
+@DomName('RTCDTMFToneChangeEvent')
+class RtcdtmfToneChangeEvent extends Event native "*RTCDTMFToneChangeEvent" {
+
+ @DomName('RTCDTMFToneChangeEvent.tone')
@DocsEditable
- void stop() native;
+ final String tone;
+}
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('SpeechRecognition.onaudioend')
- @DocsEditable
- Stream<Event> get onAudioEnd => audioEndEvent.forTarget(this);
- @DomName('SpeechRecognition.onaudiostart')
- @DocsEditable
- Stream<Event> get onAudioStart => audioStartEvent.forTarget(this);
+@DocsEditable
+@DomName('Screen')
+class Screen native "*Screen" {
- @DomName('SpeechRecognition.onend')
- @DocsEditable
- Stream<Event> get onEnd => endEvent.forTarget(this);
+ @DomName('Screen.availHeight')
+ @DomName('Screen.availLeft')
+ @DomName('Screen.availTop')
+ @DomName('Screen.availWidth')
+ Rect get available => new Rect($dom_availLeft, $dom_availTop, $dom_availWidth,
+ $dom_availHeight);
- @DomName('SpeechRecognition.onerror')
+ @JSName('availHeight')
+ @DomName('Screen.availHeight')
@DocsEditable
- Stream<SpeechRecognitionError> get onError => errorEvent.forTarget(this);
+ final int $dom_availHeight;
- @DomName('SpeechRecognition.onnomatch')
+ @JSName('availLeft')
+ @DomName('Screen.availLeft')
@DocsEditable
- Stream<SpeechRecognitionEvent> get onNoMatch => noMatchEvent.forTarget(this);
+ final int $dom_availLeft;
- @DomName('SpeechRecognition.onresult')
+ @JSName('availTop')
+ @DomName('Screen.availTop')
@DocsEditable
- Stream<SpeechRecognitionEvent> get onResult => resultEvent.forTarget(this);
+ final int $dom_availTop;
- @DomName('SpeechRecognition.onsoundend')
+ @JSName('availWidth')
+ @DomName('Screen.availWidth')
@DocsEditable
- Stream<Event> get onSoundEnd => soundEndEvent.forTarget(this);
+ final int $dom_availWidth;
- @DomName('SpeechRecognition.onsoundstart')
+ @DomName('Screen.colorDepth')
@DocsEditable
- Stream<Event> get onSoundStart => soundStartEvent.forTarget(this);
+ final int colorDepth;
- @DomName('SpeechRecognition.onspeechend')
+ @DomName('Screen.height')
@DocsEditable
- Stream<Event> get onSpeechEnd => speechEndEvent.forTarget(this);
+ final int height;
- @DomName('SpeechRecognition.onspeechstart')
+ @DomName('Screen.pixelDepth')
@DocsEditable
- Stream<Event> get onSpeechStart => speechStartEvent.forTarget(this);
+ final int pixelDepth;
- @DomName('SpeechRecognition.onstart')
+ @DomName('Screen.width')
@DocsEditable
- Stream<Event> get onStart => startEvent.forTarget(this);
-
- factory SpeechRecognition() {
- return JS('SpeechRecognition',
- 'new (window.SpeechRecognition || window.webkitSpeechRecognition)()');
- }
+ final int width;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -20890,68 +18550,44 @@ class SpeechRecognition extends EventTarget native "*SpeechRecognition" {
@DocsEditable
-@DomName('SpeechRecognitionAlternative')
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Experimental
-class SpeechRecognitionAlternative native "*SpeechRecognitionAlternative" {
+@DomName('HTMLScriptElement')
+class ScriptElement extends Element native "*HTMLScriptElement" {
- @DomName('SpeechRecognitionAlternative.confidence')
+ @DomName('HTMLScriptElement.HTMLScriptElement')
@DocsEditable
- final num confidence;
+ factory ScriptElement() => document.$dom_createElement("script");
- @DomName('SpeechRecognitionAlternative.transcript')
+ @DomName('HTMLScriptElement.async')
@DocsEditable
- final String transcript;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('SpeechRecognitionError')
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Experimental
-class SpeechRecognitionError extends Event native "*SpeechRecognitionError" {
+ bool async;
- @DomName('SpeechRecognitionError.error')
+ @DomName('HTMLScriptElement.charset')
@DocsEditable
- final String error;
+ String charset;
- @DomName('SpeechRecognitionError.message')
+ @DomName('HTMLScriptElement.crossOrigin')
@DocsEditable
- final String message;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
+ String crossOrigin;
-@DocsEditable
-@DomName('SpeechRecognitionEvent')
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Experimental
-class SpeechRecognitionEvent extends Event native "*SpeechRecognitionEvent" {
+ @DomName('HTMLScriptElement.defer')
+ @DocsEditable
+ bool defer;
- @DomName('SpeechRecognitionEvent.result')
+ @DomName('HTMLScriptElement.event')
@DocsEditable
- final SpeechRecognitionResult result;
+ String event;
- @DomName('SpeechRecognitionEvent.resultHistory')
+ @DomName('HTMLScriptElement.htmlFor')
@DocsEditable
- @Returns('_SpeechRecognitionResultList')
- @Creates('_SpeechRecognitionResultList')
- final List<SpeechRecognitionResult> resultHistory;
+ String htmlFor;
- @DomName('SpeechRecognitionEvent.resultIndex')
+ @DomName('HTMLScriptElement.src')
@DocsEditable
- final int resultIndex;
+ String src;
- @DomName('SpeechRecognitionEvent.results')
+ @DomName('HTMLScriptElement.type')
@DocsEditable
- @Returns('_SpeechRecognitionResultList')
- @Creates('_SpeechRecognitionResultList')
- final List<SpeechRecognitionResult> results;
+ String type;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -20959,306 +18595,261 @@ class SpeechRecognitionEvent extends Event native "*SpeechRecognitionEvent" {
@DocsEditable
-@DomName('SpeechRecognitionResult')
-@SupportedBrowser(SupportedBrowser.CHROME, '25')
-@Experimental
-class SpeechRecognitionResult native "*SpeechRecognitionResult" {
+@DomName('ScriptProfile')
+class ScriptProfile native "*ScriptProfile" {
- @DomName('SpeechRecognitionResult.isFinal')
+ @DomName('ScriptProfile.head')
@DocsEditable
- final bool isFinal;
+ final ScriptProfileNode head;
- @DomName('SpeechRecognitionResult.length')
+ @DomName('ScriptProfile.idleTime')
@DocsEditable
- final int length;
+ final num idleTime;
- @DomName('SpeechRecognitionResult.item')
+ @DomName('ScriptProfile.title')
@DocsEditable
- SpeechRecognitionAlternative item(int index) native;
+ final String title;
+
+ @DomName('ScriptProfile.uid')
+ @DocsEditable
+ final int uid;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-/**
- * The type used by the
- * [Window.localStorage] and [Window.sessionStorage] properties.
- * Storage is implemented as a Map&lt;String, String>.
- *
- * To store and get values, use Dart's built-in map syntax:
- *
- * window.localStorage['key1'] = 'val1';
- * window.localStorage['key2'] = 'val2';
- * window.localStorage['key3'] = 'val3';
- * assert(window.localStorage['key3'] == 'val3');
- *
- * You can use [Map](http://api.dartlang.org/dart_core/Map.html) APIs
- * such as containsValue(), clear(), and length:
- *
- * assert(window.localStorage.containsValue('does not exist') == false);
- * window.localStorage.clear();
- * assert(window.localStorage.length == 0);
- *
- * For more examples of using this API, see
- * [localstorage_test.dart](http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/tests/html/localstorage_test.dart).
- * For details on using the Map API, see the
- * [Maps](http://www.dartlang.org/docs/library-tour/#maps-aka-dictionaries-or-hashes)
- * section of the library tour.
- */
-@DomName('Storage')
-class Storage implements Map<String, String>
- native "*Storage" {
-
- // TODO(nweiz): update this when maps support lazy iteration
- bool containsValue(String value) => values.any((e) => e == value);
-
- bool containsKey(String key) => $dom_getItem(key) != null;
-
- String operator [](String key) => $dom_getItem(key);
-
- void operator []=(String key, String value) { $dom_setItem(key, value); }
-
- String putIfAbsent(String key, String ifAbsent()) {
- if (!containsKey(key)) this[key] = ifAbsent();
- return this[key];
- }
-
- String remove(String key) {
- final value = this[key];
- $dom_removeItem(key);
- return value;
- }
-
- void clear() => $dom_clear();
-
- void forEach(void f(String key, String value)) {
- for (var i = 0; true; i++) {
- final key = $dom_key(i);
- if (key == null) return;
-
- f(key, this[key]);
- }
- }
-
- Collection<String> get keys {
- final keys = [];
- forEach((k, v) => keys.add(k));
- return keys;
- }
-
- Collection<String> get values {
- final values = [];
- forEach((k, v) => values.add(v));
- return values;
- }
+@DocsEditable
+@DomName('ScriptProfileNode')
+class ScriptProfileNode native "*ScriptProfileNode" {
- int get length => $dom_length;
+ @JSName('callUID')
+ @DomName('ScriptProfileNode.callUID')
+ @DocsEditable
+ final int callUid;
- bool get isEmpty => $dom_key(0) == null;
+ @DomName('ScriptProfileNode.functionName')
+ @DocsEditable
+ final String functionName;
- @JSName('length')
- @DomName('Storage.length')
+ @DomName('ScriptProfileNode.lineNumber')
@DocsEditable
- final int $dom_length;
+ final int lineNumber;
- @JSName('clear')
- @DomName('Storage.clear')
+ @DomName('ScriptProfileNode.numberOfCalls')
@DocsEditable
- void $dom_clear() native;
+ final int numberOfCalls;
- @JSName('getItem')
- @DomName('Storage.getItem')
+ @DomName('ScriptProfileNode.selfTime')
@DocsEditable
- String $dom_getItem(String key) native;
+ final num selfTime;
- @JSName('key')
- @DomName('Storage.key')
+ @DomName('ScriptProfileNode.totalTime')
@DocsEditable
- String $dom_key(int index) native;
+ final num totalTime;
- @JSName('removeItem')
- @DomName('Storage.removeItem')
+ @DomName('ScriptProfileNode.url')
@DocsEditable
- void $dom_removeItem(String key) native;
+ final String url;
- @JSName('setItem')
- @DomName('Storage.setItem')
+ @DomName('ScriptProfileNode.visible')
@DocsEditable
- void $dom_setItem(String key, String data) native;
+ final bool visible;
+ @DomName('ScriptProfileNode.children')
+ @DocsEditable
+ List<ScriptProfileNode> children() native;
}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// WARNING: Do not edit - generated code.
+@DomName('HTMLSelectElement')
+class SelectElement extends Element native "*HTMLSelectElement" {
-@DomName('StorageEvent')
-class StorageEvent extends Event native "*StorageEvent" {
- factory StorageEvent(String type,
- {bool canBubble: false, bool cancelable: false, String key, String oldValue,
- String newValue, String url, Storage storageArea}) {
+ @DomName('HTMLSelectElement.HTMLSelectElement')
+ @DocsEditable
+ factory SelectElement() => document.$dom_createElement("select");
- var e = document.$dom_createEvent("StorageEvent");
- e.$dom_initStorageEvent(type, canBubble, cancelable, key, oldValue,
- newValue, url, storageArea);
- return e;
- }
+ @DomName('HTMLSelectElement.autofocus')
+ @DocsEditable
+ bool autofocus;
- @DomName('StorageEvent.key')
+ @DomName('HTMLSelectElement.disabled')
@DocsEditable
- final String key;
+ bool disabled;
- @DomName('StorageEvent.newValue')
+ @DomName('HTMLSelectElement.form')
@DocsEditable
- final String newValue;
+ final FormElement form;
- @DomName('StorageEvent.oldValue')
+ @DomName('HTMLSelectElement.labels')
@DocsEditable
- final String oldValue;
+ @Returns('NodeList')
+ @Creates('NodeList')
+ final List<Node> labels;
- @DomName('StorageEvent.storageArea')
+ @DomName('HTMLSelectElement.length')
@DocsEditable
- final Storage storageArea;
+ int length;
- @DomName('StorageEvent.url')
+ @DomName('HTMLSelectElement.multiple')
@DocsEditable
- final String url;
+ bool multiple;
- @JSName('initStorageEvent')
- @DomName('StorageEvent.initStorageEvent')
+ @DomName('HTMLSelectElement.name')
@DocsEditable
- void $dom_initStorageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, String keyArg, String oldValueArg, String newValueArg, String urlArg, Storage storageAreaArg) native;
+ String name;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @DomName('HTMLSelectElement.required')
+ @DocsEditable
+ bool required;
+ @DomName('HTMLSelectElement.selectedIndex')
+ @DocsEditable
+ int selectedIndex;
-@DocsEditable
-@DomName('StorageInfo')
-class StorageInfo native "*StorageInfo" {
+ @DomName('HTMLSelectElement.size')
+ @DocsEditable
+ int size;
- static const int PERSISTENT = 1;
+ @DomName('HTMLSelectElement.type')
+ @DocsEditable
+ final String type;
- static const int TEMPORARY = 0;
+ @DomName('HTMLSelectElement.validationMessage')
+ @DocsEditable
+ final String validationMessage;
- @JSName('queryUsageAndQuota')
- @DomName('StorageInfo.queryUsageAndQuota')
+ @DomName('HTMLSelectElement.validity')
@DocsEditable
- void _queryUsageAndQuota(int storageType, [_StorageInfoUsageCallback usageCallback, _StorageInfoErrorCallback errorCallback]) native;
+ final ValidityState validity;
- @JSName('queryUsageAndQuota')
- @DomName('StorageInfo.queryUsageAndQuota')
+ @DomName('HTMLSelectElement.value')
@DocsEditable
- Future<int> queryUsageAndQuota(int storageType) {
- var completer = new Completer<int>();
- _queryUsageAndQuota(storageType,
- (value) { completer.complete(value); },
- (error) { completer.completeError(error); });
- return completer.future;
- }
+ String value;
- @JSName('requestQuota')
- @DomName('StorageInfo.requestQuota')
+ @DomName('HTMLSelectElement.willValidate')
@DocsEditable
- void _requestQuota(int storageType, int newQuotaInBytes, [StorageInfoQuotaCallback quotaCallback, _StorageInfoErrorCallback errorCallback]) native;
+ final bool willValidate;
- @JSName('requestQuota')
- @DomName('StorageInfo.requestQuota')
+ @DomName('HTMLSelectElement.checkValidity')
@DocsEditable
- Future<int> requestQuota(int storageType, int newQuotaInBytes) {
- var completer = new Completer<int>();
- _requestQuota(storageType, newQuotaInBytes,
- (value) { completer.complete(value); },
- (error) { completer.completeError(error); });
- return completer.future;
- }
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ bool checkValidity() native;
-// WARNING: Do not edit - generated code.
+ @DomName('HTMLSelectElement.item')
+ @DocsEditable
+ Node item(int index) native;
+ @DomName('HTMLSelectElement.namedItem')
+ @DocsEditable
+ Node namedItem(String name) native;
-typedef void _StorageInfoErrorCallback(DomException error);
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @DomName('HTMLSelectElement.setCustomValidity')
+ @DocsEditable
+ void setCustomValidity(String error) native;
-// WARNING: Do not edit - generated code.
+ // Override default options, since IE returns SelectElement itself and it
+ // does not operate as a List.
+ List<OptionElement> get options {
+ var options = this.children.where((e) => e is OptionElement).toList();
+ return new UnmodifiableListView<OptionElement>(options);
+ }
-typedef void StorageInfoQuotaCallback(int grantedQuotaInBytes);
+ List<OptionElement> get selectedOptions {
+ // IE does not change the selected flag for single-selection items.
+ if (this.multiple) {
+ var options = this.options.where((o) => o.selected).toList();
+ return new UnmodifiableListView<OptionElement>(options);
+ } else {
+ return [this.options[this.selectedIndex]];
+ }
+ }
+}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// WARNING: Do not edit - generated code.
-
-typedef void _StorageInfoUsageCallback(int currentUsageInBytes, int currentQuotaInBytes);
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+@DocsEditable
+@DomName('HTMLShadowElement')
+@SupportedBrowser(SupportedBrowser.CHROME, '26')
+@Experimental
+class ShadowElement extends Element native "*HTMLShadowElement" {
-// WARNING: Do not edit - generated code.
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => Element.isTagSupported('shadow');
+ @DomName('HTMLShadowElement.olderShadowRoot')
+ @DocsEditable
+ final ShadowRoot olderShadowRoot;
-typedef void _StringCallback(String data);
+ @DomName('HTMLShadowElement.resetStyleInheritance')
+ @DocsEditable
+ bool resetStyleInheritance;
+}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// WARNING: Do not edit - generated code.
-@DocsEditable
-@DomName('HTMLStyleElement')
-class StyleElement extends Element native "*HTMLStyleElement" {
- @DomName('HTMLStyleElement.HTMLStyleElement')
+@DomName('ShadowRoot')
+@SupportedBrowser(SupportedBrowser.CHROME, '26')
+@Experimental
+class ShadowRoot extends DocumentFragment native "*ShadowRoot" {
+
+ @DomName('ShadowRoot.activeElement')
@DocsEditable
- factory StyleElement() => document.$dom_createElement("style");
+ final Element activeElement;
- @DomName('HTMLStyleElement.disabled')
+ @DomName('ShadowRoot.applyAuthorStyles')
@DocsEditable
- bool disabled;
+ bool applyAuthorStyles;
- @DomName('HTMLStyleElement.media')
+ @JSName('innerHTML')
+ @DomName('ShadowRoot.innerHTML')
@DocsEditable
- String media;
+ String innerHtml;
- @DomName('HTMLStyleElement.scoped')
+ @DomName('ShadowRoot.resetStyleInheritance')
@DocsEditable
- bool scoped;
+ bool resetStyleInheritance;
- @DomName('HTMLStyleElement.sheet')
+ @JSName('cloneNode')
+ @DomName('ShadowRoot.cloneNode')
@DocsEditable
- final StyleSheet sheet;
+ Node clone(bool deep) native;
- @DomName('HTMLStyleElement.type')
+ @DomName('ShadowRoot.elementFromPoint')
@DocsEditable
- String type;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ Element elementFromPoint(int x, int y) native;
+ @DomName('ShadowRoot.getElementById')
+ @DocsEditable
+ Element getElementById(String elementId) native;
-@DocsEditable
-@DomName('StyleMedia')
-class StyleMedia native "*StyleMedia" {
+ @DomName('ShadowRoot.getElementsByClassName')
+ @DocsEditable
+ @Returns('NodeList')
+ @Creates('NodeList')
+ List<Node> getElementsByClassName(String className) native;
- @DomName('StyleMedia.type')
+ @DomName('ShadowRoot.getElementsByTagName')
@DocsEditable
- final String type;
+ @Returns('NodeList')
+ @Creates('NodeList')
+ List<Node> getElementsByTagName(String tagName) native;
- @DomName('StyleMedia.matchMedium')
+ @DomName('ShadowRoot.getSelection')
@DocsEditable
- bool matchMedium(String mediaquery) native;
+ DomSelection getSelection() native;
+
+ static bool get supported =>
+ JS('bool', '!!(Element.prototype.webkitCreateShadowRoot)');
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -21266,36 +18857,23 @@ class StyleMedia native "*StyleMedia" {
@DocsEditable
-@DomName('StyleSheet')
-class StyleSheet native "*StyleSheet" {
-
- @DomName('StyleSheet.disabled')
- @DocsEditable
- bool disabled;
-
- @DomName('StyleSheet.href')
- @DocsEditable
- final String href;
-
- @DomName('StyleSheet.media')
- @DocsEditable
- final MediaList media;
-
- @DomName('StyleSheet.ownerNode')
- @DocsEditable
- final Node ownerNode;
-
- @DomName('StyleSheet.parentStyleSheet')
- @DocsEditable
- final StyleSheet parentStyleSheet;
+@DomName('SharedWorker')
+class SharedWorker extends AbstractWorker native "*SharedWorker" {
- @DomName('StyleSheet.title')
+ @DomName('SharedWorker.SharedWorker')
@DocsEditable
- final String title;
+ factory SharedWorker(String scriptURL, [String name]) {
+ if (?name) {
+ return SharedWorker._create_1(scriptURL, name);
+ }
+ return SharedWorker._create_2(scriptURL);
+ }
+ static SharedWorker _create_1(scriptURL, name) => JS('SharedWorker', 'new SharedWorker(#,#)', scriptURL, name);
+ static SharedWorker _create_2(scriptURL) => JS('SharedWorker', 'new SharedWorker(#)', scriptURL);
- @DomName('StyleSheet.type')
+ @DomName('SharedWorker.port')
@DocsEditable
- final String type;
+ final MessagePort port;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -21303,12 +18881,20 @@ class StyleSheet native "*StyleSheet" {
@DocsEditable
-@DomName('HTMLTableCaptionElement')
-class TableCaptionElement extends Element native "*HTMLTableCaptionElement" {
+@DomName('SharedWorkerContext')
+class SharedWorkerContext extends WorkerContext native "*SharedWorkerContext" {
- @DomName('HTMLTableCaptionElement.HTMLTableCaptionElement')
+ @DomName('SharedWorkerContext.connectEvent')
@DocsEditable
- factory TableCaptionElement() => document.$dom_createElement("caption");
+ static const EventStreamProvider<Event> connectEvent = const EventStreamProvider<Event>('connect');
+
+ @DomName('SharedWorkerContext.name')
+ @DocsEditable
+ final String name;
+
+ @DomName('SharedWorkerContext.onconnect')
+ @DocsEditable
+ Stream<Event> get onConnect => connectEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -21316,28 +18902,24 @@ class TableCaptionElement extends Element native "*HTMLTableCaptionElement" {
@DocsEditable
-@DomName('HTMLTableCellElement')
-class TableCellElement extends Element native "*HTMLTableCellElement" {
-
- @DomName('HTMLTableCellElement.HTMLTableCellElement')
- @DocsEditable
- factory TableCellElement() => document.$dom_createElement("td");
+@DomName('SourceBuffer')
+class SourceBuffer native "*SourceBuffer" {
- @DomName('HTMLTableCellElement.cellIndex')
+ @DomName('SourceBuffer.buffered')
@DocsEditable
- final int cellIndex;
+ final TimeRanges buffered;
- @DomName('HTMLTableCellElement.colSpan')
+ @DomName('SourceBuffer.timestampOffset')
@DocsEditable
- int colSpan;
+ num timestampOffset;
- @DomName('HTMLTableCellElement.headers')
+ @DomName('SourceBuffer.abort')
@DocsEditable
- String headers;
+ void abort() native;
- @DomName('HTMLTableCellElement.rowSpan')
+ @DomName('SourceBuffer.append')
@DocsEditable
- int rowSpan;
+ void append(Uint8List data) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -21345,382 +18927,494 @@ class TableCellElement extends Element native "*HTMLTableCellElement" {
@DocsEditable
-@DomName('HTMLTableColElement')
-class TableColElement extends Element native "*HTMLTableColElement" {
+@DomName('SourceBufferList')
+class SourceBufferList extends EventTarget implements JavaScriptIndexingBehavior, List<SourceBuffer> native "*SourceBufferList" {
- @DomName('HTMLTableColElement.HTMLTableColElement')
+ @DomName('SourceBufferList.length')
@DocsEditable
- factory TableColElement() => document.$dom_createElement("col");
+ int get length => JS("int", "#.length", this);
- @DomName('HTMLTableColElement.span')
- @DocsEditable
- int span;
-}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ SourceBuffer operator[](int index) => JS("SourceBuffer", "#[#]", this, index);
+ void operator[]=(int index, SourceBuffer value) {
+ throw new UnsupportedError("Cannot assign element of immutable List.");
+ }
+ // -- start List<SourceBuffer> mixins.
+ // SourceBuffer is the element type.
-@DocsEditable
-@DomName('HTMLTableElement')
-class TableElement extends Element native "*HTMLTableElement" {
+ // From Iterable<SourceBuffer>:
- @DomName('HTMLTableElement.tBodies')
- List<TableSectionElement> get tBodies =>
- new _WrappedList<TableSectionElement>($dom_tBodies);
+ Iterator<SourceBuffer> get iterator {
+ // Note: NodeLists are not fixed size. And most probably length shouldn't
+ // be cached in both iterator _and_ forEach method. For now caching it
+ // for consistency.
+ return new FixedSizeListIterator<SourceBuffer>(this);
+ }
- @DomName('HTMLTableElement.rows')
- List<TableRowElement> get rows =>
- new _WrappedList<TableRowElement>($dom_rows);
+ dynamic reduce(dynamic initialValue, dynamic combine(dynamic, SourceBuffer)) {
+ return IterableMixinWorkaround.reduce(this, initialValue, combine);
+ }
- TableRowElement addRow() {
- return insertRow(-1);
+ bool contains(SourceBuffer element) => IterableMixinWorkaround.contains(this, element);
+
+ void forEach(void f(SourceBuffer element)) => IterableMixinWorkaround.forEach(this, f);
+
+ String join([String separator]) =>
+ IterableMixinWorkaround.joinList(this, separator);
+
+ Iterable map(f(SourceBuffer element)) =>
+ IterableMixinWorkaround.mapList(this, f);
+
+ Iterable<SourceBuffer> where(bool f(SourceBuffer element)) =>
+ IterableMixinWorkaround.where(this, f);
+
+ Iterable expand(Iterable f(SourceBuffer element)) =>
+ IterableMixinWorkaround.expand(this, f);
+
+ bool every(bool f(SourceBuffer element)) => IterableMixinWorkaround.every(this, f);
+
+ bool any(bool f(SourceBuffer element)) => IterableMixinWorkaround.any(this, f);
+
+ List<SourceBuffer> toList({ bool growable: true }) =>
+ new List<SourceBuffer>.from(this, growable: growable);
+
+ Set<SourceBuffer> toSet() => new Set<SourceBuffer>.from(this);
+
+ bool get isEmpty => this.length == 0;
+
+ Iterable<SourceBuffer> take(int n) => IterableMixinWorkaround.takeList(this, n);
+
+ Iterable<SourceBuffer> takeWhile(bool test(SourceBuffer value)) {
+ return IterableMixinWorkaround.takeWhile(this, test);
}
- TableCaptionElement createCaption() => $dom_createCaption();
- TableSectionElement createTBody() => $dom_createTBody();
- TableSectionElement createTFoot() => $dom_createTFoot();
- TableSectionElement createTHead() => $dom_createTHead();
- TableRowElement insertRow(int index) => $dom_insertRow(index);
+ Iterable<SourceBuffer> skip(int n) => IterableMixinWorkaround.skipList(this, n);
- TableSectionElement $dom_createTBody() {
- if (JS('bool', '!!#.createTBody', this)) {
- return this._createTBody();
- }
- var tbody = new Element.tag('tbody');
- this.children.add(tbody);
- return tbody;
+ Iterable<SourceBuffer> skipWhile(bool test(SourceBuffer value)) {
+ return IterableMixinWorkaround.skipWhile(this, test);
+ }
+
+ SourceBuffer firstWhere(bool test(SourceBuffer value), { SourceBuffer orElse() }) {
+ return IterableMixinWorkaround.firstWhere(this, test, orElse);
+ }
+
+ SourceBuffer lastWhere(bool test(SourceBuffer value), {SourceBuffer orElse()}) {
+ return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+ }
+
+ SourceBuffer singleWhere(bool test(SourceBuffer value)) {
+ return IterableMixinWorkaround.singleWhere(this, test);
+ }
+
+ SourceBuffer elementAt(int index) {
+ return this[index];
+ }
+
+ // From Collection<SourceBuffer>:
+
+ void add(SourceBuffer value) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
+
+ void addLast(SourceBuffer value) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
+
+ void addAll(Iterable<SourceBuffer> iterable) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
+
+ // From List<SourceBuffer>:
+ void set length(int value) {
+ throw new UnsupportedError("Cannot resize immutable List.");
+ }
+
+ void clear() {
+ throw new UnsupportedError("Cannot clear immutable List.");
+ }
+
+ Iterable<SourceBuffer> get reversed {
+ return IterableMixinWorkaround.reversedList(this);
+ }
+
+ void sort([int compare(SourceBuffer a, SourceBuffer b)]) {
+ throw new UnsupportedError("Cannot sort immutable List.");
+ }
+
+ int indexOf(SourceBuffer element, [int start = 0]) =>
+ Lists.indexOf(this, element, start, this.length);
+
+ int lastIndexOf(SourceBuffer element, [int start]) {
+ if (start == null) start = length - 1;
+ return Lists.lastIndexOf(this, element, start);
+ }
+
+ SourceBuffer get first {
+ if (this.length > 0) return this[0];
+ throw new StateError("No elements");
+ }
+
+ SourceBuffer get last {
+ if (this.length > 0) return this[this.length - 1];
+ throw new StateError("No elements");
+ }
+
+ SourceBuffer get single {
+ if (length == 1) return this[0];
+ if (length == 0) throw new StateError("No elements");
+ throw new StateError("More than one element");
+ }
+
+ SourceBuffer min([int compare(SourceBuffer a, SourceBuffer b)]) =>
+ IterableMixinWorkaround.min(this, compare);
+
+ SourceBuffer max([int compare(SourceBuffer a, SourceBuffer b)]) =>
+ IterableMixinWorkaround.max(this, compare);
+
+ SourceBuffer removeAt(int pos) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+
+ SourceBuffer removeLast() {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+
+ void remove(Object object) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+
+ void removeAll(Iterable elements) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+
+ void retainAll(Iterable elements) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+
+ void removeWhere(bool test(SourceBuffer element)) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+
+ void retainWhere(bool test(SourceBuffer element)) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+
+ void setRange(int start, int rangeLength, List<SourceBuffer> from, [int startFrom]) {
+ throw new UnsupportedError("Cannot setRange on immutable List.");
+ }
+
+ void removeRange(int start, int rangeLength) {
+ throw new UnsupportedError("Cannot removeRange on immutable List.");
}
- @JSName('createTBody')
- TableSectionElement _createTBody() native;
+ void insertRange(int start, int rangeLength, [SourceBuffer initialValue]) {
+ throw new UnsupportedError("Cannot insertRange on immutable List.");
+ }
+ List<SourceBuffer> getRange(int start, int rangeLength) =>
+ Lists.getRange(this, start, rangeLength, <SourceBuffer>[]);
- @DomName('HTMLTableElement.HTMLTableElement')
- @DocsEditable
- factory TableElement() => document.$dom_createElement("table");
+ Map<int, SourceBuffer> asMap() =>
+ IterableMixinWorkaround.asMapList(this);
- @DomName('HTMLTableElement.border')
- @DocsEditable
- String border;
+ // -- end List<SourceBuffer> mixins.
- @DomName('HTMLTableElement.caption')
+ @JSName('addEventListener')
+ @DomName('SourceBufferList.addEventListener')
@DocsEditable
- TableCaptionElement caption;
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- @JSName('rows')
- @DomName('HTMLTableElement.rows')
+ @DomName('SourceBufferList.dispatchEvent')
@DocsEditable
- final HtmlCollection $dom_rows;
+ bool dispatchEvent(Event event) native;
- @JSName('tBodies')
- @DomName('HTMLTableElement.tBodies')
+ @DomName('SourceBufferList.item')
@DocsEditable
- final HtmlCollection $dom_tBodies;
+ SourceBuffer item(int index) native;
- @DomName('HTMLTableElement.tFoot')
+ @JSName('removeEventListener')
+ @DomName('SourceBufferList.removeEventListener')
@DocsEditable
- TableSectionElement tFoot;
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('HTMLTableElement.tHead')
- @DocsEditable
- TableSectionElement tHead;
- @JSName('createCaption')
- @DomName('HTMLTableElement.createCaption')
- @DocsEditable
- Element $dom_createCaption() native;
+@DocsEditable
+@DomName('HTMLSourceElement')
+class SourceElement extends Element native "*HTMLSourceElement" {
- @JSName('createTFoot')
- @DomName('HTMLTableElement.createTFoot')
+ @DomName('HTMLSourceElement.HTMLSourceElement')
@DocsEditable
- Element $dom_createTFoot() native;
+ factory SourceElement() => document.$dom_createElement("source");
- @JSName('createTHead')
- @DomName('HTMLTableElement.createTHead')
+ @DomName('HTMLSourceElement.media')
@DocsEditable
- Element $dom_createTHead() native;
+ String media;
- @DomName('HTMLTableElement.deleteCaption')
+ @DomName('HTMLSourceElement.src')
@DocsEditable
- void deleteCaption() native;
+ String src;
- @DomName('HTMLTableElement.deleteRow')
+ @DomName('HTMLSourceElement.type')
@DocsEditable
- void deleteRow(int index) native;
+ String type;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('HTMLTableElement.deleteTFoot')
- @DocsEditable
- void deleteTFoot() native;
- @DomName('HTMLTableElement.deleteTHead')
- @DocsEditable
- void deleteTHead() native;
+@DocsEditable
+@DomName('HTMLSpanElement')
+class SpanElement extends Element native "*HTMLSpanElement" {
- @JSName('insertRow')
- @DomName('HTMLTableElement.insertRow')
+ @DomName('HTMLSpanElement.HTMLSpanElement')
@DocsEditable
- Element $dom_insertRow(int index) native;
+ factory SpanElement() => document.$dom_createElement("span");
}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@DocsEditable
-@DomName('HTMLTableRowElement')
-class TableRowElement extends Element native "*HTMLTableRowElement" {
-
- @DomName('HTMLTableRowElement.cells')
- List<TableCellElement> get cells =>
- new _WrappedList<TableCellElement>($dom_cells);
+@DomName('SpeechGrammar')
+class SpeechGrammar native "*SpeechGrammar" {
- TableCellElement addCell() {
- return insertCell(-1);
+ @DomName('SpeechGrammar.SpeechGrammar')
+ @DocsEditable
+ factory SpeechGrammar() {
+ return SpeechGrammar._create_1();
}
+ static SpeechGrammar _create_1() => JS('SpeechGrammar', 'new SpeechGrammar()');
- TableCellElement insertCell(int index) => $dom_insertCell(index);
-
-
- @DomName('HTMLTableRowElement.HTMLTableRowElement')
+ @DomName('SpeechGrammar.src')
@DocsEditable
- factory TableRowElement() => document.$dom_createElement("tr");
+ String src;
- @JSName('cells')
- @DomName('HTMLTableRowElement.cells')
+ @DomName('SpeechGrammar.weight')
@DocsEditable
- final HtmlCollection $dom_cells;
+ num weight;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('HTMLTableRowElement.rowIndex')
- @DocsEditable
- final int rowIndex;
- @DomName('HTMLTableRowElement.sectionRowIndex')
- @DocsEditable
- final int sectionRowIndex;
+@DocsEditable
+@DomName('SpeechGrammarList')
+class SpeechGrammarList implements JavaScriptIndexingBehavior, List<SpeechGrammar> native "*SpeechGrammarList" {
- @DomName('HTMLTableRowElement.deleteCell')
+ @DomName('SpeechGrammarList.SpeechGrammarList')
@DocsEditable
- void deleteCell(int index) native;
+ factory SpeechGrammarList() {
+ return SpeechGrammarList._create_1();
+ }
+ static SpeechGrammarList _create_1() => JS('SpeechGrammarList', 'new SpeechGrammarList()');
- @JSName('insertCell')
- @DomName('HTMLTableRowElement.insertCell')
+ @DomName('SpeechGrammarList.length')
@DocsEditable
- Element $dom_insertCell(int index) native;
-}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ int get length => JS("int", "#.length", this);
+ SpeechGrammar operator[](int index) => JS("SpeechGrammar", "#[#]", this, index);
-@DocsEditable
-@DomName('HTMLTableSectionElement')
-class TableSectionElement extends Element native "*HTMLTableSectionElement" {
+ void operator[]=(int index, SpeechGrammar value) {
+ throw new UnsupportedError("Cannot assign element of immutable List.");
+ }
+ // -- start List<SpeechGrammar> mixins.
+ // SpeechGrammar is the element type.
- @DomName('HTMLTableSectionElement.rows')
- List<TableRowElement> get rows =>
- new _WrappedList<TableRowElement>($dom_rows);
+ // From Iterable<SpeechGrammar>:
- TableRowElement addRow() {
- return insertRow(-1);
+ Iterator<SpeechGrammar> get iterator {
+ // Note: NodeLists are not fixed size. And most probably length shouldn't
+ // be cached in both iterator _and_ forEach method. For now caching it
+ // for consistency.
+ return new FixedSizeListIterator<SpeechGrammar>(this);
}
- TableRowElement insertRow(int index) => $dom_insertRow(index);
+ dynamic reduce(dynamic initialValue, dynamic combine(dynamic, SpeechGrammar)) {
+ return IterableMixinWorkaround.reduce(this, initialValue, combine);
+ }
+ bool contains(SpeechGrammar element) => IterableMixinWorkaround.contains(this, element);
- @JSName('rows')
- @DomName('HTMLTableSectionElement.rows')
- @DocsEditable
- final HtmlCollection $dom_rows;
+ void forEach(void f(SpeechGrammar element)) => IterableMixinWorkaround.forEach(this, f);
- @DomName('HTMLTableSectionElement.deleteRow')
- @DocsEditable
- void deleteRow(int index) native;
+ String join([String separator]) =>
+ IterableMixinWorkaround.joinList(this, separator);
- @JSName('insertRow')
- @DomName('HTMLTableSectionElement.insertRow')
- @DocsEditable
- Element $dom_insertRow(int index) native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ Iterable map(f(SpeechGrammar element)) =>
+ IterableMixinWorkaround.mapList(this, f);
-// WARNING: Do not edit - generated code.
+ Iterable<SpeechGrammar> where(bool f(SpeechGrammar element)) =>
+ IterableMixinWorkaround.where(this, f);
+ Iterable expand(Iterable f(SpeechGrammar element)) =>
+ IterableMixinWorkaround.expand(this, f);
-@DomName('Text')
-class Text extends CharacterData native "*Text" {
- factory Text(String data) => _TextFactoryProvider.createText(data);
+ bool every(bool f(SpeechGrammar element)) => IterableMixinWorkaround.every(this, f);
- @DomName('Text.wholeText')
- @DocsEditable
- final String wholeText;
+ bool any(bool f(SpeechGrammar element)) => IterableMixinWorkaround.any(this, f);
- @DomName('Text.replaceWholeText')
- @DocsEditable
- Text replaceWholeText(String content) native;
+ List<SpeechGrammar> toList({ bool growable: true }) =>
+ new List<SpeechGrammar>.from(this, growable: growable);
- @DomName('Text.splitText')
- @DocsEditable
- Text splitText(int offset) native;
+ Set<SpeechGrammar> toSet() => new Set<SpeechGrammar>.from(this);
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ bool get isEmpty => this.length == 0;
+ Iterable<SpeechGrammar> take(int n) => IterableMixinWorkaround.takeList(this, n);
-@DocsEditable
-@DomName('HTMLTextAreaElement')
-class TextAreaElement extends Element native "*HTMLTextAreaElement" {
+ Iterable<SpeechGrammar> takeWhile(bool test(SpeechGrammar value)) {
+ return IterableMixinWorkaround.takeWhile(this, test);
+ }
- @DomName('HTMLTextAreaElement.HTMLTextAreaElement')
- @DocsEditable
- factory TextAreaElement() => document.$dom_createElement("textarea");
+ Iterable<SpeechGrammar> skip(int n) => IterableMixinWorkaround.skipList(this, n);
- @DomName('HTMLTextAreaElement.autofocus')
- @DocsEditable
- bool autofocus;
+ Iterable<SpeechGrammar> skipWhile(bool test(SpeechGrammar value)) {
+ return IterableMixinWorkaround.skipWhile(this, test);
+ }
- @DomName('HTMLTextAreaElement.cols')
- @DocsEditable
- int cols;
+ SpeechGrammar firstWhere(bool test(SpeechGrammar value), { SpeechGrammar orElse() }) {
+ return IterableMixinWorkaround.firstWhere(this, test, orElse);
+ }
- @DomName('HTMLTextAreaElement.defaultValue')
- @DocsEditable
- String defaultValue;
+ SpeechGrammar lastWhere(bool test(SpeechGrammar value), {SpeechGrammar orElse()}) {
+ return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+ }
- @DomName('HTMLTextAreaElement.dirName')
- @DocsEditable
- String dirName;
+ SpeechGrammar singleWhere(bool test(SpeechGrammar value)) {
+ return IterableMixinWorkaround.singleWhere(this, test);
+ }
+
+ SpeechGrammar elementAt(int index) {
+ return this[index];
+ }
+
+ // From Collection<SpeechGrammar>:
- @DomName('HTMLTextAreaElement.disabled')
- @DocsEditable
- bool disabled;
+ void add(SpeechGrammar value) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('HTMLTextAreaElement.form')
- @DocsEditable
- final FormElement form;
+ void addLast(SpeechGrammar value) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('HTMLTextAreaElement.labels')
- @DocsEditable
- @Returns('NodeList')
- @Creates('NodeList')
- final List<Node> labels;
+ void addAll(Iterable<SpeechGrammar> iterable) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('HTMLTextAreaElement.maxLength')
- @DocsEditable
- int maxLength;
+ // From List<SpeechGrammar>:
+ void set length(int value) {
+ throw new UnsupportedError("Cannot resize immutable List.");
+ }
- @DomName('HTMLTextAreaElement.name')
- @DocsEditable
- String name;
+ void clear() {
+ throw new UnsupportedError("Cannot clear immutable List.");
+ }
- @DomName('HTMLTextAreaElement.placeholder')
- @DocsEditable
- String placeholder;
+ Iterable<SpeechGrammar> get reversed {
+ return IterableMixinWorkaround.reversedList(this);
+ }
- @DomName('HTMLTextAreaElement.readOnly')
- @DocsEditable
- bool readOnly;
+ void sort([int compare(SpeechGrammar a, SpeechGrammar b)]) {
+ throw new UnsupportedError("Cannot sort immutable List.");
+ }
- @DomName('HTMLTextAreaElement.required')
- @DocsEditable
- bool required;
+ int indexOf(SpeechGrammar element, [int start = 0]) =>
+ Lists.indexOf(this, element, start, this.length);
- @DomName('HTMLTextAreaElement.rows')
- @DocsEditable
- int rows;
+ int lastIndexOf(SpeechGrammar element, [int start]) {
+ if (start == null) start = length - 1;
+ return Lists.lastIndexOf(this, element, start);
+ }
- @DomName('HTMLTextAreaElement.selectionDirection')
- @DocsEditable
- String selectionDirection;
+ SpeechGrammar get first {
+ if (this.length > 0) return this[0];
+ throw new StateError("No elements");
+ }
- @DomName('HTMLTextAreaElement.selectionEnd')
- @DocsEditable
- int selectionEnd;
+ SpeechGrammar get last {
+ if (this.length > 0) return this[this.length - 1];
+ throw new StateError("No elements");
+ }
- @DomName('HTMLTextAreaElement.selectionStart')
- @DocsEditable
- int selectionStart;
+ SpeechGrammar get single {
+ if (length == 1) return this[0];
+ if (length == 0) throw new StateError("No elements");
+ throw new StateError("More than one element");
+ }
- @DomName('HTMLTextAreaElement.textLength')
- @DocsEditable
- final int textLength;
+ SpeechGrammar min([int compare(SpeechGrammar a, SpeechGrammar b)]) =>
+ IterableMixinWorkaround.min(this, compare);
- @DomName('HTMLTextAreaElement.type')
- @DocsEditable
- final String type;
+ SpeechGrammar max([int compare(SpeechGrammar a, SpeechGrammar b)]) =>
+ IterableMixinWorkaround.max(this, compare);
- @DomName('HTMLTextAreaElement.validationMessage')
- @DocsEditable
- final String validationMessage;
+ SpeechGrammar removeAt(int pos) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('HTMLTextAreaElement.validity')
- @DocsEditable
- final ValidityState validity;
+ SpeechGrammar removeLast() {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('HTMLTextAreaElement.value')
- @DocsEditable
- String value;
+ void remove(Object object) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('HTMLTextAreaElement.willValidate')
- @DocsEditable
- final bool willValidate;
+ void removeAll(Iterable elements) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('HTMLTextAreaElement.wrap')
- @DocsEditable
- String wrap;
+ void retainAll(Iterable elements) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('HTMLTextAreaElement.checkValidity')
- @DocsEditable
- bool checkValidity() native;
+ void removeWhere(bool test(SpeechGrammar element)) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('HTMLTextAreaElement.select')
- @DocsEditable
- void select() native;
+ void retainWhere(bool test(SpeechGrammar element)) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('HTMLTextAreaElement.setCustomValidity')
- @DocsEditable
- void setCustomValidity(String error) native;
+ void setRange(int start, int rangeLength, List<SpeechGrammar> from, [int startFrom]) {
+ throw new UnsupportedError("Cannot setRange on immutable List.");
+ }
- @DomName('HTMLTextAreaElement.setRangeText')
- @DocsEditable
- void setRangeText(String replacement, [int start, int end, String selectionMode]) native;
+ void removeRange(int start, int rangeLength) {
+ throw new UnsupportedError("Cannot removeRange on immutable List.");
+ }
- @DomName('HTMLTextAreaElement.setSelectionRange')
- @DocsEditable
- void setSelectionRange(int start, int end, [String direction]) native;
-}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ void insertRange(int start, int rangeLength, [SpeechGrammar initialValue]) {
+ throw new UnsupportedError("Cannot insertRange on immutable List.");
+ }
-// WARNING: Do not edit - generated code.
+ List<SpeechGrammar> getRange(int start, int rangeLength) =>
+ Lists.getRange(this, start, rangeLength, <SpeechGrammar>[]);
+ Map<int, SpeechGrammar> asMap() =>
+ IterableMixinWorkaround.asMapList(this);
-@DomName('TextEvent')
-class TextEvent extends UIEvent native "*TextEvent" {
- factory TextEvent(String type,
- {bool canBubble: false, bool cancelable: false, Window view, String data}) {
- if (view == null) {
- view = window;
- }
- var e = document.$dom_createEvent("TextEvent");
- e.$dom_initTextEvent(type, canBubble, cancelable, view, data);
- return e;
- }
+ // -- end List<SpeechGrammar> mixins.
- @DomName('TextEvent.data')
+ @DomName('SpeechGrammarList.addFromString')
@DocsEditable
- final String data;
+ void addFromString(String string, [num weight]) native;
- @JSName('initTextEvent')
- @DomName('TextEvent.initTextEvent')
+ @DomName('SpeechGrammarList.addFromUri')
@DocsEditable
- void $dom_initTextEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Window viewArg, String dataArg) native;
+ void addFromUri(String src, [num weight]) native;
+ @DomName('SpeechGrammarList.item')
+ @DocsEditable
+ SpeechGrammar item(int index) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -21728,12 +19422,14 @@ class TextEvent extends UIEvent native "*TextEvent" {
@DocsEditable
-@DomName('TextMetrics')
-class TextMetrics native "*TextMetrics" {
+@DomName('SpeechInputEvent')
+class SpeechInputEvent extends Event native "*SpeechInputEvent" {
- @DomName('TextMetrics.width')
+ @DomName('SpeechInputEvent.results')
@DocsEditable
- final num width;
+ @Returns('_SpeechInputResultList')
+ @Creates('_SpeechInputResultList')
+ final List<SpeechInputResult> results;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -21741,591 +19437,623 @@ class TextMetrics native "*TextMetrics" {
@DocsEditable
-@DomName('TextTrack')
-class TextTrack extends EventTarget native "*TextTrack" {
-
- @DomName('TextTrack.cuechangeEvent')
- @DocsEditable
- static const EventStreamProvider<Event> cueChangeEvent = const EventStreamProvider<Event>('cuechange');
-
- @DomName('TextTrack.activeCues')
- @DocsEditable
- final TextTrackCueList activeCues;
-
- @DomName('TextTrack.cues')
- @DocsEditable
- final TextTrackCueList cues;
-
- @DomName('TextTrack.kind')
- @DocsEditable
- final String kind;
-
- @DomName('TextTrack.label')
- @DocsEditable
- final String label;
-
- @DomName('TextTrack.language')
- @DocsEditable
- final String language;
-
- @DomName('TextTrack.mode')
- @DocsEditable
- String mode;
-
- @DomName('TextTrack.addCue')
- @DocsEditable
- void addCue(TextTrackCue cue) native;
-
- @JSName('addEventListener')
- @DomName('TextTrack.addEventListener')
- @DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
-
- @DomName('TextTrack.dispatchEvent')
- @DocsEditable
- bool dispatchEvent(Event evt) native;
-
- @DomName('TextTrack.removeCue')
- @DocsEditable
- void removeCue(TextTrackCue cue) native;
+@DomName('SpeechInputResult')
+class SpeechInputResult native "*SpeechInputResult" {
- @JSName('removeEventListener')
- @DomName('TextTrack.removeEventListener')
+ @DomName('SpeechInputResult.confidence')
@DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ final num confidence;
- @DomName('TextTrack.oncuechange')
+ @DomName('SpeechInputResult.utterance')
@DocsEditable
- Stream<Event> get onCueChange => cueChangeEvent.forTarget(this);
+ final String utterance;
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-@DocsEditable
-@DomName('TextTrackCue')
-class TextTrackCue extends EventTarget native "*TextTrackCue" {
+@DomName('SpeechRecognition')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental
+class SpeechRecognition extends EventTarget native "*SpeechRecognition" {
+
+ @DomName('SpeechRecognition.audioendEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> audioEndEvent = const EventStreamProvider<Event>('audioend');
+
+ @DomName('SpeechRecognition.audiostartEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> audioStartEvent = const EventStreamProvider<Event>('audiostart');
- @DomName('TextTrackCue.enterEvent')
+ @DomName('SpeechRecognition.endEvent')
@DocsEditable
- static const EventStreamProvider<Event> enterEvent = const EventStreamProvider<Event>('enter');
+ static const EventStreamProvider<Event> endEvent = const EventStreamProvider<Event>('end');
- @DomName('TextTrackCue.exitEvent')
+ @DomName('SpeechRecognition.errorEvent')
@DocsEditable
- static const EventStreamProvider<Event> exitEvent = const EventStreamProvider<Event>('exit');
+ static const EventStreamProvider<SpeechRecognitionError> errorEvent = const EventStreamProvider<SpeechRecognitionError>('error');
- @DomName('TextTrackCue.TextTrackCue')
+ @DomName('SpeechRecognition.nomatchEvent')
@DocsEditable
- factory TextTrackCue(num startTime, num endTime, String text) {
- return TextTrackCue._create_1(startTime, endTime, text);
- }
- static TextTrackCue _create_1(startTime, endTime, text) => JS('TextTrackCue', 'new TextTrackCue(#,#,#)', startTime, endTime, text);
+ static const EventStreamProvider<SpeechRecognitionEvent> noMatchEvent = const EventStreamProvider<SpeechRecognitionEvent>('nomatch');
- @DomName('TextTrackCue.align')
+ @DomName('SpeechRecognition.resultEvent')
@DocsEditable
- String align;
+ static const EventStreamProvider<SpeechRecognitionEvent> resultEvent = const EventStreamProvider<SpeechRecognitionEvent>('result');
- @DomName('TextTrackCue.endTime')
+ @DomName('SpeechRecognition.soundendEvent')
@DocsEditable
- num endTime;
+ static const EventStreamProvider<Event> soundEndEvent = const EventStreamProvider<Event>('soundend');
- @DomName('TextTrackCue.id')
+ @DomName('SpeechRecognition.soundstartEvent')
@DocsEditable
- String id;
+ static const EventStreamProvider<Event> soundStartEvent = const EventStreamProvider<Event>('soundstart');
- @DomName('TextTrackCue.line')
+ @DomName('SpeechRecognition.speechendEvent')
@DocsEditable
- int line;
+ static const EventStreamProvider<Event> speechEndEvent = const EventStreamProvider<Event>('speechend');
- @DomName('TextTrackCue.pauseOnExit')
+ @DomName('SpeechRecognition.speechstartEvent')
@DocsEditable
- bool pauseOnExit;
+ static const EventStreamProvider<Event> speechStartEvent = const EventStreamProvider<Event>('speechstart');
- @DomName('TextTrackCue.position')
+ @DomName('SpeechRecognition.startEvent')
@DocsEditable
- int position;
+ static const EventStreamProvider<Event> startEvent = const EventStreamProvider<Event>('start');
- @DomName('TextTrackCue.size')
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => JS('bool', '!!(window.SpeechRecognition || window.webkitSpeechRecognition)');
+
+ @DomName('SpeechRecognition.continuous')
@DocsEditable
- int size;
+ bool continuous;
- @DomName('TextTrackCue.snapToLines')
+ @DomName('SpeechRecognition.grammars')
@DocsEditable
- bool snapToLines;
+ SpeechGrammarList grammars;
- @DomName('TextTrackCue.startTime')
+ @DomName('SpeechRecognition.interimResults')
@DocsEditable
- num startTime;
+ bool interimResults;
- @DomName('TextTrackCue.text')
+ @DomName('SpeechRecognition.lang')
@DocsEditable
- String text;
+ String lang;
- @DomName('TextTrackCue.track')
+ @DomName('SpeechRecognition.maxAlternatives')
@DocsEditable
- final TextTrack track;
+ int maxAlternatives;
- @DomName('TextTrackCue.vertical')
+ @DomName('SpeechRecognition.abort')
@DocsEditable
- String vertical;
+ void abort() native;
@JSName('addEventListener')
- @DomName('TextTrackCue.addEventListener')
+ @DomName('SpeechRecognition.addEventListener')
@DocsEditable
void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('TextTrackCue.dispatchEvent')
+ @DomName('SpeechRecognition.dispatchEvent')
@DocsEditable
bool dispatchEvent(Event evt) native;
- @JSName('getCueAsHTML')
- @DomName('TextTrackCue.getCueAsHTML')
- @DocsEditable
- DocumentFragment getCueAsHtml() native;
-
@JSName('removeEventListener')
- @DomName('TextTrackCue.removeEventListener')
+ @DomName('SpeechRecognition.removeEventListener')
@DocsEditable
void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('TextTrackCue.onenter')
+ @DomName('SpeechRecognition.start')
@DocsEditable
- Stream<Event> get onEnter => enterEvent.forTarget(this);
+ void start() native;
- @DomName('TextTrackCue.onexit')
+ @DomName('SpeechRecognition.stop')
@DocsEditable
- Stream<Event> get onExit => exitEvent.forTarget(this);
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-@DocsEditable
-@DomName('TextTrackCueList')
-class TextTrackCueList implements List<TextTrackCue>, JavaScriptIndexingBehavior native "*TextTrackCueList" {
+ void stop() native;
- @DomName('TextTrackCueList.length')
+ @DomName('SpeechRecognition.onaudioend')
@DocsEditable
- int get length => JS("int", "#.length", this);
-
- TextTrackCue operator[](int index) => JS("TextTrackCue", "#[#]", this, index);
-
- void operator[]=(int index, TextTrackCue value) {
- throw new UnsupportedError("Cannot assign element of immutable List.");
- }
- // -- start List<TextTrackCue> mixins.
- // TextTrackCue is the element type.
-
- // From Iterable<TextTrackCue>:
+ Stream<Event> get onAudioEnd => audioEndEvent.forTarget(this);
- Iterator<TextTrackCue> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<TextTrackCue>(this);
- }
+ @DomName('SpeechRecognition.onaudiostart')
+ @DocsEditable
+ Stream<Event> get onAudioStart => audioStartEvent.forTarget(this);
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, TextTrackCue)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
+ @DomName('SpeechRecognition.onend')
+ @DocsEditable
+ Stream<Event> get onEnd => endEvent.forTarget(this);
- bool contains(TextTrackCue element) => IterableMixinWorkaround.contains(this, element);
+ @DomName('SpeechRecognition.onerror')
+ @DocsEditable
+ Stream<SpeechRecognitionError> get onError => errorEvent.forTarget(this);
- void forEach(void f(TextTrackCue element)) => IterableMixinWorkaround.forEach(this, f);
+ @DomName('SpeechRecognition.onnomatch')
+ @DocsEditable
+ Stream<SpeechRecognitionEvent> get onNoMatch => noMatchEvent.forTarget(this);
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
+ @DomName('SpeechRecognition.onresult')
+ @DocsEditable
+ Stream<SpeechRecognitionEvent> get onResult => resultEvent.forTarget(this);
- Iterable map(f(TextTrackCue element)) =>
- IterableMixinWorkaround.mapList(this, f);
+ @DomName('SpeechRecognition.onsoundend')
+ @DocsEditable
+ Stream<Event> get onSoundEnd => soundEndEvent.forTarget(this);
- Iterable<TextTrackCue> where(bool f(TextTrackCue element)) =>
- IterableMixinWorkaround.where(this, f);
+ @DomName('SpeechRecognition.onsoundstart')
+ @DocsEditable
+ Stream<Event> get onSoundStart => soundStartEvent.forTarget(this);
- Iterable expand(Iterable f(TextTrackCue element)) =>
- IterableMixinWorkaround.expand(this, f);
+ @DomName('SpeechRecognition.onspeechend')
+ @DocsEditable
+ Stream<Event> get onSpeechEnd => speechEndEvent.forTarget(this);
- bool every(bool f(TextTrackCue element)) => IterableMixinWorkaround.every(this, f);
+ @DomName('SpeechRecognition.onspeechstart')
+ @DocsEditable
+ Stream<Event> get onSpeechStart => speechStartEvent.forTarget(this);
- bool any(bool f(TextTrackCue element)) => IterableMixinWorkaround.any(this, f);
+ @DomName('SpeechRecognition.onstart')
+ @DocsEditable
+ Stream<Event> get onStart => startEvent.forTarget(this);
- List<TextTrackCue> toList({ bool growable: true }) =>
- new List<TextTrackCue>.from(this, growable: growable);
+ factory SpeechRecognition() {
+ return JS('SpeechRecognition',
+ 'new (window.SpeechRecognition || window.webkitSpeechRecognition)()');
+ }
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- Set<TextTrackCue> toSet() => new Set<TextTrackCue>.from(this);
- bool get isEmpty => this.length == 0;
+@DocsEditable
+@DomName('SpeechRecognitionAlternative')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental
+class SpeechRecognitionAlternative native "*SpeechRecognitionAlternative" {
- Iterable<TextTrackCue> take(int n) => IterableMixinWorkaround.takeList(this, n);
+ @DomName('SpeechRecognitionAlternative.confidence')
+ @DocsEditable
+ final num confidence;
- Iterable<TextTrackCue> takeWhile(bool test(TextTrackCue value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
+ @DomName('SpeechRecognitionAlternative.transcript')
+ @DocsEditable
+ final String transcript;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- Iterable<TextTrackCue> skip(int n) => IterableMixinWorkaround.skipList(this, n);
- Iterable<TextTrackCue> skipWhile(bool test(TextTrackCue value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
+@DocsEditable
+@DomName('SpeechRecognitionError')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental
+class SpeechRecognitionError extends Event native "*SpeechRecognitionError" {
- TextTrackCue firstWhere(bool test(TextTrackCue value), { TextTrackCue orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
+ @DomName('SpeechRecognitionError.error')
+ @DocsEditable
+ final String error;
- TextTrackCue lastWhere(bool test(TextTrackCue value), {TextTrackCue orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
+ @DomName('SpeechRecognitionError.message')
+ @DocsEditable
+ final String message;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- TextTrackCue singleWhere(bool test(TextTrackCue value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
- TextTrackCue elementAt(int index) {
- return this[index];
- }
+@DocsEditable
+@DomName('SpeechRecognitionEvent')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental
+class SpeechRecognitionEvent extends Event native "*SpeechRecognitionEvent" {
- // From Collection<TextTrackCue>:
+ @DomName('SpeechRecognitionEvent.result')
+ @DocsEditable
+ final SpeechRecognitionResult result;
- void add(TextTrackCue value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('SpeechRecognitionEvent.resultHistory')
+ @DocsEditable
+ @Returns('_SpeechRecognitionResultList')
+ @Creates('_SpeechRecognitionResultList')
+ final List<SpeechRecognitionResult> resultHistory;
- void addLast(TextTrackCue value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('SpeechRecognitionEvent.resultIndex')
+ @DocsEditable
+ final int resultIndex;
- void addAll(Iterable<TextTrackCue> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('SpeechRecognitionEvent.results')
+ @DocsEditable
+ @Returns('_SpeechRecognitionResultList')
+ @Creates('_SpeechRecognitionResultList')
+ final List<SpeechRecognitionResult> results;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- // From List<TextTrackCue>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
+@DocsEditable
+@DomName('SpeechRecognitionResult')
+@SupportedBrowser(SupportedBrowser.CHROME, '25')
+@Experimental
+class SpeechRecognitionResult native "*SpeechRecognitionResult" {
- Iterable<TextTrackCue> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
+ @DomName('SpeechRecognitionResult.isFinal')
+ @DocsEditable
+ final bool isFinal;
- void sort([int compare(TextTrackCue a, TextTrackCue b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
+ @DomName('SpeechRecognitionResult.length')
+ @DocsEditable
+ final int length;
- int indexOf(TextTrackCue element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
+ @DomName('SpeechRecognitionResult.item')
+ @DocsEditable
+ SpeechRecognitionAlternative item(int index) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- int lastIndexOf(TextTrackCue element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
- TextTrackCue get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
+/**
+ * The type used by the
+ * [Window.localStorage] and [Window.sessionStorage] properties.
+ * Storage is implemented as a Map&lt;String, String>.
+ *
+ * To store and get values, use Dart's built-in map syntax:
+ *
+ * window.localStorage['key1'] = 'val1';
+ * window.localStorage['key2'] = 'val2';
+ * window.localStorage['key3'] = 'val3';
+ * assert(window.localStorage['key3'] == 'val3');
+ *
+ * You can use [Map](http://api.dartlang.org/dart_core/Map.html) APIs
+ * such as containsValue(), clear(), and length:
+ *
+ * assert(window.localStorage.containsValue('does not exist') == false);
+ * window.localStorage.clear();
+ * assert(window.localStorage.length == 0);
+ *
+ * For more examples of using this API, see
+ * [localstorage_test.dart](http://code.google.com/p/dart/source/browse/branches/bleeding_edge/dart/tests/html/localstorage_test.dart).
+ * For details on using the Map API, see the
+ * [Maps](http://www.dartlang.org/docs/library-tour/#maps-aka-dictionaries-or-hashes)
+ * section of the library tour.
+ */
+@DomName('Storage')
+class Storage implements Map<String, String>
+ native "*Storage" {
- TextTrackCue get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
+ // TODO(nweiz): update this when maps support lazy iteration
+ bool containsValue(String value) => values.any((e) => e == value);
- TextTrackCue get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
+ bool containsKey(String key) => $dom_getItem(key) != null;
- TextTrackCue min([int compare(TextTrackCue a, TextTrackCue b)]) =>
- IterableMixinWorkaround.min(this, compare);
+ String operator [](String key) => $dom_getItem(key);
- TextTrackCue max([int compare(TextTrackCue a, TextTrackCue b)]) =>
- IterableMixinWorkaround.max(this, compare);
+ void operator []=(String key, String value) { $dom_setItem(key, value); }
- TextTrackCue removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
+ String putIfAbsent(String key, String ifAbsent()) {
+ if (!containsKey(key)) this[key] = ifAbsent();
+ return this[key];
}
- TextTrackCue removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
+ String remove(String key) {
+ final value = this[key];
+ $dom_removeItem(key);
+ return value;
}
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ void clear() => $dom_clear();
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ void forEach(void f(String key, String value)) {
+ for (var i = 0; true; i++) {
+ final key = $dom_key(i);
+ if (key == null) return;
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
+ f(key, this[key]);
+ }
}
- void removeWhere(bool test(TextTrackCue element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
+ Collection<String> get keys {
+ final keys = [];
+ forEach((k, v) => keys.add(k));
+ return keys;
}
- void retainWhere(bool test(TextTrackCue element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
+ Collection<String> get values {
+ final values = [];
+ forEach((k, v) => values.add(v));
+ return values;
}
- void setRange(int start, int rangeLength, List<TextTrackCue> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
+ int get length => $dom_length;
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
+ bool get isEmpty => $dom_key(0) == null;
- void insertRange(int start, int rangeLength, [TextTrackCue initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
+ @JSName('length')
+ @DomName('Storage.length')
+ @DocsEditable
+ final int $dom_length;
- List<TextTrackCue> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <TextTrackCue>[]);
+ @JSName('clear')
+ @DomName('Storage.clear')
+ @DocsEditable
+ void $dom_clear() native;
- Map<int, TextTrackCue> asMap() =>
- IterableMixinWorkaround.asMapList(this);
+ @JSName('getItem')
+ @DomName('Storage.getItem')
+ @DocsEditable
+ String $dom_getItem(String key) native;
- // -- end List<TextTrackCue> mixins.
+ @JSName('key')
+ @DomName('Storage.key')
+ @DocsEditable
+ String $dom_key(int index) native;
- @DomName('TextTrackCueList.getCueById')
+ @JSName('removeItem')
+ @DomName('Storage.removeItem')
@DocsEditable
- TextTrackCue getCueById(String id) native;
+ void $dom_removeItem(String key) native;
- @DomName('TextTrackCueList.item')
+ @JSName('setItem')
+ @DomName('Storage.setItem')
@DocsEditable
- TextTrackCue item(int index) native;
+ void $dom_setItem(String key, String data) native;
+
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// WARNING: Do not edit - generated code.
-@DocsEditable
-@DomName('TextTrackList')
-class TextTrackList extends EventTarget implements JavaScriptIndexingBehavior, List<TextTrack> native "*TextTrackList" {
- @DomName('TextTrackList.addtrackEvent')
- @DocsEditable
- static const EventStreamProvider<TrackEvent> addTrackEvent = const EventStreamProvider<TrackEvent>('addtrack');
+@DomName('StorageEvent')
+class StorageEvent extends Event native "*StorageEvent" {
+ factory StorageEvent(String type,
+ {bool canBubble: false, bool cancelable: false, String key, String oldValue,
+ String newValue, String url, Storage storageArea}) {
- @DomName('TextTrackList.length')
- @DocsEditable
- int get length => JS("int", "#.length", this);
+ var e = document.$dom_createEvent("StorageEvent");
+ e.$dom_initStorageEvent(type, canBubble, cancelable, key, oldValue,
+ newValue, url, storageArea);
+ return e;
+ }
- TextTrack operator[](int index) => JS("TextTrack", "#[#]", this, index);
+ @DomName('StorageEvent.key')
+ @DocsEditable
+ final String key;
- void operator[]=(int index, TextTrack value) {
- throw new UnsupportedError("Cannot assign element of immutable List.");
- }
- // -- start List<TextTrack> mixins.
- // TextTrack is the element type.
+ @DomName('StorageEvent.newValue')
+ @DocsEditable
+ final String newValue;
- // From Iterable<TextTrack>:
+ @DomName('StorageEvent.oldValue')
+ @DocsEditable
+ final String oldValue;
- Iterator<TextTrack> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<TextTrack>(this);
- }
+ @DomName('StorageEvent.storageArea')
+ @DocsEditable
+ final Storage storageArea;
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, TextTrack)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
+ @DomName('StorageEvent.url')
+ @DocsEditable
+ final String url;
- bool contains(TextTrack element) => IterableMixinWorkaround.contains(this, element);
+ @JSName('initStorageEvent')
+ @DomName('StorageEvent.initStorageEvent')
+ @DocsEditable
+ void $dom_initStorageEvent(String typeArg, bool canBubbleArg, bool cancelableArg, String keyArg, String oldValueArg, String newValueArg, String urlArg, Storage storageAreaArg) native;
- void forEach(void f(TextTrack element)) => IterableMixinWorkaround.forEach(this, f);
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
- Iterable map(f(TextTrack element)) =>
- IterableMixinWorkaround.mapList(this, f);
+@DocsEditable
+@DomName('StorageInfo')
+class StorageInfo native "*StorageInfo" {
- Iterable<TextTrack> where(bool f(TextTrack element)) =>
- IterableMixinWorkaround.where(this, f);
+ static const int PERSISTENT = 1;
- Iterable expand(Iterable f(TextTrack element)) =>
- IterableMixinWorkaround.expand(this, f);
+ static const int TEMPORARY = 0;
- bool every(bool f(TextTrack element)) => IterableMixinWorkaround.every(this, f);
+ @JSName('queryUsageAndQuota')
+ @DomName('StorageInfo.queryUsageAndQuota')
+ @DocsEditable
+ void _queryUsageAndQuota(int storageType, [_StorageInfoUsageCallback usageCallback, _StorageInfoErrorCallback errorCallback]) native;
- bool any(bool f(TextTrack element)) => IterableMixinWorkaround.any(this, f);
+ @JSName('queryUsageAndQuota')
+ @DomName('StorageInfo.queryUsageAndQuota')
+ @DocsEditable
+ Future<int> queryUsageAndQuota(int storageType) {
+ var completer = new Completer<int>();
+ _queryUsageAndQuota(storageType,
+ (value) { completer.complete(value); },
+ (error) { completer.completeError(error); });
+ return completer.future;
+ }
- List<TextTrack> toList({ bool growable: true }) =>
- new List<TextTrack>.from(this, growable: growable);
+ @JSName('requestQuota')
+ @DomName('StorageInfo.requestQuota')
+ @DocsEditable
+ void _requestQuota(int storageType, int newQuotaInBytes, [StorageInfoQuotaCallback quotaCallback, _StorageInfoErrorCallback errorCallback]) native;
- Set<TextTrack> toSet() => new Set<TextTrack>.from(this);
+ @JSName('requestQuota')
+ @DomName('StorageInfo.requestQuota')
+ @DocsEditable
+ Future<int> requestQuota(int storageType, int newQuotaInBytes) {
+ var completer = new Completer<int>();
+ _requestQuota(storageType, newQuotaInBytes,
+ (value) { completer.complete(value); },
+ (error) { completer.completeError(error); });
+ return completer.future;
+ }
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- bool get isEmpty => this.length == 0;
+// WARNING: Do not edit - generated code.
- Iterable<TextTrack> take(int n) => IterableMixinWorkaround.takeList(this, n);
- Iterable<TextTrack> takeWhile(bool test(TextTrack value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
+typedef void _StorageInfoErrorCallback(DomException error);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- Iterable<TextTrack> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+// WARNING: Do not edit - generated code.
- Iterable<TextTrack> skipWhile(bool test(TextTrack value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
- TextTrack firstWhere(bool test(TextTrack value), { TextTrack orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
+typedef void StorageInfoQuotaCallback(int grantedQuotaInBytes);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- TextTrack lastWhere(bool test(TextTrack value), {TextTrack orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
+// WARNING: Do not edit - generated code.
- TextTrack singleWhere(bool test(TextTrack value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
- TextTrack elementAt(int index) {
- return this[index];
- }
+typedef void _StorageInfoUsageCallback(int currentUsageInBytes, int currentQuotaInBytes);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- // From Collection<TextTrack>:
+// WARNING: Do not edit - generated code.
- void add(TextTrack value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
- void addLast(TextTrack value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+typedef void _StringCallback(String data);
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void addAll(Iterable<TextTrack> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
- // From List<TextTrack>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
+@DocsEditable
+@DomName('HTMLStyleElement')
+class StyleElement extends Element native "*HTMLStyleElement" {
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
+ @DomName('HTMLStyleElement.HTMLStyleElement')
+ @DocsEditable
+ factory StyleElement() => document.$dom_createElement("style");
- Iterable<TextTrack> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
+ @DomName('HTMLStyleElement.disabled')
+ @DocsEditable
+ bool disabled;
- void sort([int compare(TextTrack a, TextTrack b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
+ @DomName('HTMLStyleElement.media')
+ @DocsEditable
+ String media;
- int indexOf(TextTrack element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
+ @DomName('HTMLStyleElement.scoped')
+ @DocsEditable
+ bool scoped;
- int lastIndexOf(TextTrack element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
+ @DomName('HTMLStyleElement.sheet')
+ @DocsEditable
+ final StyleSheet sheet;
- TextTrack get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
+ @DomName('HTMLStyleElement.type')
+ @DocsEditable
+ String type;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- TextTrack get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
- TextTrack get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
+@DocsEditable
+@DomName('StyleMedia')
+class StyleMedia native "*StyleMedia" {
- TextTrack min([int compare(TextTrack a, TextTrack b)]) =>
- IterableMixinWorkaround.min(this, compare);
+ @DomName('StyleMedia.type')
+ @DocsEditable
+ final String type;
- TextTrack max([int compare(TextTrack a, TextTrack b)]) =>
- IterableMixinWorkaround.max(this, compare);
+ @DomName('StyleMedia.matchMedium')
+ @DocsEditable
+ bool matchMedium(String mediaquery) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- TextTrack removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
- TextTrack removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+@DocsEditable
+@DomName('StyleSheet')
+class StyleSheet native "*StyleSheet" {
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('StyleSheet.disabled')
+ @DocsEditable
+ bool disabled;
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('StyleSheet.href')
+ @DocsEditable
+ final String href;
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('StyleSheet.media')
+ @DocsEditable
+ final MediaList media;
- void removeWhere(bool test(TextTrack element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('StyleSheet.ownerNode')
+ @DocsEditable
+ final Node ownerNode;
- void retainWhere(bool test(TextTrack element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('StyleSheet.parentStyleSheet')
+ @DocsEditable
+ final StyleSheet parentStyleSheet;
- void setRange(int start, int rangeLength, List<TextTrack> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
+ @DomName('StyleSheet.title')
+ @DocsEditable
+ final String title;
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
+ @DomName('StyleSheet.type')
+ @DocsEditable
+ final String type;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void insertRange(int start, int rangeLength, [TextTrack initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
- List<TextTrack> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <TextTrack>[]);
+@DocsEditable
+@DomName('HTMLTableCaptionElement')
+class TableCaptionElement extends Element native "*HTMLTableCaptionElement" {
- Map<int, TextTrack> asMap() =>
- IterableMixinWorkaround.asMapList(this);
+ @DomName('HTMLTableCaptionElement.HTMLTableCaptionElement')
+ @DocsEditable
+ factory TableCaptionElement() => document.$dom_createElement("caption");
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- // -- end List<TextTrack> mixins.
- @JSName('addEventListener')
- @DomName('TextTrackList.addEventListener')
+@DocsEditable
+@DomName('HTMLTableCellElement')
+class TableCellElement extends Element native "*HTMLTableCellElement" {
+
+ @DomName('HTMLTableCellElement.HTMLTableCellElement')
@DocsEditable
- void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+ factory TableCellElement() => document.$dom_createElement("td");
- @DomName('TextTrackList.dispatchEvent')
+ @DomName('HTMLTableCellElement.cellIndex')
@DocsEditable
- bool dispatchEvent(Event evt) native;
+ final int cellIndex;
- @DomName('TextTrackList.item')
+ @DomName('HTMLTableCellElement.colSpan')
@DocsEditable
- TextTrack item(int index) native;
+ int colSpan;
- @JSName('removeEventListener')
- @DomName('TextTrackList.removeEventListener')
+ @DomName('HTMLTableCellElement.headers')
@DocsEditable
- void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ String headers;
- @DomName('TextTrackList.onaddtrack')
+ @DomName('HTMLTableCellElement.rowSpan')
@DocsEditable
- Stream<TrackEvent> get onAddTrack => addTrackEvent.forTarget(this);
+ int rowSpan;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -22333,418 +20061,458 @@ class TextTrackList extends EventTarget implements JavaScriptIndexingBehavior, L
@DocsEditable
-@DomName('TimeRanges')
-class TimeRanges native "*TimeRanges" {
-
- @DomName('TimeRanges.length')
- @DocsEditable
- final int length;
+@DomName('HTMLTableColElement')
+class TableColElement extends Element native "*HTMLTableColElement" {
- @DomName('TimeRanges.end')
+ @DomName('HTMLTableColElement.HTMLTableColElement')
@DocsEditable
- num end(int index) native;
+ factory TableColElement() => document.$dom_createElement("col");
- @DomName('TimeRanges.start')
+ @DomName('HTMLTableColElement.span')
@DocsEditable
- num start(int index) native;
+ int span;
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// WARNING: Do not edit - generated code.
+@DocsEditable
+@DomName('HTMLTableElement')
+class TableElement extends Element native "*HTMLTableElement" {
-typedef void TimeoutHandler();
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @DomName('HTMLTableElement.tBodies')
+ List<TableSectionElement> get tBodies =>
+ new _WrappedList<TableSectionElement>($dom_tBodies);
+ @DomName('HTMLTableElement.rows')
+ List<TableRowElement> get rows =>
+ new _WrappedList<TableRowElement>($dom_rows);
-@DocsEditable
-@DomName('HTMLTitleElement')
-class TitleElement extends Element native "*HTMLTitleElement" {
+ TableRowElement addRow() {
+ return insertRow(-1);
+ }
- @DomName('HTMLTitleElement.HTMLTitleElement')
+ TableCaptionElement createCaption() => $dom_createCaption();
+ TableSectionElement createTBody() => $dom_createTBody();
+ TableSectionElement createTFoot() => $dom_createTFoot();
+ TableSectionElement createTHead() => $dom_createTHead();
+ TableRowElement insertRow(int index) => $dom_insertRow(index);
+
+ TableSectionElement $dom_createTBody() {
+ if (JS('bool', '!!#.createTBody', this)) {
+ return this._createTBody();
+ }
+ var tbody = new Element.tag('tbody');
+ this.children.add(tbody);
+ return tbody;
+ }
+
+ @JSName('createTBody')
+ TableSectionElement _createTBody() native;
+
+
+ @DomName('HTMLTableElement.HTMLTableElement')
@DocsEditable
- factory TitleElement() => document.$dom_createElement("title");
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ factory TableElement() => document.$dom_createElement("table");
+ @DomName('HTMLTableElement.border')
+ @DocsEditable
+ String border;
-@DocsEditable
-@DomName('Touch')
-class Touch native "*Touch" {
+ @DomName('HTMLTableElement.caption')
+ @DocsEditable
+ TableCaptionElement caption;
- @JSName('clientX')
- @DomName('Touch.clientX')
+ @JSName('rows')
+ @DomName('HTMLTableElement.rows')
@DocsEditable
- final int $dom_clientX;
+ final HtmlCollection $dom_rows;
- @JSName('clientY')
- @DomName('Touch.clientY')
+ @JSName('tBodies')
+ @DomName('HTMLTableElement.tBodies')
@DocsEditable
- final int $dom_clientY;
+ final HtmlCollection $dom_tBodies;
- @DomName('Touch.identifier')
+ @DomName('HTMLTableElement.tFoot')
@DocsEditable
- final int identifier;
+ TableSectionElement tFoot;
- @JSName('pageX')
- @DomName('Touch.pageX')
+ @DomName('HTMLTableElement.tHead')
@DocsEditable
- final int $dom_pageX;
+ TableSectionElement tHead;
- @JSName('pageY')
- @DomName('Touch.pageY')
+ @JSName('createCaption')
+ @DomName('HTMLTableElement.createCaption')
@DocsEditable
- final int $dom_pageY;
+ Element $dom_createCaption() native;
- @JSName('screenX')
- @DomName('Touch.screenX')
+ @JSName('createTFoot')
+ @DomName('HTMLTableElement.createTFoot')
@DocsEditable
- final int $dom_screenX;
+ Element $dom_createTFoot() native;
- @JSName('screenY')
- @DomName('Touch.screenY')
+ @JSName('createTHead')
+ @DomName('HTMLTableElement.createTHead')
@DocsEditable
- final int $dom_screenY;
+ Element $dom_createTHead() native;
- EventTarget get target => _convertNativeToDart_EventTarget(this._get_target);
- @JSName('target')
- @DomName('Touch.target')
+ @DomName('HTMLTableElement.deleteCaption')
@DocsEditable
- @Creates('Element|Document')
- @Returns('Element|Document')
- final dynamic _get_target;
+ void deleteCaption() native;
- @JSName('webkitForce')
- @DomName('Touch.webkitForce')
+ @DomName('HTMLTableElement.deleteRow')
@DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- final num force;
+ void deleteRow(int index) native;
- @JSName('webkitRadiusX')
- @DomName('Touch.webkitRadiusX')
+ @DomName('HTMLTableElement.deleteTFoot')
@DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- final int radiusX;
+ void deleteTFoot() native;
- @JSName('webkitRadiusY')
- @DomName('Touch.webkitRadiusY')
+ @DomName('HTMLTableElement.deleteTHead')
@DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- final int radiusY;
+ void deleteTHead() native;
- @JSName('webkitRotationAngle')
- @DomName('Touch.webkitRotationAngle')
+ @JSName('insertRow')
+ @DomName('HTMLTableElement.insertRow')
@DocsEditable
- @SupportedBrowser(SupportedBrowser.CHROME)
- @SupportedBrowser(SupportedBrowser.SAFARI)
- @Experimental
- final num rotationAngle;
+ Element $dom_insertRow(int index) native;
+}
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- @DomName('Touch.clientX')
- @DomName('Touch.clientY')
- Point get client => new Point($dom_clientX, $dom_clientY);
+@DocsEditable
+@DomName('HTMLTableRowElement')
+class TableRowElement extends Element native "*HTMLTableRowElement" {
- @DomName('Touch.pageX')
- @DomName('Touch.pageY')
- Point get page => new Point($dom_pageX, $dom_pageY);
+ @DomName('HTMLTableRowElement.cells')
+ List<TableCellElement> get cells =>
+ new _WrappedList<TableCellElement>($dom_cells);
- @DomName('Touch.screenX')
- @DomName('Touch.screenY')
- Point get screen => new Point($dom_screenX, $dom_screenY);
+ TableCellElement addCell() {
+ return insertCell(-1);
+ }
+
+ TableCellElement insertCell(int index) => $dom_insertCell(index);
+
+
+ @DomName('HTMLTableRowElement.HTMLTableRowElement')
+ @DocsEditable
+ factory TableRowElement() => document.$dom_createElement("tr");
+
+ @JSName('cells')
+ @DomName('HTMLTableRowElement.cells')
+ @DocsEditable
+ final HtmlCollection $dom_cells;
+
+ @DomName('HTMLTableRowElement.rowIndex')
+ @DocsEditable
+ final int rowIndex;
+
+ @DomName('HTMLTableRowElement.sectionRowIndex')
+ @DocsEditable
+ final int sectionRowIndex;
+
+ @DomName('HTMLTableRowElement.deleteCell')
+ @DocsEditable
+ void deleteCell(int index) native;
+
+ @JSName('insertCell')
+ @DomName('HTMLTableRowElement.insertCell')
+ @DocsEditable
+ Element $dom_insertCell(int index) native;
}
// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// WARNING: Do not edit - generated code.
+@DocsEditable
+@DomName('HTMLTableSectionElement')
+class TableSectionElement extends Element native "*HTMLTableSectionElement" {
-@DomName('TouchEvent')
-class TouchEvent extends UIEvent native "*TouchEvent" {
- factory TouchEvent(TouchList touches, TouchList targetTouches,
- TouchList changedTouches, String type,
- {Window view, int screenX: 0, int screenY: 0, int clientX: 0,
- int clientY: 0, bool ctrlKey: false, bool altKey: false,
- bool shiftKey: false, bool metaKey: false}) {
- if (view == null) {
- view = window;
- }
- var e = document.$dom_createEvent("TouchEvent");
- e.$dom_initTouchEvent(touches, targetTouches, changedTouches, type, view,
- screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey);
- return e;
+ @DomName('HTMLTableSectionElement.rows')
+ List<TableRowElement> get rows =>
+ new _WrappedList<TableRowElement>($dom_rows);
+
+ TableRowElement addRow() {
+ return insertRow(-1);
}
- @DomName('TouchEvent.altKey')
+ TableRowElement insertRow(int index) => $dom_insertRow(index);
+
+
+ @JSName('rows')
+ @DomName('HTMLTableSectionElement.rows')
@DocsEditable
- final bool altKey;
+ final HtmlCollection $dom_rows;
- @DomName('TouchEvent.changedTouches')
+ @DomName('HTMLTableSectionElement.deleteRow')
@DocsEditable
- final TouchList changedTouches;
+ void deleteRow(int index) native;
- @DomName('TouchEvent.ctrlKey')
+ @JSName('insertRow')
+ @DomName('HTMLTableSectionElement.insertRow')
@DocsEditable
- final bool ctrlKey;
+ Element $dom_insertRow(int index) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
- @DomName('TouchEvent.metaKey')
- @DocsEditable
- final bool metaKey;
- @DomName('TouchEvent.shiftKey')
- @DocsEditable
- final bool shiftKey;
+@DomName('Text')
+class Text extends CharacterData native "*Text" {
+ factory Text(String data) => _TextFactoryProvider.createText(data);
- @DomName('TouchEvent.targetTouches')
+ @DomName('Text.wholeText')
@DocsEditable
- final TouchList targetTouches;
+ final String wholeText;
- @DomName('TouchEvent.touches')
+ @DomName('Text.replaceWholeText')
@DocsEditable
- final TouchList touches;
+ Text replaceWholeText(String content) native;
- @JSName('initTouchEvent')
- @DomName('TouchEvent.initTouchEvent')
+ @DomName('Text.splitText')
@DocsEditable
- void $dom_initTouchEvent(TouchList touches, TouchList targetTouches, TouchList changedTouches, String type, Window view, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) native;
-
+ Text splitText(int offset) native;
- /**
- * Checks if touch events supported on the current platform.
- *
- * Note that touch events are only supported if the user is using a touch
- * device.
- */
- static bool get supported {
- if (JS('bool', '"ontouchstart" in window')) {
- return Device.isEventTypeSupported('TouchEvent');
- }
- return false;
- }
}
-// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-// WARNING: Do not edit - generated code.
-
-@DomName('TouchList')
-class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "*TouchList" {
- /// NB: This constructor likely does not work as you might expect it to! This
- /// constructor will simply fail (returning null) if you are not on a device
- /// with touch enabled. See dartbug.com/8314.
- factory TouchList() => document.$dom_createTouchList();
-
- /// Checks if this type is supported on the current platform.
- static bool get supported => JS('bool', '!!document.createTouchList');
+@DocsEditable
+@DomName('HTMLTextAreaElement')
+class TextAreaElement extends Element native "*HTMLTextAreaElement" {
- @DomName('TouchList.length')
+ @DomName('HTMLTextAreaElement.HTMLTextAreaElement')
@DocsEditable
- int get length => JS("int", "#.length", this);
-
- Touch operator[](int index) => JS("Touch", "#[#]", this, index);
+ factory TextAreaElement() => document.$dom_createElement("textarea");
- void operator[]=(int index, Touch value) {
- throw new UnsupportedError("Cannot assign element of immutable List.");
- }
- // -- start List<Touch> mixins.
- // Touch is the element type.
+ @DomName('HTMLTextAreaElement.autofocus')
+ @DocsEditable
+ bool autofocus;
- // From Iterable<Touch>:
+ @DomName('HTMLTextAreaElement.cols')
+ @DocsEditable
+ int cols;
- Iterator<Touch> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<Touch>(this);
- }
+ @DomName('HTMLTextAreaElement.defaultValue')
+ @DocsEditable
+ String defaultValue;
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Touch)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
+ @DomName('HTMLTextAreaElement.dirName')
+ @DocsEditable
+ String dirName;
- bool contains(Touch element) => IterableMixinWorkaround.contains(this, element);
+ @DomName('HTMLTextAreaElement.disabled')
+ @DocsEditable
+ bool disabled;
- void forEach(void f(Touch element)) => IterableMixinWorkaround.forEach(this, f);
+ @DomName('HTMLTextAreaElement.form')
+ @DocsEditable
+ final FormElement form;
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
+ @DomName('HTMLTextAreaElement.labels')
+ @DocsEditable
+ @Returns('NodeList')
+ @Creates('NodeList')
+ final List<Node> labels;
- Iterable map(f(Touch element)) =>
- IterableMixinWorkaround.mapList(this, f);
+ @DomName('HTMLTextAreaElement.maxLength')
+ @DocsEditable
+ int maxLength;
- Iterable<Touch> where(bool f(Touch element)) =>
- IterableMixinWorkaround.where(this, f);
+ @DomName('HTMLTextAreaElement.name')
+ @DocsEditable
+ String name;
- Iterable expand(Iterable f(Touch element)) =>
- IterableMixinWorkaround.expand(this, f);
+ @DomName('HTMLTextAreaElement.placeholder')
+ @DocsEditable
+ String placeholder;
- bool every(bool f(Touch element)) => IterableMixinWorkaround.every(this, f);
+ @DomName('HTMLTextAreaElement.readOnly')
+ @DocsEditable
+ bool readOnly;
- bool any(bool f(Touch element)) => IterableMixinWorkaround.any(this, f);
+ @DomName('HTMLTextAreaElement.required')
+ @DocsEditable
+ bool required;
- List<Touch> toList({ bool growable: true }) =>
- new List<Touch>.from(this, growable: growable);
+ @DomName('HTMLTextAreaElement.rows')
+ @DocsEditable
+ int rows;
- Set<Touch> toSet() => new Set<Touch>.from(this);
+ @DomName('HTMLTextAreaElement.selectionDirection')
+ @DocsEditable
+ String selectionDirection;
- bool get isEmpty => this.length == 0;
+ @DomName('HTMLTextAreaElement.selectionEnd')
+ @DocsEditable
+ int selectionEnd;
- Iterable<Touch> take(int n) => IterableMixinWorkaround.takeList(this, n);
+ @DomName('HTMLTextAreaElement.selectionStart')
+ @DocsEditable
+ int selectionStart;
- Iterable<Touch> takeWhile(bool test(Touch value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
+ @DomName('HTMLTextAreaElement.textLength')
+ @DocsEditable
+ final int textLength;
- Iterable<Touch> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+ @DomName('HTMLTextAreaElement.type')
+ @DocsEditable
+ final String type;
- Iterable<Touch> skipWhile(bool test(Touch value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
+ @DomName('HTMLTextAreaElement.validationMessage')
+ @DocsEditable
+ final String validationMessage;
- Touch firstWhere(bool test(Touch value), { Touch orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
+ @DomName('HTMLTextAreaElement.validity')
+ @DocsEditable
+ final ValidityState validity;
- Touch lastWhere(bool test(Touch value), {Touch orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
+ @DomName('HTMLTextAreaElement.value')
+ @DocsEditable
+ String value;
- Touch singleWhere(bool test(Touch value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
+ @DomName('HTMLTextAreaElement.willValidate')
+ @DocsEditable
+ final bool willValidate;
- Touch elementAt(int index) {
- return this[index];
- }
+ @DomName('HTMLTextAreaElement.wrap')
+ @DocsEditable
+ String wrap;
- // From Collection<Touch>:
+ @DomName('HTMLTextAreaElement.checkValidity')
+ @DocsEditable
+ bool checkValidity() native;
- void add(Touch value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('HTMLTextAreaElement.select')
+ @DocsEditable
+ void select() native;
- void addLast(Touch value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('HTMLTextAreaElement.setCustomValidity')
+ @DocsEditable
+ void setCustomValidity(String error) native;
- void addAll(Iterable<Touch> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('HTMLTextAreaElement.setRangeText')
+ @DocsEditable
+ void setRangeText(String replacement, [int start, int end, String selectionMode]) native;
- // From List<Touch>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
+ @DomName('HTMLTextAreaElement.setSelectionRange')
+ @DocsEditable
+ void setSelectionRange(int start, int end, [String direction]) native;
+}
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
+// WARNING: Do not edit - generated code.
- Iterable<Touch> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
- void sort([int compare(Touch a, Touch b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
+@DomName('TextEvent')
+class TextEvent extends UIEvent native "*TextEvent" {
+ factory TextEvent(String type,
+ {bool canBubble: false, bool cancelable: false, Window view, String data}) {
+ if (view == null) {
+ view = window;
+ }
+ var e = document.$dom_createEvent("TextEvent");
+ e.$dom_initTextEvent(type, canBubble, cancelable, view, data);
+ return e;
}
- int indexOf(Touch element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
-
- int lastIndexOf(Touch element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
+ @DomName('TextEvent.data')
+ @DocsEditable
+ final String data;
- Touch get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
+ @JSName('initTextEvent')
+ @DomName('TextEvent.initTextEvent')
+ @DocsEditable
+ void $dom_initTextEvent(String typeArg, bool canBubbleArg, bool cancelableArg, Window viewArg, String dataArg) native;
- Touch get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- Touch get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
- Touch min([int compare(Touch a, Touch b)]) =>
- IterableMixinWorkaround.min(this, compare);
+@DocsEditable
+@DomName('TextMetrics')
+class TextMetrics native "*TextMetrics" {
- Touch max([int compare(Touch a, Touch b)]) =>
- IterableMixinWorkaround.max(this, compare);
+ @DomName('TextMetrics.width')
+ @DocsEditable
+ final num width;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- Touch removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
- Touch removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+@DocsEditable
+@DomName('TextTrack')
+class TextTrack extends EventTarget native "*TextTrack" {
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('TextTrack.cuechangeEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> cueChangeEvent = const EventStreamProvider<Event>('cuechange');
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('TextTrack.activeCues')
+ @DocsEditable
+ final TextTrackCueList activeCues;
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('TextTrack.cues')
+ @DocsEditable
+ final TextTrackCueList cues;
- void removeWhere(bool test(Touch element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('TextTrack.kind')
+ @DocsEditable
+ final String kind;
- void retainWhere(bool test(Touch element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('TextTrack.label')
+ @DocsEditable
+ final String label;
- void setRange(int start, int rangeLength, List<Touch> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
+ @DomName('TextTrack.language')
+ @DocsEditable
+ final String language;
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
+ @DomName('TextTrack.mode')
+ @DocsEditable
+ String mode;
- void insertRange(int start, int rangeLength, [Touch initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
+ @DomName('TextTrack.addCue')
+ @DocsEditable
+ void addCue(TextTrackCue cue) native;
- List<Touch> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <Touch>[]);
+ @JSName('addEventListener')
+ @DomName('TextTrack.addEventListener')
+ @DocsEditable
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- Map<int, Touch> asMap() =>
- IterableMixinWorkaround.asMapList(this);
+ @DomName('TextTrack.dispatchEvent')
+ @DocsEditable
+ bool dispatchEvent(Event evt) native;
- // -- end List<Touch> mixins.
+ @DomName('TextTrack.removeCue')
+ @DocsEditable
+ void removeCue(TextTrackCue cue) native;
- @DomName('TouchList.item')
+ @JSName('removeEventListener')
+ @DomName('TextTrack.removeEventListener')
@DocsEditable
- Touch item(int index) native;
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+ @DomName('TextTrack.oncuechange')
+ @DocsEditable
+ Stream<Event> get onCueChange => cueChangeEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -22752,68 +20520,98 @@ class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "*Touc
@DocsEditable
-@DomName('HTMLTrackElement')
-@SupportedBrowser(SupportedBrowser.CHROME)
-@SupportedBrowser(SupportedBrowser.IE, '10')
-@SupportedBrowser(SupportedBrowser.SAFARI)
-class TrackElement extends Element native "*HTMLTrackElement" {
+@DomName('TextTrackCue')
+class TextTrackCue extends EventTarget native "*TextTrackCue" {
- @DomName('HTMLTrackElement.HTMLTrackElement')
+ @DomName('TextTrackCue.enterEvent')
@DocsEditable
- factory TrackElement() => document.$dom_createElement("track");
+ static const EventStreamProvider<Event> enterEvent = const EventStreamProvider<Event>('enter');
- /// Checks if this type is supported on the current platform.
- static bool get supported => Element.isTagSupported('track');
+ @DomName('TextTrackCue.exitEvent')
+ @DocsEditable
+ static const EventStreamProvider<Event> exitEvent = const EventStreamProvider<Event>('exit');
- static const int ERROR = 3;
+ @DomName('TextTrackCue.TextTrackCue')
+ @DocsEditable
+ factory TextTrackCue(num startTime, num endTime, String text) {
+ return TextTrackCue._create_1(startTime, endTime, text);
+ }
+ static TextTrackCue _create_1(startTime, endTime, text) => JS('TextTrackCue', 'new TextTrackCue(#,#,#)', startTime, endTime, text);
- static const int LOADED = 2;
+ @DomName('TextTrackCue.align')
+ @DocsEditable
+ String align;
- static const int LOADING = 1;
+ @DomName('TextTrackCue.endTime')
+ @DocsEditable
+ num endTime;
- static const int NONE = 0;
+ @DomName('TextTrackCue.id')
+ @DocsEditable
+ String id;
- @JSName('default')
- @DomName('HTMLTrackElement.default')
+ @DomName('TextTrackCue.line')
@DocsEditable
- bool defaultValue;
+ int line;
- @DomName('HTMLTrackElement.kind')
+ @DomName('TextTrackCue.pauseOnExit')
@DocsEditable
- String kind;
+ bool pauseOnExit;
- @DomName('HTMLTrackElement.label')
+ @DomName('TextTrackCue.position')
@DocsEditable
- String label;
+ int position;
- @DomName('HTMLTrackElement.readyState')
+ @DomName('TextTrackCue.size')
@DocsEditable
- final int readyState;
+ int size;
- @DomName('HTMLTrackElement.src')
+ @DomName('TextTrackCue.snapToLines')
@DocsEditable
- String src;
+ bool snapToLines;
- @DomName('HTMLTrackElement.srclang')
+ @DomName('TextTrackCue.startTime')
@DocsEditable
- String srclang;
+ num startTime;
- @DomName('HTMLTrackElement.track')
+ @DomName('TextTrackCue.text')
+ @DocsEditable
+ String text;
+
+ @DomName('TextTrackCue.track')
@DocsEditable
final TextTrack track;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ @DomName('TextTrackCue.vertical')
+ @DocsEditable
+ String vertical;
-@DocsEditable
-@DomName('TrackEvent')
-class TrackEvent extends Event native "*TrackEvent" {
+ @JSName('addEventListener')
+ @DomName('TextTrackCue.addEventListener')
+ @DocsEditable
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
- @DomName('TrackEvent.track')
+ @DomName('TextTrackCue.dispatchEvent')
@DocsEditable
- final Object track;
+ bool dispatchEvent(Event evt) native;
+
+ @JSName('getCueAsHTML')
+ @DomName('TextTrackCue.getCueAsHTML')
+ @DocsEditable
+ DocumentFragment getCueAsHtml() native;
+
+ @JSName('removeEventListener')
+ @DomName('TextTrackCue.removeEventListener')
+ @DocsEditable
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+
+ @DomName('TextTrackCue.onenter')
+ @DocsEditable
+ Stream<Event> get onEnter => enterEvent.forTarget(this);
+
+ @DomName('TextTrackCue.onexit')
+ @DocsEditable
+ Stream<Event> get onExit => exitEvent.forTarget(this);
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -22821,186 +20619,205 @@ class TrackEvent extends Event native "*TrackEvent" {
@DocsEditable
-@DomName('TransitionEvent')
-class TransitionEvent extends Event native "*TransitionEvent" {
+@DomName('TextTrackCueList')
+class TextTrackCueList implements List<TextTrackCue>, JavaScriptIndexingBehavior native "*TextTrackCueList" {
+
+ @DomName('TextTrackCueList.length')
+ @DocsEditable
+ int get length => JS("int", "#.length", this);
+
+ TextTrackCue operator[](int index) => JS("TextTrackCue", "#[#]", this, index);
+
+ void operator[]=(int index, TextTrackCue value) {
+ throw new UnsupportedError("Cannot assign element of immutable List.");
+ }
+ // -- start List<TextTrackCue> mixins.
+ // TextTrackCue is the element type.
+
+ // From Iterable<TextTrackCue>:
+
+ Iterator<TextTrackCue> get iterator {
+ // Note: NodeLists are not fixed size. And most probably length shouldn't
+ // be cached in both iterator _and_ forEach method. For now caching it
+ // for consistency.
+ return new FixedSizeListIterator<TextTrackCue>(this);
+ }
+
+ dynamic reduce(dynamic initialValue, dynamic combine(dynamic, TextTrackCue)) {
+ return IterableMixinWorkaround.reduce(this, initialValue, combine);
+ }
+
+ bool contains(TextTrackCue element) => IterableMixinWorkaround.contains(this, element);
+
+ void forEach(void f(TextTrackCue element)) => IterableMixinWorkaround.forEach(this, f);
+
+ String join([String separator]) =>
+ IterableMixinWorkaround.joinList(this, separator);
+
+ Iterable map(f(TextTrackCue element)) =>
+ IterableMixinWorkaround.mapList(this, f);
+
+ Iterable<TextTrackCue> where(bool f(TextTrackCue element)) =>
+ IterableMixinWorkaround.where(this, f);
+
+ Iterable expand(Iterable f(TextTrackCue element)) =>
+ IterableMixinWorkaround.expand(this, f);
+
+ bool every(bool f(TextTrackCue element)) => IterableMixinWorkaround.every(this, f);
+
+ bool any(bool f(TextTrackCue element)) => IterableMixinWorkaround.any(this, f);
+
+ List<TextTrackCue> toList({ bool growable: true }) =>
+ new List<TextTrackCue>.from(this, growable: growable);
+
+ Set<TextTrackCue> toSet() => new Set<TextTrackCue>.from(this);
- @DomName('TransitionEvent.elapsedTime')
- @DocsEditable
- final num elapsedTime;
+ bool get isEmpty => this.length == 0;
- @DomName('TransitionEvent.propertyName')
- @DocsEditable
- final String propertyName;
+ Iterable<TextTrackCue> take(int n) => IterableMixinWorkaround.takeList(this, n);
- @DomName('TransitionEvent.pseudoElement')
- @DocsEditable
- final String pseudoElement;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ Iterable<TextTrackCue> takeWhile(bool test(TextTrackCue value)) {
+ return IterableMixinWorkaround.takeWhile(this, test);
+ }
+ Iterable<TextTrackCue> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-@DocsEditable
-@DomName('TreeWalker')
-class TreeWalker native "*TreeWalker" {
+ Iterable<TextTrackCue> skipWhile(bool test(TextTrackCue value)) {
+ return IterableMixinWorkaround.skipWhile(this, test);
+ }
- @DomName('TreeWalker.currentNode')
- @DocsEditable
- Node currentNode;
+ TextTrackCue firstWhere(bool test(TextTrackCue value), { TextTrackCue orElse() }) {
+ return IterableMixinWorkaround.firstWhere(this, test, orElse);
+ }
- @DomName('TreeWalker.expandEntityReferences')
- @DocsEditable
- final bool expandEntityReferences;
+ TextTrackCue lastWhere(bool test(TextTrackCue value), {TextTrackCue orElse()}) {
+ return IterableMixinWorkaround.lastWhereList(this, test, orElse);
+ }
- @DomName('TreeWalker.filter')
- @DocsEditable
- final NodeFilter filter;
+ TextTrackCue singleWhere(bool test(TextTrackCue value)) {
+ return IterableMixinWorkaround.singleWhere(this, test);
+ }
- @DomName('TreeWalker.root')
- @DocsEditable
- final Node root;
+ TextTrackCue elementAt(int index) {
+ return this[index];
+ }
- @DomName('TreeWalker.whatToShow')
- @DocsEditable
- final int whatToShow;
+ // From Collection<TextTrackCue>:
- @DomName('TreeWalker.firstChild')
- @DocsEditable
- Node firstChild() native;
+ void add(TextTrackCue value) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('TreeWalker.lastChild')
- @DocsEditable
- Node lastChild() native;
+ void addLast(TextTrackCue value) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('TreeWalker.nextNode')
- @DocsEditable
- Node nextNode() native;
+ void addAll(Iterable<TextTrackCue> iterable) {
+ throw new UnsupportedError("Cannot add to immutable List.");
+ }
- @DomName('TreeWalker.nextSibling')
- @DocsEditable
- Node nextSibling() native;
+ // From List<TextTrackCue>:
+ void set length(int value) {
+ throw new UnsupportedError("Cannot resize immutable List.");
+ }
- @DomName('TreeWalker.parentNode')
- @DocsEditable
- Node parentNode() native;
+ void clear() {
+ throw new UnsupportedError("Cannot clear immutable List.");
+ }
- @DomName('TreeWalker.previousNode')
- @DocsEditable
- Node previousNode() native;
+ Iterable<TextTrackCue> get reversed {
+ return IterableMixinWorkaround.reversedList(this);
+ }
- @DomName('TreeWalker.previousSibling')
- @DocsEditable
- Node previousSibling() native;
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ void sort([int compare(TextTrackCue a, TextTrackCue b)]) {
+ throw new UnsupportedError("Cannot sort immutable List.");
+ }
-// WARNING: Do not edit - generated code.
+ int indexOf(TextTrackCue element, [int start = 0]) =>
+ Lists.indexOf(this, element, start, this.length);
+ int lastIndexOf(TextTrackCue element, [int start]) {
+ if (start == null) start = length - 1;
+ return Lists.lastIndexOf(this, element, start);
+ }
-@DomName('UIEvent')
-class UIEvent extends Event native "*UIEvent" {
- // In JS, canBubble and cancelable are technically required parameters to
- // init*Event. In practice, though, if they aren't provided they simply
- // default to false (since that's Boolean(undefined)).
- //
- // Contrary to JS, we default canBubble and cancelable to true, since that's
- // what people want most of the time anyway.
- factory UIEvent(String type,
- {Window view, int detail: 0, bool canBubble: true,
- bool cancelable: true}) {
- if (view == null) {
- view = window;
- }
- final e = document.$dom_createEvent("UIEvent");
- e.$dom_initUIEvent(type, canBubble, cancelable, view, detail);
- return e;
+ TextTrackCue get first {
+ if (this.length > 0) return this[0];
+ throw new StateError("No elements");
}
- @JSName('charCode')
- @DomName('UIEvent.charCode')
- @DocsEditable
- final int $dom_charCode;
+ TextTrackCue get last {
+ if (this.length > 0) return this[this.length - 1];
+ throw new StateError("No elements");
+ }
- @DomName('UIEvent.detail')
- @DocsEditable
- final int detail;
+ TextTrackCue get single {
+ if (length == 1) return this[0];
+ if (length == 0) throw new StateError("No elements");
+ throw new StateError("More than one element");
+ }
- @JSName('keyCode')
- @DomName('UIEvent.keyCode')
- @DocsEditable
- final int $dom_keyCode;
+ TextTrackCue min([int compare(TextTrackCue a, TextTrackCue b)]) =>
+ IterableMixinWorkaround.min(this, compare);
- @JSName('layerX')
- @DomName('UIEvent.layerX')
- @DocsEditable
- final int $dom_layerX;
+ TextTrackCue max([int compare(TextTrackCue a, TextTrackCue b)]) =>
+ IterableMixinWorkaround.max(this, compare);
- @JSName('layerY')
- @DomName('UIEvent.layerY')
- @DocsEditable
- final int $dom_layerY;
+ TextTrackCue removeAt(int pos) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @JSName('pageX')
- @DomName('UIEvent.pageX')
- @DocsEditable
- final int $dom_pageX;
+ TextTrackCue removeLast() {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @JSName('pageY')
- @DomName('UIEvent.pageY')
- @DocsEditable
- final int $dom_pageY;
+ void remove(Object object) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- WindowBase get view => _convertNativeToDart_Window(this._get_view);
- @JSName('view')
- @DomName('UIEvent.view')
- @DocsEditable
- @Creates('Window|=Object')
- @Returns('Window|=Object')
- final dynamic _get_view;
+ void removeAll(Iterable elements) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @DomName('UIEvent.which')
- @DocsEditable
- final int which;
+ void retainAll(Iterable elements) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @JSName('initUIEvent')
- @DomName('UIEvent.initUIEvent')
- @DocsEditable
- void $dom_initUIEvent(String type, bool canBubble, bool cancelable, Window view, int detail) native;
+ void removeWhere(bool test(TextTrackCue element)) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
+ void retainWhere(bool test(TextTrackCue element)) {
+ throw new UnsupportedError("Cannot remove from immutable List.");
+ }
- @deprecated
- int get layerX => layer.x;
- @deprecated
- int get layerY => layer.y;
+ void setRange(int start, int rangeLength, List<TextTrackCue> from, [int startFrom]) {
+ throw new UnsupportedError("Cannot setRange on immutable List.");
+ }
- @deprecated
- int get pageX => page.x;
- @deprecated
- int get pageY => page.y;
+ void removeRange(int start, int rangeLength) {
+ throw new UnsupportedError("Cannot removeRange on immutable List.");
+ }
- @DomName('UIEvent.layerX')
- @DomName('UIEvent.layerY')
- Point get layer => new Point($dom_layerX, $dom_layerY);
+ void insertRange(int start, int rangeLength, [TextTrackCue initialValue]) {
+ throw new UnsupportedError("Cannot insertRange on immutable List.");
+ }
- @DomName('UIEvent.pageX')
- @DomName('UIEvent.pageY')
- Point get page => new Point($dom_pageX, $dom_pageY);
-}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
+ List<TextTrackCue> getRange(int start, int rangeLength) =>
+ Lists.getRange(this, start, rangeLength, <TextTrackCue>[]);
+ Map<int, TextTrackCue> asMap() =>
+ IterableMixinWorkaround.asMapList(this);
-@DocsEditable
-@DomName('HTMLUListElement')
-class UListElement extends Element native "*HTMLUListElement" {
+ // -- end List<TextTrackCue> mixins.
- @DomName('HTMLUListElement.HTMLUListElement')
+ @DomName('TextTrackCueList.getCueById')
@DocsEditable
- factory UListElement() => document.$dom_createElement("ul");
+ TextTrackCue getCueById(String id) native;
+
+ @DomName('TextTrackCueList.item')
+ @DocsEditable
+ TextTrackCue item(int index) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -23008,118 +20825,108 @@ class UListElement extends Element native "*HTMLUListElement" {
@DocsEditable
-@DomName('Uint16Array')
-class Uint16Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Uint16Array" {
-
- @DomName('Uint16Array.Uint16Array')
- @DocsEditable
- factory Uint16Array(int length) =>
- _TypedArrayFactoryProvider.createUint16Array(length);
-
- @DomName('Uint16Array.fromList')
- @DocsEditable
- factory Uint16Array.fromList(List<int> list) =>
- _TypedArrayFactoryProvider.createUint16Array_fromList(list);
+@DomName('TextTrackList')
+class TextTrackList extends EventTarget implements JavaScriptIndexingBehavior, List<TextTrack> native "*TextTrackList" {
- @DomName('Uint16Array.fromBuffer')
+ @DomName('TextTrackList.addtrackEvent')
@DocsEditable
- factory Uint16Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) =>
- _TypedArrayFactoryProvider.createUint16Array_fromBuffer(buffer, byteOffset, length);
-
- static const int BYTES_PER_ELEMENT = 2;
+ static const EventStreamProvider<TrackEvent> addTrackEvent = const EventStreamProvider<TrackEvent>('addtrack');
- @DomName('Uint16Array.length')
+ @DomName('TextTrackList.length')
@DocsEditable
int get length => JS("int", "#.length", this);
- int operator[](int index) => JS("int", "#[#]", this, index);
+ TextTrack operator[](int index) => JS("TextTrack", "#[#]", this, index);
- void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); } // -- start List<int> mixins.
- // int is the element type.
+ void operator[]=(int index, TextTrack value) {
+ throw new UnsupportedError("Cannot assign element of immutable List.");
+ }
+ // -- start List<TextTrack> mixins.
+ // TextTrack is the element type.
- // From Iterable<int>:
+ // From Iterable<TextTrack>:
- Iterator<int> get iterator {
+ Iterator<TextTrack> get iterator {
// Note: NodeLists are not fixed size. And most probably length shouldn't
// be cached in both iterator _and_ forEach method. For now caching it
// for consistency.
- return new FixedSizeListIterator<int>(this);
+ return new FixedSizeListIterator<TextTrack>(this);
}
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) {
+ dynamic reduce(dynamic initialValue, dynamic combine(dynamic, TextTrack)) {
return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
- bool contains(int element) => IterableMixinWorkaround.contains(this, element);
+ bool contains(TextTrack element) => IterableMixinWorkaround.contains(this, element);
- void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
+ void forEach(void f(TextTrack element)) => IterableMixinWorkaround.forEach(this, f);
String join([String separator]) =>
IterableMixinWorkaround.joinList(this, separator);
- Iterable map(f(int element)) =>
+ Iterable map(f(TextTrack element)) =>
IterableMixinWorkaround.mapList(this, f);
- Iterable<int> where(bool f(int element)) =>
+ Iterable<TextTrack> where(bool f(TextTrack element)) =>
IterableMixinWorkaround.where(this, f);
- Iterable expand(Iterable f(int element)) =>
+ Iterable expand(Iterable f(TextTrack element)) =>
IterableMixinWorkaround.expand(this, f);
- bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
+ bool every(bool f(TextTrack element)) => IterableMixinWorkaround.every(this, f);
- bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
+ bool any(bool f(TextTrack element)) => IterableMixinWorkaround.any(this, f);
- List<int> toList({ bool growable: true }) =>
- new List<int>.from(this, growable: growable);
+ List<TextTrack> toList({ bool growable: true }) =>
+ new List<TextTrack>.from(this, growable: growable);
- Set<int> toSet() => new Set<int>.from(this);
+ Set<TextTrack> toSet() => new Set<TextTrack>.from(this);
bool get isEmpty => this.length == 0;
- Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
+ Iterable<TextTrack> take(int n) => IterableMixinWorkaround.takeList(this, n);
- Iterable<int> takeWhile(bool test(int value)) {
+ Iterable<TextTrack> takeWhile(bool test(TextTrack value)) {
return IterableMixinWorkaround.takeWhile(this, test);
}
- Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+ Iterable<TextTrack> skip(int n) => IterableMixinWorkaround.skipList(this, n);
- Iterable<int> skipWhile(bool test(int value)) {
+ Iterable<TextTrack> skipWhile(bool test(TextTrack value)) {
return IterableMixinWorkaround.skipWhile(this, test);
}
- int firstWhere(bool test(int value), { int orElse() }) {
+ TextTrack firstWhere(bool test(TextTrack value), { TextTrack orElse() }) {
return IterableMixinWorkaround.firstWhere(this, test, orElse);
}
- int lastWhere(bool test(int value), {int orElse()}) {
+ TextTrack lastWhere(bool test(TextTrack value), {TextTrack orElse()}) {
return IterableMixinWorkaround.lastWhereList(this, test, orElse);
}
- int singleWhere(bool test(int value)) {
+ TextTrack singleWhere(bool test(TextTrack value)) {
return IterableMixinWorkaround.singleWhere(this, test);
}
- int elementAt(int index) {
+ TextTrack elementAt(int index) {
return this[index];
}
- // From Collection<int>:
+ // From Collection<TextTrack>:
- void add(int value) {
+ void add(TextTrack value) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- void addLast(int value) {
+ void addLast(TextTrack value) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- void addAll(Iterable<int> iterable) {
+ void addAll(Iterable<TextTrack> iterable) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- // From List<int>:
+ // From List<TextTrack>:
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
@@ -23128,49 +20935,49 @@ class Uint16Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
throw new UnsupportedError("Cannot clear immutable List.");
}
- Iterable<int> get reversed {
+ Iterable<TextTrack> get reversed {
return IterableMixinWorkaround.reversedList(this);
}
- void sort([int compare(int a, int b)]) {
+ void sort([int compare(TextTrack a, TextTrack b)]) {
throw new UnsupportedError("Cannot sort immutable List.");
}
- int indexOf(int element, [int start = 0]) =>
+ int indexOf(TextTrack element, [int start = 0]) =>
Lists.indexOf(this, element, start, this.length);
- int lastIndexOf(int element, [int start]) {
+ int lastIndexOf(TextTrack element, [int start]) {
if (start == null) start = length - 1;
return Lists.lastIndexOf(this, element, start);
}
- int get first {
+ TextTrack get first {
if (this.length > 0) return this[0];
throw new StateError("No elements");
}
- int get last {
+ TextTrack get last {
if (this.length > 0) return this[this.length - 1];
throw new StateError("No elements");
}
- int get single {
+ TextTrack get single {
if (length == 1) return this[0];
if (length == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
- int min([int compare(int a, int b)]) =>
+ TextTrack min([int compare(TextTrack a, TextTrack b)]) =>
IterableMixinWorkaround.min(this, compare);
- int max([int compare(int a, int b)]) =>
+ TextTrack max([int compare(TextTrack a, TextTrack b)]) =>
IterableMixinWorkaround.max(this, compare);
- int removeAt(int pos) {
+ TextTrack removeAt(int pos) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- int removeLast() {
+ TextTrack removeLast() {
throw new UnsupportedError("Cannot remove from immutable List.");
}
@@ -23186,15 +20993,15 @@ class Uint16Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void removeWhere(bool test(int element)) {
+ void removeWhere(bool test(TextTrack element)) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void retainWhere(bool test(int element)) {
+ void retainWhere(bool test(TextTrack element)) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
+ void setRange(int start, int rangeLength, List<TextTrack> from, [int startFrom]) {
throw new UnsupportedError("Cannot setRange on immutable List.");
}
@@ -23202,147 +21009,360 @@ class Uint16Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
throw new UnsupportedError("Cannot removeRange on immutable List.");
}
- void insertRange(int start, int rangeLength, [int initialValue]) {
+ void insertRange(int start, int rangeLength, [TextTrack initialValue]) {
throw new UnsupportedError("Cannot insertRange on immutable List.");
}
- List<int> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <int>[]);
+ List<TextTrack> getRange(int start, int rangeLength) =>
+ Lists.getRange(this, start, rangeLength, <TextTrack>[]);
- Map<int, int> asMap() =>
+ Map<int, TextTrack> asMap() =>
IterableMixinWorkaround.asMapList(this);
- // -- end List<int> mixins.
+ // -- end List<TextTrack> mixins.
+
+ @JSName('addEventListener')
+ @DomName('TextTrackList.addEventListener')
+ @DocsEditable
+ void $dom_addEventListener(String type, EventListener listener, [bool useCapture]) native;
+
+ @DomName('TextTrackList.dispatchEvent')
+ @DocsEditable
+ bool dispatchEvent(Event evt) native;
+
+ @DomName('TextTrackList.item')
+ @DocsEditable
+ TextTrack item(int index) native;
+
+ @JSName('removeEventListener')
+ @DomName('TextTrackList.removeEventListener')
+ @DocsEditable
+ void $dom_removeEventListener(String type, EventListener listener, [bool useCapture]) native;
+
+ @DomName('TextTrackList.onaddtrack')
+ @DocsEditable
+ Stream<TrackEvent> get onAddTrack => addTrackEvent.forTarget(this);
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('TimeRanges')
+class TimeRanges native "*TimeRanges" {
+
+ @DomName('TimeRanges.length')
+ @DocsEditable
+ final int length;
+
+ @DomName('TimeRanges.end')
+ @DocsEditable
+ num end(int index) native;
+
+ @DomName('TimeRanges.start')
+ @DocsEditable
+ num start(int index) native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+typedef void TimeoutHandler();
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('HTMLTitleElement')
+class TitleElement extends Element native "*HTMLTitleElement" {
+
+ @DomName('HTMLTitleElement.HTMLTitleElement')
+ @DocsEditable
+ factory TitleElement() => document.$dom_createElement("title");
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+
+@DocsEditable
+@DomName('Touch')
+class Touch native "*Touch" {
+
+ @JSName('clientX')
+ @DomName('Touch.clientX')
+ @DocsEditable
+ final int $dom_clientX;
+
+ @JSName('clientY')
+ @DomName('Touch.clientY')
+ @DocsEditable
+ final int $dom_clientY;
+
+ @DomName('Touch.identifier')
+ @DocsEditable
+ final int identifier;
+
+ @JSName('pageX')
+ @DomName('Touch.pageX')
+ @DocsEditable
+ final int $dom_pageX;
+
+ @JSName('pageY')
+ @DomName('Touch.pageY')
+ @DocsEditable
+ final int $dom_pageY;
+
+ @JSName('screenX')
+ @DomName('Touch.screenX')
+ @DocsEditable
+ final int $dom_screenX;
+
+ @JSName('screenY')
+ @DomName('Touch.screenY')
+ @DocsEditable
+ final int $dom_screenY;
+
+ EventTarget get target => _convertNativeToDart_EventTarget(this._get_target);
+ @JSName('target')
+ @DomName('Touch.target')
+ @DocsEditable
+ @Creates('Element|Document')
+ @Returns('Element|Document')
+ final dynamic _get_target;
+
+ @JSName('webkitForce')
+ @DomName('Touch.webkitForce')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ final num force;
+
+ @JSName('webkitRadiusX')
+ @DomName('Touch.webkitRadiusX')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ final int radiusX;
+
+ @JSName('webkitRadiusY')
+ @DomName('Touch.webkitRadiusY')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ final int radiusY;
+
+ @JSName('webkitRotationAngle')
+ @DomName('Touch.webkitRotationAngle')
+ @DocsEditable
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.SAFARI)
+ @Experimental
+ final num rotationAngle;
+
+
+ @DomName('Touch.clientX')
+ @DomName('Touch.clientY')
+ Point get client => new Point($dom_clientX, $dom_clientY);
+
+ @DomName('Touch.pageX')
+ @DomName('Touch.pageY')
+ Point get page => new Point($dom_pageX, $dom_pageY);
+
+ @DomName('Touch.screenX')
+ @DomName('Touch.screenY')
+ Point get screen => new Point($dom_screenX, $dom_screenY);
+}
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+// WARNING: Do not edit - generated code.
+
+
+@DomName('TouchEvent')
+class TouchEvent extends UIEvent native "*TouchEvent" {
+ factory TouchEvent(TouchList touches, TouchList targetTouches,
+ TouchList changedTouches, String type,
+ {Window view, int screenX: 0, int screenY: 0, int clientX: 0,
+ int clientY: 0, bool ctrlKey: false, bool altKey: false,
+ bool shiftKey: false, bool metaKey: false}) {
+ if (view == null) {
+ view = window;
+ }
+ var e = document.$dom_createEvent("TouchEvent");
+ e.$dom_initTouchEvent(touches, targetTouches, changedTouches, type, view,
+ screenX, screenY, clientX, clientY, ctrlKey, altKey, shiftKey, metaKey);
+ return e;
+ }
+
+ @DomName('TouchEvent.altKey')
+ @DocsEditable
+ final bool altKey;
+
+ @DomName('TouchEvent.changedTouches')
+ @DocsEditable
+ final TouchList changedTouches;
+
+ @DomName('TouchEvent.ctrlKey')
+ @DocsEditable
+ final bool ctrlKey;
+
+ @DomName('TouchEvent.metaKey')
+ @DocsEditable
+ final bool metaKey;
+
+ @DomName('TouchEvent.shiftKey')
+ @DocsEditable
+ final bool shiftKey;
+
+ @DomName('TouchEvent.targetTouches')
+ @DocsEditable
+ final TouchList targetTouches;
- @JSName('set')
- @DomName('Uint16Array.set')
+ @DomName('TouchEvent.touches')
@DocsEditable
- void setElements(Object array, [int offset]) native;
+ final TouchList touches;
- @DomName('Uint16Array.subarray')
+ @JSName('initTouchEvent')
+ @DomName('TouchEvent.initTouchEvent')
@DocsEditable
- @Returns('Uint16Array')
- @Creates('Uint16Array')
- List<int> subarray(int start, [int end]) native;
+ void $dom_initTouchEvent(TouchList touches, TouchList targetTouches, TouchList changedTouches, String type, Window view, int screenX, int screenY, int clientX, int clientY, bool ctrlKey, bool altKey, bool shiftKey, bool metaKey) native;
+
+
+ /**
+ * Checks if touch events supported on the current platform.
+ *
+ * Note that touch events are only supported if the user is using a touch
+ * device.
+ */
+ static bool get supported {
+ if (JS('bool', '"ontouchstart" in window')) {
+ return Device.isEventTypeSupported('TouchEvent');
+ }
+ return false;
+ }
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
+// WARNING: Do not edit - generated code.
-@DocsEditable
-@DomName('Uint32Array')
-class Uint32Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Uint32Array" {
-
- @DomName('Uint32Array.Uint32Array')
- @DocsEditable
- factory Uint32Array(int length) =>
- _TypedArrayFactoryProvider.createUint32Array(length);
-
- @DomName('Uint32Array.fromList')
- @DocsEditable
- factory Uint32Array.fromList(List<int> list) =>
- _TypedArrayFactoryProvider.createUint32Array_fromList(list);
- @DomName('Uint32Array.fromBuffer')
- @DocsEditable
- factory Uint32Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) =>
- _TypedArrayFactoryProvider.createUint32Array_fromBuffer(buffer, byteOffset, length);
+@DomName('TouchList')
+class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "*TouchList" {
+ /// NB: This constructor likely does not work as you might expect it to! This
+ /// constructor will simply fail (returning null) if you are not on a device
+ /// with touch enabled. See dartbug.com/8314.
+ factory TouchList() => document.$dom_createTouchList();
- static const int BYTES_PER_ELEMENT = 4;
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => JS('bool', '!!document.createTouchList');
- @DomName('Uint32Array.length')
+ @DomName('TouchList.length')
@DocsEditable
int get length => JS("int", "#.length", this);
- int operator[](int index) => JS("int", "#[#]", this, index);
+ Touch operator[](int index) => JS("Touch", "#[#]", this, index);
- void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); } // -- start List<int> mixins.
- // int is the element type.
+ void operator[]=(int index, Touch value) {
+ throw new UnsupportedError("Cannot assign element of immutable List.");
+ }
+ // -- start List<Touch> mixins.
+ // Touch is the element type.
- // From Iterable<int>:
+ // From Iterable<Touch>:
- Iterator<int> get iterator {
+ Iterator<Touch> get iterator {
// Note: NodeLists are not fixed size. And most probably length shouldn't
// be cached in both iterator _and_ forEach method. For now caching it
// for consistency.
- return new FixedSizeListIterator<int>(this);
+ return new FixedSizeListIterator<Touch>(this);
}
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) {
+ dynamic reduce(dynamic initialValue, dynamic combine(dynamic, Touch)) {
return IterableMixinWorkaround.reduce(this, initialValue, combine);
}
- bool contains(int element) => IterableMixinWorkaround.contains(this, element);
+ bool contains(Touch element) => IterableMixinWorkaround.contains(this, element);
- void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
+ void forEach(void f(Touch element)) => IterableMixinWorkaround.forEach(this, f);
String join([String separator]) =>
IterableMixinWorkaround.joinList(this, separator);
- Iterable map(f(int element)) =>
+ Iterable map(f(Touch element)) =>
IterableMixinWorkaround.mapList(this, f);
- Iterable<int> where(bool f(int element)) =>
+ Iterable<Touch> where(bool f(Touch element)) =>
IterableMixinWorkaround.where(this, f);
- Iterable expand(Iterable f(int element)) =>
+ Iterable expand(Iterable f(Touch element)) =>
IterableMixinWorkaround.expand(this, f);
- bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
+ bool every(bool f(Touch element)) => IterableMixinWorkaround.every(this, f);
- bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
+ bool any(bool f(Touch element)) => IterableMixinWorkaround.any(this, f);
- List<int> toList({ bool growable: true }) =>
- new List<int>.from(this, growable: growable);
+ List<Touch> toList({ bool growable: true }) =>
+ new List<Touch>.from(this, growable: growable);
- Set<int> toSet() => new Set<int>.from(this);
+ Set<Touch> toSet() => new Set<Touch>.from(this);
bool get isEmpty => this.length == 0;
- Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
+ Iterable<Touch> take(int n) => IterableMixinWorkaround.takeList(this, n);
- Iterable<int> takeWhile(bool test(int value)) {
+ Iterable<Touch> takeWhile(bool test(Touch value)) {
return IterableMixinWorkaround.takeWhile(this, test);
}
- Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+ Iterable<Touch> skip(int n) => IterableMixinWorkaround.skipList(this, n);
- Iterable<int> skipWhile(bool test(int value)) {
+ Iterable<Touch> skipWhile(bool test(Touch value)) {
return IterableMixinWorkaround.skipWhile(this, test);
}
- int firstWhere(bool test(int value), { int orElse() }) {
+ Touch firstWhere(bool test(Touch value), { Touch orElse() }) {
return IterableMixinWorkaround.firstWhere(this, test, orElse);
}
- int lastWhere(bool test(int value), {int orElse()}) {
+ Touch lastWhere(bool test(Touch value), {Touch orElse()}) {
return IterableMixinWorkaround.lastWhereList(this, test, orElse);
}
- int singleWhere(bool test(int value)) {
+ Touch singleWhere(bool test(Touch value)) {
return IterableMixinWorkaround.singleWhere(this, test);
}
- int elementAt(int index) {
+ Touch elementAt(int index) {
return this[index];
}
- // From Collection<int>:
+ // From Collection<Touch>:
- void add(int value) {
+ void add(Touch value) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- void addLast(int value) {
+ void addLast(Touch value) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- void addAll(Iterable<int> iterable) {
+ void addAll(Iterable<Touch> iterable) {
throw new UnsupportedError("Cannot add to immutable List.");
}
- // From List<int>:
+ // From List<Touch>:
void set length(int value) {
throw new UnsupportedError("Cannot resize immutable List.");
}
@@ -23351,49 +21371,49 @@ class Uint32Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
throw new UnsupportedError("Cannot clear immutable List.");
}
- Iterable<int> get reversed {
+ Iterable<Touch> get reversed {
return IterableMixinWorkaround.reversedList(this);
}
- void sort([int compare(int a, int b)]) {
+ void sort([int compare(Touch a, Touch b)]) {
throw new UnsupportedError("Cannot sort immutable List.");
}
- int indexOf(int element, [int start = 0]) =>
+ int indexOf(Touch element, [int start = 0]) =>
Lists.indexOf(this, element, start, this.length);
- int lastIndexOf(int element, [int start]) {
+ int lastIndexOf(Touch element, [int start]) {
if (start == null) start = length - 1;
return Lists.lastIndexOf(this, element, start);
}
- int get first {
+ Touch get first {
if (this.length > 0) return this[0];
throw new StateError("No elements");
}
- int get last {
+ Touch get last {
if (this.length > 0) return this[this.length - 1];
throw new StateError("No elements");
}
- int get single {
+ Touch get single {
if (length == 1) return this[0];
if (length == 0) throw new StateError("No elements");
throw new StateError("More than one element");
}
- int min([int compare(int a, int b)]) =>
+ Touch min([int compare(Touch a, Touch b)]) =>
IterableMixinWorkaround.min(this, compare);
- int max([int compare(int a, int b)]) =>
+ Touch max([int compare(Touch a, Touch b)]) =>
IterableMixinWorkaround.max(this, compare);
- int removeAt(int pos) {
+ Touch removeAt(int pos) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- int removeLast() {
+ Touch removeLast() {
throw new UnsupportedError("Cannot remove from immutable List.");
}
@@ -23409,15 +21429,15 @@ class Uint32Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void removeWhere(bool test(int element)) {
+ void removeWhere(bool test(Touch element)) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void retainWhere(bool test(int element)) {
+ void retainWhere(bool test(Touch element)) {
throw new UnsupportedError("Cannot remove from immutable List.");
}
- void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
+ void setRange(int start, int rangeLength, List<Touch> from, [int startFrom]) {
throw new UnsupportedError("Cannot setRange on immutable List.");
}
@@ -23425,28 +21445,22 @@ class Uint32Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
throw new UnsupportedError("Cannot removeRange on immutable List.");
}
- void insertRange(int start, int rangeLength, [int initialValue]) {
+ void insertRange(int start, int rangeLength, [Touch initialValue]) {
throw new UnsupportedError("Cannot insertRange on immutable List.");
}
- List<int> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <int>[]);
+ List<Touch> getRange(int start, int rangeLength) =>
+ Lists.getRange(this, start, rangeLength, <Touch>[]);
- Map<int, int> asMap() =>
+ Map<int, Touch> asMap() =>
IterableMixinWorkaround.asMapList(this);
- // -- end List<int> mixins.
+ // -- end List<Touch> mixins.
- @JSName('set')
- @DomName('Uint32Array.set')
+ @DomName('TouchList.item')
@DocsEditable
- void setElements(Object array, [int offset]) native;
+ Touch item(int index) native;
- @DomName('Uint32Array.subarray')
- @DocsEditable
- @Returns('Uint32Array')
- @Creates('Uint32Array')
- List<int> subarray(int start, [int end]) native;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -23454,222 +21468,68 @@ class Uint32Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
@DocsEditable
-@DomName('Uint8Array')
-class Uint8Array extends ArrayBufferView implements JavaScriptIndexingBehavior, List<int> native "*Uint8Array" {
-
- @DomName('Uint8Array.Uint8Array')
- @DocsEditable
- factory Uint8Array(int length) =>
- _TypedArrayFactoryProvider.createUint8Array(length);
-
- @DomName('Uint8Array.fromList')
- @DocsEditable
- factory Uint8Array.fromList(List<int> list) =>
- _TypedArrayFactoryProvider.createUint8Array_fromList(list);
-
- @DomName('Uint8Array.fromBuffer')
- @DocsEditable
- factory Uint8Array.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) =>
- _TypedArrayFactoryProvider.createUint8Array_fromBuffer(buffer, byteOffset, length);
-
- static const int BYTES_PER_ELEMENT = 1;
+@DomName('HTMLTrackElement')
+@SupportedBrowser(SupportedBrowser.CHROME)
+@SupportedBrowser(SupportedBrowser.IE, '10')
+@SupportedBrowser(SupportedBrowser.SAFARI)
+class TrackElement extends Element native "*HTMLTrackElement" {
- @DomName('Uint8Array.length')
+ @DomName('HTMLTrackElement.HTMLTrackElement')
@DocsEditable
- int get length => JS("int", "#.length", this);
-
- int operator[](int index) => JS("int", "#[#]", this, index);
-
- void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); } // -- start List<int> mixins.
- // int is the element type.
-
- // From Iterable<int>:
-
- Iterator<int> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<int>(this);
- }
-
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
-
- bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
- void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
-
- Iterable map(f(int element)) =>
- IterableMixinWorkaround.mapList(this, f);
-
- Iterable<int> where(bool f(int element)) =>
- IterableMixinWorkaround.where(this, f);
-
- Iterable expand(Iterable f(int element)) =>
- IterableMixinWorkaround.expand(this, f);
-
- bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
- bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
- List<int> toList({ bool growable: true }) =>
- new List<int>.from(this, growable: growable);
-
- Set<int> toSet() => new Set<int>.from(this);
-
- bool get isEmpty => this.length == 0;
-
- Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
- Iterable<int> takeWhile(bool test(int value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
-
- Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
-
- Iterable<int> skipWhile(bool test(int value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
-
- int firstWhere(bool test(int value), { int orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
-
- int lastWhere(bool test(int value), {int orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
-
- int singleWhere(bool test(int value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
-
- int elementAt(int index) {
- return this[index];
- }
-
- // From Collection<int>:
-
- void add(int value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addLast(int value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- void addAll(Iterable<int> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
-
- // From List<int>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
-
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
-
- Iterable<int> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
-
- void sort([int compare(int a, int b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
-
- int indexOf(int element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
-
- int lastIndexOf(int element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
-
- int get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
-
- int get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
- }
-
- int get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
-
- int min([int compare(int a, int b)]) =>
- IterableMixinWorkaround.min(this, compare);
-
- int max([int compare(int a, int b)]) =>
- IterableMixinWorkaround.max(this, compare);
+ factory TrackElement() => document.$dom_createElement("track");
- int removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ /// Checks if this type is supported on the current platform.
+ static bool get supported => Element.isTagSupported('track');
- int removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ static const int ERROR = 3;
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ static const int LOADED = 2;
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ static const int LOADING = 1;
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ static const int NONE = 0;
- void removeWhere(bool test(int element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @JSName('default')
+ @DomName('HTMLTrackElement.default')
+ @DocsEditable
+ bool defaultValue;
- void retainWhere(bool test(int element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('HTMLTrackElement.kind')
+ @DocsEditable
+ String kind;
- void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
+ @DomName('HTMLTrackElement.label')
+ @DocsEditable
+ String label;
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
+ @DomName('HTMLTrackElement.readyState')
+ @DocsEditable
+ final int readyState;
- void insertRange(int start, int rangeLength, [int initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
+ @DomName('HTMLTrackElement.src')
+ @DocsEditable
+ String src;
- List<int> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <int>[]);
+ @DomName('HTMLTrackElement.srclang')
+ @DocsEditable
+ String srclang;
- Map<int, int> asMap() =>
- IterableMixinWorkaround.asMapList(this);
+ @DomName('HTMLTrackElement.track')
+ @DocsEditable
+ final TextTrack track;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- // -- end List<int> mixins.
- @JSName('set')
- @DomName('Uint8Array.set')
- @DocsEditable
- void setElements(Object array, [int offset]) native;
+@DocsEditable
+@DomName('TrackEvent')
+class TrackEvent extends Event native "*TrackEvent" {
- @DomName('Uint8Array.subarray')
+ @DomName('TrackEvent.track')
@DocsEditable
- @Returns('Uint8Array')
- @Creates('Uint8Array')
- List<int> subarray(int start, [int end]) native;
+ final Object track;
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -23677,219 +21537,186 @@ class Uint8Array extends ArrayBufferView implements JavaScriptIndexingBehavior,
@DocsEditable
-@DomName('Uint8ClampedArray')
-class Uint8ClampedArray extends Uint8Array implements JavaScriptIndexingBehavior, List<int> native "*Uint8ClampedArray" {
+@DomName('TransitionEvent')
+class TransitionEvent extends Event native "*TransitionEvent" {
- @DomName('Uint8ClampedArray.Uint8ClampedArray')
+ @DomName('TransitionEvent.elapsedTime')
@DocsEditable
- factory Uint8ClampedArray(int length) =>
- _TypedArrayFactoryProvider.createUint8ClampedArray(length);
+ final num elapsedTime;
- @DomName('Uint8ClampedArray.fromList')
+ @DomName('TransitionEvent.propertyName')
@DocsEditable
- factory Uint8ClampedArray.fromList(List<int> list) =>
- _TypedArrayFactoryProvider.createUint8ClampedArray_fromList(list);
+ final String propertyName;
- @DomName('Uint8ClampedArray.fromBuffer')
+ @DomName('TransitionEvent.pseudoElement')
@DocsEditable
- factory Uint8ClampedArray.fromBuffer(ArrayBuffer buffer, [int byteOffset, int length]) =>
- _TypedArrayFactoryProvider.createUint8ClampedArray_fromBuffer(buffer, byteOffset, length);
-
- // Use implementation from Uint8Array.
- // final int length;
-
- int operator[](int index) => JS("int", "#[#]", this, index);
-
- void operator[]=(int index, int value) { JS("void", "#[#] = #", this, index, value); } // -- start List<int> mixins.
- // int is the element type.
-
- // From Iterable<int>:
-
- Iterator<int> get iterator {
- // Note: NodeLists are not fixed size. And most probably length shouldn't
- // be cached in both iterator _and_ forEach method. For now caching it
- // for consistency.
- return new FixedSizeListIterator<int>(this);
- }
-
- dynamic reduce(dynamic initialValue, dynamic combine(dynamic, int)) {
- return IterableMixinWorkaround.reduce(this, initialValue, combine);
- }
-
- bool contains(int element) => IterableMixinWorkaround.contains(this, element);
-
- void forEach(void f(int element)) => IterableMixinWorkaround.forEach(this, f);
-
- String join([String separator]) =>
- IterableMixinWorkaround.joinList(this, separator);
-
- Iterable map(f(int element)) =>
- IterableMixinWorkaround.mapList(this, f);
-
- Iterable<int> where(bool f(int element)) =>
- IterableMixinWorkaround.where(this, f);
-
- Iterable expand(Iterable f(int element)) =>
- IterableMixinWorkaround.expand(this, f);
-
- bool every(bool f(int element)) => IterableMixinWorkaround.every(this, f);
-
- bool any(bool f(int element)) => IterableMixinWorkaround.any(this, f);
-
- List<int> toList({ bool growable: true }) =>
- new List<int>.from(this, growable: growable);
-
- Set<int> toSet() => new Set<int>.from(this);
-
- bool get isEmpty => this.length == 0;
-
- Iterable<int> take(int n) => IterableMixinWorkaround.takeList(this, n);
-
- Iterable<int> takeWhile(bool test(int value)) {
- return IterableMixinWorkaround.takeWhile(this, test);
- }
-
- Iterable<int> skip(int n) => IterableMixinWorkaround.skipList(this, n);
+ final String pseudoElement;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- Iterable<int> skipWhile(bool test(int value)) {
- return IterableMixinWorkaround.skipWhile(this, test);
- }
- int firstWhere(bool test(int value), { int orElse() }) {
- return IterableMixinWorkaround.firstWhere(this, test, orElse);
- }
+@DocsEditable
+@DomName('TreeWalker')
+class TreeWalker native "*TreeWalker" {
- int lastWhere(bool test(int value), {int orElse()}) {
- return IterableMixinWorkaround.lastWhereList(this, test, orElse);
- }
+ @DomName('TreeWalker.currentNode')
+ @DocsEditable
+ Node currentNode;
- int singleWhere(bool test(int value)) {
- return IterableMixinWorkaround.singleWhere(this, test);
- }
+ @DomName('TreeWalker.expandEntityReferences')
+ @DocsEditable
+ final bool expandEntityReferences;
- int elementAt(int index) {
- return this[index];
- }
+ @DomName('TreeWalker.filter')
+ @DocsEditable
+ final NodeFilter filter;
- // From Collection<int>:
+ @DomName('TreeWalker.root')
+ @DocsEditable
+ final Node root;
- void add(int value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('TreeWalker.whatToShow')
+ @DocsEditable
+ final int whatToShow;
- void addLast(int value) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('TreeWalker.firstChild')
+ @DocsEditable
+ Node firstChild() native;
- void addAll(Iterable<int> iterable) {
- throw new UnsupportedError("Cannot add to immutable List.");
- }
+ @DomName('TreeWalker.lastChild')
+ @DocsEditable
+ Node lastChild() native;
- // From List<int>:
- void set length(int value) {
- throw new UnsupportedError("Cannot resize immutable List.");
- }
+ @DomName('TreeWalker.nextNode')
+ @DocsEditable
+ Node nextNode() native;
- void clear() {
- throw new UnsupportedError("Cannot clear immutable List.");
- }
+ @DomName('TreeWalker.nextSibling')
+ @DocsEditable
+ Node nextSibling() native;
- Iterable<int> get reversed {
- return IterableMixinWorkaround.reversedList(this);
- }
+ @DomName('TreeWalker.parentNode')
+ @DocsEditable
+ Node parentNode() native;
- void sort([int compare(int a, int b)]) {
- throw new UnsupportedError("Cannot sort immutable List.");
- }
+ @DomName('TreeWalker.previousNode')
+ @DocsEditable
+ Node previousNode() native;
- int indexOf(int element, [int start = 0]) =>
- Lists.indexOf(this, element, start, this.length);
+ @DomName('TreeWalker.previousSibling')
+ @DocsEditable
+ Node previousSibling() native;
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- int lastIndexOf(int element, [int start]) {
- if (start == null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
- }
+// WARNING: Do not edit - generated code.
- int get first {
- if (this.length > 0) return this[0];
- throw new StateError("No elements");
- }
- int get last {
- if (this.length > 0) return this[this.length - 1];
- throw new StateError("No elements");
+@DomName('UIEvent')
+class UIEvent extends Event native "*UIEvent" {
+ // In JS, canBubble and cancelable are technically required parameters to
+ // init*Event. In practice, though, if they aren't provided they simply
+ // default to false (since that's Boolean(undefined)).
+ //
+ // Contrary to JS, we default canBubble and cancelable to true, since that's
+ // what people want most of the time anyway.
+ factory UIEvent(String type,
+ {Window view, int detail: 0, bool canBubble: true,
+ bool cancelable: true}) {
+ if (view == null) {
+ view = window;
+ }
+ final e = document.$dom_createEvent("UIEvent");
+ e.$dom_initUIEvent(type, canBubble, cancelable, view, detail);
+ return e;
}
- int get single {
- if (length == 1) return this[0];
- if (length == 0) throw new StateError("No elements");
- throw new StateError("More than one element");
- }
+ @JSName('charCode')
+ @DomName('UIEvent.charCode')
+ @DocsEditable
+ final int $dom_charCode;
- int min([int compare(int a, int b)]) =>
- IterableMixinWorkaround.min(this, compare);
+ @DomName('UIEvent.detail')
+ @DocsEditable
+ final int detail;
- int max([int compare(int a, int b)]) =>
- IterableMixinWorkaround.max(this, compare);
+ @JSName('keyCode')
+ @DomName('UIEvent.keyCode')
+ @DocsEditable
+ final int $dom_keyCode;
- int removeAt(int pos) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @JSName('layerX')
+ @DomName('UIEvent.layerX')
+ @DocsEditable
+ final int $dom_layerX;
- int removeLast() {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @JSName('layerY')
+ @DomName('UIEvent.layerY')
+ @DocsEditable
+ final int $dom_layerY;
- void remove(Object object) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @JSName('pageX')
+ @DomName('UIEvent.pageX')
+ @DocsEditable
+ final int $dom_pageX;
- void removeAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @JSName('pageY')
+ @DomName('UIEvent.pageY')
+ @DocsEditable
+ final int $dom_pageY;
- void retainAll(Iterable elements) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ WindowBase get view => _convertNativeToDart_Window(this._get_view);
+ @JSName('view')
+ @DomName('UIEvent.view')
+ @DocsEditable
+ @Creates('Window|=Object')
+ @Returns('Window|=Object')
+ final dynamic _get_view;
- void removeWhere(bool test(int element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @DomName('UIEvent.which')
+ @DocsEditable
+ final int which;
- void retainWhere(bool test(int element)) {
- throw new UnsupportedError("Cannot remove from immutable List.");
- }
+ @JSName('initUIEvent')
+ @DomName('UIEvent.initUIEvent')
+ @DocsEditable
+ void $dom_initUIEvent(String type, bool canBubble, bool cancelable, Window view, int detail) native;
- void setRange(int start, int rangeLength, List<int> from, [int startFrom]) {
- throw new UnsupportedError("Cannot setRange on immutable List.");
- }
- void removeRange(int start, int rangeLength) {
- throw new UnsupportedError("Cannot removeRange on immutable List.");
- }
+ @deprecated
+ int get layerX => layer.x;
+ @deprecated
+ int get layerY => layer.y;
- void insertRange(int start, int rangeLength, [int initialValue]) {
- throw new UnsupportedError("Cannot insertRange on immutable List.");
- }
+ @deprecated
+ int get pageX => page.x;
+ @deprecated
+ int get pageY => page.y;
- List<int> getRange(int start, int rangeLength) =>
- Lists.getRange(this, start, rangeLength, <int>[]);
+ @DomName('UIEvent.layerX')
+ @DomName('UIEvent.layerY')
+ Point get layer => new Point($dom_layerX, $dom_layerY);
- Map<int, int> asMap() =>
- IterableMixinWorkaround.asMapList(this);
+ @DomName('UIEvent.pageX')
+ @DomName('UIEvent.pageY')
+ Point get page => new Point($dom_pageX, $dom_pageY);
+}
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
- // -- end List<int> mixins.
- @JSName('set')
- @DomName('Uint8ClampedArray.set')
- @DocsEditable
- void setElements(Object array, [int offset]) native;
+@DocsEditable
+@DomName('HTMLUListElement')
+class UListElement extends Element native "*HTMLUListElement" {
- @DomName('Uint8ClampedArray.subarray')
+ @DomName('HTMLUListElement.HTMLUListElement')
@DocsEditable
- @Returns('Uint8ClampedArray')
- @Creates('Uint8ClampedArray')
- List<int> subarray(int start, [int end]) native;
+ factory UListElement() => document.$dom_createElement("ul");
}
// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
@@ -25115,8 +22942,8 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.getParameter')
@DocsEditable
- @Creates('Null|num|String|bool|=List|Float32Array|Int32Array|Uint32Array|WebGLFramebuffer|WebGLRenderbuffer|WebGLTexture')
- @Returns('Null|num|String|bool|=List|Float32Array|Int32Array|Uint32Array|WebGLFramebuffer|WebGLRenderbuffer|WebGLTexture')
+ @Creates('Null|num|String|bool|=List|Float32List|Int32List|Uint32List|WebGLFramebuffer|WebGLRenderbuffer|WebGLTexture')
+ @Returns('Null|num|String|bool|=List|Float32List|Int32List|Uint32List|WebGLFramebuffer|WebGLRenderbuffer|WebGLTexture')
Object getParameter(int pname) native;
@DomName('WebGLRenderingContext.getProgramInfoLog')
@@ -25379,7 +23206,7 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.uniform1fv')
@DocsEditable
- void uniform1fv(WebGLUniformLocation location, Float32Array v) native;
+ void uniform1fv(WebGLUniformLocation location, Float32List v) native;
@DomName('WebGLRenderingContext.uniform1i')
@DocsEditable
@@ -25387,7 +23214,7 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.uniform1iv')
@DocsEditable
- void uniform1iv(WebGLUniformLocation location, Int32Array v) native;
+ void uniform1iv(WebGLUniformLocation location, Int32List v) native;
@DomName('WebGLRenderingContext.uniform2f')
@DocsEditable
@@ -25395,7 +23222,7 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.uniform2fv')
@DocsEditable
- void uniform2fv(WebGLUniformLocation location, Float32Array v) native;
+ void uniform2fv(WebGLUniformLocation location, Float32List v) native;
@DomName('WebGLRenderingContext.uniform2i')
@DocsEditable
@@ -25403,7 +23230,7 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.uniform2iv')
@DocsEditable
- void uniform2iv(WebGLUniformLocation location, Int32Array v) native;
+ void uniform2iv(WebGLUniformLocation location, Int32List v) native;
@DomName('WebGLRenderingContext.uniform3f')
@DocsEditable
@@ -25411,7 +23238,7 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.uniform3fv')
@DocsEditable
- void uniform3fv(WebGLUniformLocation location, Float32Array v) native;
+ void uniform3fv(WebGLUniformLocation location, Float32List v) native;
@DomName('WebGLRenderingContext.uniform3i')
@DocsEditable
@@ -25419,7 +23246,7 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.uniform3iv')
@DocsEditable
- void uniform3iv(WebGLUniformLocation location, Int32Array v) native;
+ void uniform3iv(WebGLUniformLocation location, Int32List v) native;
@DomName('WebGLRenderingContext.uniform4f')
@DocsEditable
@@ -25427,7 +23254,7 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.uniform4fv')
@DocsEditable
- void uniform4fv(WebGLUniformLocation location, Float32Array v) native;
+ void uniform4fv(WebGLUniformLocation location, Float32List v) native;
@DomName('WebGLRenderingContext.uniform4i')
@DocsEditable
@@ -25435,19 +23262,19 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.uniform4iv')
@DocsEditable
- void uniform4iv(WebGLUniformLocation location, Int32Array v) native;
+ void uniform4iv(WebGLUniformLocation location, Int32List v) native;
@DomName('WebGLRenderingContext.uniformMatrix2fv')
@DocsEditable
- void uniformMatrix2fv(WebGLUniformLocation location, bool transpose, Float32Array array) native;
+ void uniformMatrix2fv(WebGLUniformLocation location, bool transpose, Float32List array) native;
@DomName('WebGLRenderingContext.uniformMatrix3fv')
@DocsEditable
- void uniformMatrix3fv(WebGLUniformLocation location, bool transpose, Float32Array array) native;
+ void uniformMatrix3fv(WebGLUniformLocation location, bool transpose, Float32List array) native;
@DomName('WebGLRenderingContext.uniformMatrix4fv')
@DocsEditable
- void uniformMatrix4fv(WebGLUniformLocation location, bool transpose, Float32Array array) native;
+ void uniformMatrix4fv(WebGLUniformLocation location, bool transpose, Float32List array) native;
@DomName('WebGLRenderingContext.useProgram')
@DocsEditable
@@ -25463,7 +23290,7 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.vertexAttrib1fv')
@DocsEditable
- void vertexAttrib1fv(int indx, Float32Array values) native;
+ void vertexAttrib1fv(int indx, Float32List values) native;
@DomName('WebGLRenderingContext.vertexAttrib2f')
@DocsEditable
@@ -25471,7 +23298,7 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.vertexAttrib2fv')
@DocsEditable
- void vertexAttrib2fv(int indx, Float32Array values) native;
+ void vertexAttrib2fv(int indx, Float32List values) native;
@DomName('WebGLRenderingContext.vertexAttrib3f')
@DocsEditable
@@ -25479,7 +23306,7 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.vertexAttrib3fv')
@DocsEditable
- void vertexAttrib3fv(int indx, Float32Array values) native;
+ void vertexAttrib3fv(int indx, Float32List values) native;
@DomName('WebGLRenderingContext.vertexAttrib4f')
@DocsEditable
@@ -25487,7 +23314,7 @@ class WebGLRenderingContext extends CanvasRenderingContext native "*WebGLRenderi
@DomName('WebGLRenderingContext.vertexAttrib4fv')
@DocsEditable
- void vertexAttrib4fv(int indx, Float32Array values) native;
+ void vertexAttrib4fv(int indx, Float32List values) native;
@DomName('WebGLRenderingContext.vertexAttribPointer')
@DocsEditable
@@ -33015,156 +30842,6 @@ class _LocationWrapper implements Location {
static _get(p, m) => JS('var', '#[#]', p, m);
static _set(p, m, v) => JS('void', '#[#] = #', p, m, v);
}
-// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
-// for details. All rights reserved. Use of this source code is governed by a
-// BSD-style license that can be found in the LICENSE file.
-
-
-class _TypedArrayFactoryProvider {
-
- static Float32Array createFloat32Array(int length) => _F32(length);
- static Float32Array createFloat32Array_fromList(List<num> list) =>
- _F32(ensureNative(list));
- static Float32Array createFloat32Array_fromBuffer(ArrayBuffer buffer,
- [int byteOffset = 0, int length]) {
- if (length == null) return _F32_2(buffer, byteOffset);
- return _F32_3(buffer, byteOffset, length);
- }
-
- static Float64Array createFloat64Array(int length) => _F64(length);
- static Float64Array createFloat64Array_fromList(List<num> list) =>
- _F64(ensureNative(list));
- static Float64Array createFloat64Array_fromBuffer(ArrayBuffer buffer,
- [int byteOffset = 0, int length]) {
- if (length == null) return _F64_2(buffer, byteOffset);
- return _F64_3(buffer, byteOffset, length);
- }
-
- static Int8Array createInt8Array(int length) => _I8(length);
- static Int8Array createInt8Array_fromList(List<num> list) =>
- _I8(ensureNative(list));
- static Int8Array createInt8Array_fromBuffer(ArrayBuffer buffer,
- [int byteOffset = 0, int length]) {
- if (length == null) return _I8_2(buffer, byteOffset);
- return _I8_3(buffer, byteOffset, length);
- }
-
- static Int16Array createInt16Array(int length) => _I16(length);
- static Int16Array createInt16Array_fromList(List<num> list) =>
- _I16(ensureNative(list));
- static Int16Array createInt16Array_fromBuffer(ArrayBuffer buffer,
- [int byteOffset = 0, int length]) {
- if (length == null) return _I16_2(buffer, byteOffset);
- return _I16_3(buffer, byteOffset, length);
- }
-
- static Int32Array createInt32Array(int length) => _I32(length);
- static Int32Array createInt32Array_fromList(List<num> list) =>
- _I32(ensureNative(list));
- static Int32Array createInt32Array_fromBuffer(ArrayBuffer buffer,
- [int byteOffset = 0, int length]) {
- if (length == null) return _I32_2(buffer, byteOffset);
- return _I32_3(buffer, byteOffset, length);
- }
-
- static Uint8Array createUint8Array(int length) => _U8(length);
- static Uint8Array createUint8Array_fromList(List<num> list) =>
- _U8(ensureNative(list));
- static Uint8Array createUint8Array_fromBuffer(ArrayBuffer buffer,
- [int byteOffset = 0, int length]) {
- if (length == null) return _U8_2(buffer, byteOffset);
- return _U8_3(buffer, byteOffset, length);
- }
-
- static Uint16Array createUint16Array(int length) => _U16(length);
- static Uint16Array createUint16Array_fromList(List<num> list) =>
- _U16(ensureNative(list));
- static Uint16Array createUint16Array_fromBuffer(ArrayBuffer buffer,
- [int byteOffset = 0, int length]) {
- if (length == null) return _U16_2(buffer, byteOffset);
- return _U16_3(buffer, byteOffset, length);
- }
-
- static Uint32Array createUint32Array(int length) => _U32(length);
- static Uint32Array createUint32Array_fromList(List<num> list) =>
- _U32(ensureNative(list));
- static Uint32Array createUint32Array_fromBuffer(ArrayBuffer buffer,
- [int byteOffset = 0, int length]) {
- if (length == null) return _U32_2(buffer, byteOffset);
- return _U32_3(buffer, byteOffset, length);
- }
-
- static Uint8ClampedArray createUint8ClampedArray(int length) => _U8C(length);
- static Uint8ClampedArray createUint8ClampedArray_fromList(List<num> list) =>
- _U8C(ensureNative(list));
- static Uint8ClampedArray createUint8ClampedArray_fromBuffer(
- ArrayBuffer buffer, [int byteOffset = 0, int length]) {
- if (length == null) return _U8C_2(buffer, byteOffset);
- return _U8C_3(buffer, byteOffset, length);
- }
-
- static Float32Array _F32(arg) =>
- JS('Float32Array', 'new Float32Array(#)', arg);
- static Float64Array _F64(arg) =>
- JS('Float64Array', 'new Float64Array(#)', arg);
- static Int8Array _I8(arg) =>
- JS('Int8Array', 'new Int8Array(#)', arg);
- static Int16Array _I16(arg) =>
- JS('Int16Array', 'new Int16Array(#)', arg);
- static Int32Array _I32(arg) =>
- JS('Int32Array', 'new Int32Array(#)', arg);
- static Uint8Array _U8(arg) =>
- JS('Uint8Array', 'new Uint8Array(#)', arg);
- static Uint16Array _U16(arg) =>
- JS('Uint16Array', 'new Uint16Array(#)', arg);
- static Uint32Array _U32(arg) =>
- JS('Uint32Array', 'new Uint32Array(#)', arg);
- static Uint8ClampedArray _U8C(arg) =>
- JS('Uint8ClampedArray', 'new Uint8ClampedArray(#)', arg);
-
- static Float32Array _F32_2(arg1, arg2) =>
- JS('Float32Array', 'new Float32Array(#, #)', arg1, arg2);
- static Float64Array _F64_2(arg1, arg2) =>
- JS('Float64Array', 'new Float64Array(#, #)', arg1, arg2);
- static Int8Array _I8_2(arg1, arg2) =>
- JS('Int8Array', 'new Int8Array(#, #)', arg1, arg2);
- static Int16Array _I16_2(arg1, arg2) =>
- JS('Int16Array', 'new Int16Array(#, #)', arg1, arg2);
- static Int32Array _I32_2(arg1, arg2) =>
- JS('Int32Array', 'new Int32Array(#, #)', arg1, arg2);
- static Uint8Array _U8_2(arg1, arg2) =>
- JS('Uint8Array', 'new Uint8Array(#, #)', arg1, arg2);
- static Uint16Array _U16_2(arg1, arg2) =>
- JS('Uint16Array', 'new Uint16Array(#, #)', arg1, arg2);
- static Uint32Array _U32_2(arg1, arg2) =>
- JS('Uint32Array', 'new Uint32Array(#, #)', arg1, arg2);
- static Uint8ClampedArray _U8C_2(arg1, arg2) =>
- JS('Uint8ClampedArray', 'new Uint8ClampedArray(#, #)', arg1, arg2);
-
- static Float32Array _F32_3(arg1, arg2, arg3) =>
- JS('Float32Array', 'new Float32Array(#, #, #)', arg1, arg2, arg3);
- static Float64Array _F64_3(arg1, arg2, arg3) =>
- JS('Float64Array', 'new Float64Array(#, #, #)', arg1, arg2, arg3);
- static Int8Array _I8_3(arg1, arg2, arg3) =>
- JS('Int8Array', 'new Int8Array(#, #, #)', arg1, arg2, arg3);
- static Int16Array _I16_3(arg1, arg2, arg3) =>
- JS('Int16Array', 'new Int16Array(#, #, #)', arg1, arg2, arg3);
- static Int32Array _I32_3(arg1, arg2, arg3) =>
- JS('Int32Array', 'new Int32Array(#, #, #)', arg1, arg2, arg3);
- static Uint8Array _U8_3(arg1, arg2, arg3) =>
- JS('Uint8Array', 'new Uint8Array(#, #, #)', arg1, arg2, arg3);
- static Uint16Array _U16_3(arg1, arg2, arg3) =>
- JS('Uint16Array', 'new Uint16Array(#, #, #)', arg1, arg2, arg3);
- static Uint32Array _U32_3(arg1, arg2, arg3) =>
- JS('Uint32Array', 'new Uint32Array(#, #, #)', arg1, arg2, arg3);
- static Uint8ClampedArray _U8C_3(arg1, arg2, arg3) =>
- JS('Uint8ClampedArray', 'new Uint8ClampedArray(#, #, #)', arg1, arg2, arg3);
-
-
- // Ensures that [list] is a JavaScript Array or a typed array. If necessary,
- // copies the list.
- static ensureNative(List list) => list; // TODO: make sure.
-}
// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.

Powered by Google App Engine
This is Rietveld 408576698