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

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

Issue 14036014: Updating DOM code to use list mixins (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /// The Dart HTML library. 1 /// The Dart HTML library.
2 library dart.dom.html; 2 library dart.dom.html;
3 3
4 import 'dart:async'; 4 import 'dart:async';
5 import 'dart:collection'; 5 import 'dart:collection';
6 import 'dart:_collection-dev'; 6 import 'dart:_collection-dev';
7 import 'dart:html_common'; 7 import 'dart:html_common';
8 import 'dart:indexed_db'; 8 import 'dart:indexed_db';
9 import 'dart:isolate'; 9 import 'dart:isolate';
10 import 'dart:json' as json; 10 import 'dart:json' as json;
(...skipping 6803 matching lines...) Expand 10 before | Expand all | Expand 10 after
6814 @DocsEditable 6814 @DocsEditable
6815 String value; 6815 String value;
6816 } 6816 }
6817 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6817 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
6818 // for details. All rights reserved. Use of this source code is governed by a 6818 // for details. All rights reserved. Use of this source code is governed by a
6819 // BSD-style license that can be found in the LICENSE file. 6819 // BSD-style license that can be found in the LICENSE file.
6820 6820
6821 6821
6822 @DocsEditable 6822 @DocsEditable
6823 @DomName('DOMStringList') 6823 @DomName('DOMStringList')
6824 class DomStringList implements JavaScriptIndexingBehavior, List<String> native " DOMStringList" { 6824 class DomStringList extends Object with ListMixin<String>, ImmutableListMixin<St ring> implements JavaScriptIndexingBehavior, List<String> native "DOMStringList" {
6825 6825
6826 @DomName('DOMStringList.length') 6826 @DomName('DOMStringList.length')
6827 @DocsEditable 6827 @DocsEditable
6828 int get length => JS("int", "#.length", this); 6828 int get length => JS("int", "#.length", this);
6829 6829
6830 String operator[](int index) => JS("String", "#[#]", this, index); 6830 String operator[](int index) => JS("String", "#[#]", this, index);
6831 6831
6832 void operator[]=(int index, String value) { 6832 void operator[]=(int index, String value) {
6833 throw new UnsupportedError("Cannot assign element of immutable List."); 6833 throw new UnsupportedError("Cannot assign element of immutable List.");
6834 } 6834 }
6835 // -- start List<String> mixins. 6835 // -- start List<String> mixins.
6836 // String is the element type. 6836 // String is the element type.
6837 6837
6838 // From Iterable<String>:
6839 6838
6840 Iterator<String> get iterator {
6841 // Note: NodeLists are not fixed size. And most probably length shouldn't
6842 // be cached in both iterator _and_ forEach method. For now caching it
6843 // for consistency.
6844 return new FixedSizeListIterator<String>(this);
6845 }
6846
6847 String reduce(String combine(String value, String element)) {
6848 return IterableMixinWorkaround.reduce(this, combine);
6849 }
6850
6851 dynamic fold(dynamic initialValue,
6852 dynamic combine(dynamic previousValue, String element)) {
6853 return IterableMixinWorkaround.fold(this, initialValue, combine);
6854 }
6855
6856 // contains() defined by IDL.
6857
6858 void forEach(void f(String element)) => IterableMixinWorkaround.forEach(this, f);
6859
6860 String join([String separator = ""]) =>
6861 IterableMixinWorkaround.joinList(this, separator);
6862
6863 Iterable map(f(String element)) =>
6864 IterableMixinWorkaround.mapList(this, f);
6865
6866 Iterable<String> where(bool f(String element)) =>
6867 IterableMixinWorkaround.where(this, f);
6868
6869 Iterable expand(Iterable f(String element)) =>
6870 IterableMixinWorkaround.expand(this, f);
6871
6872 bool every(bool f(String element)) => IterableMixinWorkaround.every(this, f);
6873
6874 bool any(bool f(String element)) => IterableMixinWorkaround.any(this, f);
6875
6876 List<String> toList({ bool growable: true }) =>
6877 new List<String>.from(this, growable: growable);
6878
6879 Set<String> toSet() => new Set<String>.from(this);
6880
6881 bool get isEmpty => this.length == 0;
6882
6883 Iterable<String> take(int n) => IterableMixinWorkaround.takeList(this, n);
6884
6885 Iterable<String> takeWhile(bool test(String value)) {
6886 return IterableMixinWorkaround.takeWhile(this, test);
6887 }
6888
6889 Iterable<String> skip(int n) => IterableMixinWorkaround.skipList(this, n);
6890
6891 Iterable<String> skipWhile(bool test(String value)) {
6892 return IterableMixinWorkaround.skipWhile(this, test);
6893 }
6894
6895 String firstWhere(bool test(String value), { String orElse() }) {
6896 return IterableMixinWorkaround.firstWhere(this, test, orElse);
6897 }
6898
6899 String lastWhere(bool test(String value), {String orElse()}) {
6900 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
6901 }
6902
6903 String singleWhere(bool test(String value)) {
6904 return IterableMixinWorkaround.singleWhere(this, test);
6905 }
6906
6907 String elementAt(int index) {
6908 return this[index];
6909 }
6910
6911 // From Collection<String>:
6912
6913 void add(String value) {
6914 throw new UnsupportedError("Cannot add to immutable List.");
6915 }
6916
6917 void addAll(Iterable<String> iterable) {
6918 throw new UnsupportedError("Cannot add to immutable List.");
6919 }
6920
6921 // From List<String>:
6922 void set length(int value) { 6839 void set length(int value) {
6923 throw new UnsupportedError("Cannot resize immutable List."); 6840 throw new UnsupportedError("Cannot resize immutable List.");
6924 } 6841 }
6925 6842
6926 void clear() {
6927 throw new UnsupportedError("Cannot clear immutable List.");
6928 }
6929
6930 Iterable<String> get reversed {
6931 return IterableMixinWorkaround.reversedList(this);
6932 }
6933
6934 void sort([int compare(String a, String b)]) {
6935 throw new UnsupportedError("Cannot sort immutable List.");
6936 }
6937
6938 int indexOf(String element, [int start = 0]) =>
6939 Lists.indexOf(this, element, start, this.length);
6940
6941 int lastIndexOf(String element, [int start]) {
6942 if (start == null) start = length - 1;
6943 return Lists.lastIndexOf(this, element, start);
6944 }
6945
6946 String get first {
6947 if (this.length > 0) return this[0];
6948 throw new StateError("No elements");
6949 }
6950
6951 String get last {
6952 if (this.length > 0) return this[this.length - 1];
6953 throw new StateError("No elements");
6954 }
6955
6956 String get single {
6957 if (length == 1) return this[0];
6958 if (length == 0) throw new StateError("No elements");
6959 throw new StateError("More than one element");
6960 }
6961
6962 void insert(int index, String element) {
6963 throw new UnsupportedError("Cannot add to immutable List.");
6964 }
6965
6966 void insertAll(int index, Iterable<String> iterable) {
6967 throw new UnsupportedError("Cannot add to immutable List.");
6968 }
6969
6970 void setAll(int index, Iterable<String> iterable) {
6971 throw new UnsupportedError("Cannot modify an immutable List.");
6972 }
6973
6974 String removeAt(int pos) {
6975 throw new UnsupportedError("Cannot remove from immutable List.");
6976 }
6977
6978 String removeLast() {
6979 throw new UnsupportedError("Cannot remove from immutable List.");
6980 }
6981
6982 bool remove(Object object) {
6983 throw new UnsupportedError("Cannot remove from immutable List.");
6984 }
6985
6986 void removeWhere(bool test(String element)) {
6987 throw new UnsupportedError("Cannot remove from immutable List.");
6988 }
6989
6990 void retainWhere(bool test(String element)) {
6991 throw new UnsupportedError("Cannot remove from immutable List.");
6992 }
6993
6994 void setRange(int start, int end, Iterable<String> iterable, [int skipCount=0] ) {
6995 throw new UnsupportedError("Cannot setRange on immutable List.");
6996 }
6997
6998 void removeRange(int start, int end) {
6999 throw new UnsupportedError("Cannot removeRange on immutable List.");
7000 }
7001
7002 void replaceRange(int start, int end, Iterable<String> iterable) {
7003 throw new UnsupportedError("Cannot modify an immutable List.");
7004 }
7005
7006 void fillRange(int start, int end, [String fillValue]) {
7007 throw new UnsupportedError("Cannot modify an immutable List.");
7008 }
7009
7010 Iterable<String> getRange(int start, int end) =>
7011 IterableMixinWorkaround.getRangeList(this, start, end);
7012
7013 List<String> sublist(int start, [int end]) {
7014 if (end == null) end = length;
7015 return Lists.getRange(this, start, end, <String>[]);
7016 }
7017
7018 Map<int, String> asMap() =>
7019 IterableMixinWorkaround.asMapList(this);
7020
7021 String toString() {
7022 StringBuffer buffer = new StringBuffer('[');
7023 buffer.writeAll(this, ', ');
7024 buffer.write(']');
7025 return buffer.toString();
7026 }
7027
7028 // -- end List<String> mixins. 6843 // -- end List<String> mixins.
7029 6844
7030 @DomName('DOMStringList.contains') 6845 @DomName('DOMStringList.contains')
7031 @DocsEditable 6846 @DocsEditable
7032 bool contains(String string) native; 6847 bool contains(String string) native;
7033 6848
7034 @DomName('DOMStringList.item') 6849 @DomName('DOMStringList.item')
7035 @DocsEditable 6850 @DocsEditable
7036 String item(int index) native; 6851 String item(int index) native;
7037 } 6852 }
(...skipping 2327 matching lines...) Expand 10 before | Expand all | Expand 10 after
9365 @DocsEditable 9180 @DocsEditable
9366 String toString() native; 9181 String toString() native;
9367 } 9182 }
9368 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9183 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9369 // for details. All rights reserved. Use of this source code is governed by a 9184 // for details. All rights reserved. Use of this source code is governed by a
9370 // BSD-style license that can be found in the LICENSE file. 9185 // BSD-style license that can be found in the LICENSE file.
9371 9186
9372 9187
9373 @DocsEditable 9188 @DocsEditable
9374 @DomName('FileList') 9189 @DomName('FileList')
9375 class FileList implements JavaScriptIndexingBehavior, List<File> native "FileLis t" { 9190 class FileList extends Object with ListMixin<File>, ImmutableListMixin<File> imp lements JavaScriptIndexingBehavior, List<File> native "FileList" {
9376 9191
9377 @DomName('FileList.length') 9192 @DomName('FileList.length')
9378 @DocsEditable 9193 @DocsEditable
9379 int get length => JS("int", "#.length", this); 9194 int get length => JS("int", "#.length", this);
9380 9195
9381 File operator[](int index) => JS("File", "#[#]", this, index); 9196 File operator[](int index) => JS("File", "#[#]", this, index);
9382 9197
9383 void operator[]=(int index, File value) { 9198 void operator[]=(int index, File value) {
9384 throw new UnsupportedError("Cannot assign element of immutable List."); 9199 throw new UnsupportedError("Cannot assign element of immutable List.");
9385 } 9200 }
9386 // -- start List<File> mixins. 9201 // -- start List<File> mixins.
9387 // File is the element type. 9202 // File is the element type.
9388 9203
9389 // From Iterable<File>:
9390 9204
9391 Iterator<File> get iterator {
9392 // Note: NodeLists are not fixed size. And most probably length shouldn't
9393 // be cached in both iterator _and_ forEach method. For now caching it
9394 // for consistency.
9395 return new FixedSizeListIterator<File>(this);
9396 }
9397
9398 File reduce(File combine(File value, File element)) {
9399 return IterableMixinWorkaround.reduce(this, combine);
9400 }
9401
9402 dynamic fold(dynamic initialValue,
9403 dynamic combine(dynamic previousValue, File element)) {
9404 return IterableMixinWorkaround.fold(this, initialValue, combine);
9405 }
9406
9407 bool contains(File element) => IterableMixinWorkaround.contains(this, element) ;
9408
9409 void forEach(void f(File element)) => IterableMixinWorkaround.forEach(this, f) ;
9410
9411 String join([String separator = ""]) =>
9412 IterableMixinWorkaround.joinList(this, separator);
9413
9414 Iterable map(f(File element)) =>
9415 IterableMixinWorkaround.mapList(this, f);
9416
9417 Iterable<File> where(bool f(File element)) =>
9418 IterableMixinWorkaround.where(this, f);
9419
9420 Iterable expand(Iterable f(File element)) =>
9421 IterableMixinWorkaround.expand(this, f);
9422
9423 bool every(bool f(File element)) => IterableMixinWorkaround.every(this, f);
9424
9425 bool any(bool f(File element)) => IterableMixinWorkaround.any(this, f);
9426
9427 List<File> toList({ bool growable: true }) =>
9428 new List<File>.from(this, growable: growable);
9429
9430 Set<File> toSet() => new Set<File>.from(this);
9431
9432 bool get isEmpty => this.length == 0;
9433
9434 Iterable<File> take(int n) => IterableMixinWorkaround.takeList(this, n);
9435
9436 Iterable<File> takeWhile(bool test(File value)) {
9437 return IterableMixinWorkaround.takeWhile(this, test);
9438 }
9439
9440 Iterable<File> skip(int n) => IterableMixinWorkaround.skipList(this, n);
9441
9442 Iterable<File> skipWhile(bool test(File value)) {
9443 return IterableMixinWorkaround.skipWhile(this, test);
9444 }
9445
9446 File firstWhere(bool test(File value), { File orElse() }) {
9447 return IterableMixinWorkaround.firstWhere(this, test, orElse);
9448 }
9449
9450 File lastWhere(bool test(File value), {File orElse()}) {
9451 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
9452 }
9453
9454 File singleWhere(bool test(File value)) {
9455 return IterableMixinWorkaround.singleWhere(this, test);
9456 }
9457
9458 File elementAt(int index) {
9459 return this[index];
9460 }
9461
9462 // From Collection<File>:
9463
9464 void add(File value) {
9465 throw new UnsupportedError("Cannot add to immutable List.");
9466 }
9467
9468 void addAll(Iterable<File> iterable) {
9469 throw new UnsupportedError("Cannot add to immutable List.");
9470 }
9471
9472 // From List<File>:
9473 void set length(int value) { 9205 void set length(int value) {
9474 throw new UnsupportedError("Cannot resize immutable List."); 9206 throw new UnsupportedError("Cannot resize immutable List.");
9475 } 9207 }
9476 9208
9477 void clear() {
9478 throw new UnsupportedError("Cannot clear immutable List.");
9479 }
9480
9481 Iterable<File> get reversed {
9482 return IterableMixinWorkaround.reversedList(this);
9483 }
9484
9485 void sort([int compare(File a, File b)]) {
9486 throw new UnsupportedError("Cannot sort immutable List.");
9487 }
9488
9489 int indexOf(File element, [int start = 0]) =>
9490 Lists.indexOf(this, element, start, this.length);
9491
9492 int lastIndexOf(File element, [int start]) {
9493 if (start == null) start = length - 1;
9494 return Lists.lastIndexOf(this, element, start);
9495 }
9496
9497 File get first {
9498 if (this.length > 0) return this[0];
9499 throw new StateError("No elements");
9500 }
9501
9502 File get last {
9503 if (this.length > 0) return this[this.length - 1];
9504 throw new StateError("No elements");
9505 }
9506
9507 File get single {
9508 if (length == 1) return this[0];
9509 if (length == 0) throw new StateError("No elements");
9510 throw new StateError("More than one element");
9511 }
9512
9513 void insert(int index, File element) {
9514 throw new UnsupportedError("Cannot add to immutable List.");
9515 }
9516
9517 void insertAll(int index, Iterable<File> iterable) {
9518 throw new UnsupportedError("Cannot add to immutable List.");
9519 }
9520
9521 void setAll(int index, Iterable<File> iterable) {
9522 throw new UnsupportedError("Cannot modify an immutable List.");
9523 }
9524
9525 File removeAt(int pos) {
9526 throw new UnsupportedError("Cannot remove from immutable List.");
9527 }
9528
9529 File removeLast() {
9530 throw new UnsupportedError("Cannot remove from immutable List.");
9531 }
9532
9533 bool remove(Object object) {
9534 throw new UnsupportedError("Cannot remove from immutable List.");
9535 }
9536
9537 void removeWhere(bool test(File element)) {
9538 throw new UnsupportedError("Cannot remove from immutable List.");
9539 }
9540
9541 void retainWhere(bool test(File element)) {
9542 throw new UnsupportedError("Cannot remove from immutable List.");
9543 }
9544
9545 void setRange(int start, int end, Iterable<File> iterable, [int skipCount=0]) {
9546 throw new UnsupportedError("Cannot setRange on immutable List.");
9547 }
9548
9549 void removeRange(int start, int end) {
9550 throw new UnsupportedError("Cannot removeRange on immutable List.");
9551 }
9552
9553 void replaceRange(int start, int end, Iterable<File> iterable) {
9554 throw new UnsupportedError("Cannot modify an immutable List.");
9555 }
9556
9557 void fillRange(int start, int end, [File fillValue]) {
9558 throw new UnsupportedError("Cannot modify an immutable List.");
9559 }
9560
9561 Iterable<File> getRange(int start, int end) =>
9562 IterableMixinWorkaround.getRangeList(this, start, end);
9563
9564 List<File> sublist(int start, [int end]) {
9565 if (end == null) end = length;
9566 return Lists.getRange(this, start, end, <File>[]);
9567 }
9568
9569 Map<int, File> asMap() =>
9570 IterableMixinWorkaround.asMapList(this);
9571
9572 String toString() {
9573 StringBuffer buffer = new StringBuffer('[');
9574 buffer.writeAll(this, ', ');
9575 buffer.write(']');
9576 return buffer.toString();
9577 }
9578
9579 // -- end List<File> mixins. 9209 // -- end List<File> mixins.
9580 9210
9581 @DomName('FileList.item') 9211 @DomName('FileList.item')
9582 @DocsEditable 9212 @DocsEditable
9583 File item(int index) native; 9213 File item(int index) native;
9584 } 9214 }
9585 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9215 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9586 // for details. All rights reserved. Use of this source code is governed by a 9216 // for details. All rights reserved. Use of this source code is governed by a
9587 // BSD-style license that can be found in the LICENSE file. 9217 // BSD-style license that can be found in the LICENSE file.
9588 9218
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
10347 @SupportedBrowser(SupportedBrowser.SAFARI) 9977 @SupportedBrowser(SupportedBrowser.SAFARI)
10348 void replaceState(Object data, String title, [String url]) native; 9978 void replaceState(Object data, String title, [String url]) native;
10349 } 9979 }
10350 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9980 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10351 // for details. All rights reserved. Use of this source code is governed by a 9981 // for details. All rights reserved. Use of this source code is governed by a
10352 // BSD-style license that can be found in the LICENSE file. 9982 // BSD-style license that can be found in the LICENSE file.
10353 9983
10354 9984
10355 @DocsEditable 9985 @DocsEditable
10356 @DomName('HTMLAllCollection') 9986 @DomName('HTMLAllCollection')
10357 class HtmlAllCollection implements JavaScriptIndexingBehavior, List<Node> native "HTMLAllCollection" { 9987 class HtmlAllCollection extends Object with ListMixin<Node>, ImmutableListMixin< Node> implements JavaScriptIndexingBehavior, List<Node> native "HTMLAllCollectio n" {
10358 9988
10359 @DomName('HTMLAllCollection.length') 9989 @DomName('HTMLAllCollection.length')
10360 @DocsEditable 9990 @DocsEditable
10361 int get length => JS("int", "#.length", this); 9991 int get length => JS("int", "#.length", this);
10362 9992
10363 Node operator[](int index) => JS("Node", "#[#]", this, index); 9993 Node operator[](int index) => JS("Node", "#[#]", this, index);
10364 9994
10365 void operator[]=(int index, Node value) { 9995 void operator[]=(int index, Node value) {
10366 throw new UnsupportedError("Cannot assign element of immutable List."); 9996 throw new UnsupportedError("Cannot assign element of immutable List.");
10367 } 9997 }
10368 // -- start List<Node> mixins. 9998 // -- start List<Node> mixins.
10369 // Node is the element type. 9999 // Node is the element type.
10370 10000
10371 // From Iterable<Node>: 10001
10372
10373 Iterator<Node> get iterator {
10374 // Note: NodeLists are not fixed size. And most probably length shouldn't
10375 // be cached in both iterator _and_ forEach method. For now caching it
10376 // for consistency.
10377 return new FixedSizeListIterator<Node>(this);
10378 }
10379
10380 Node reduce(Node combine(Node value, Node element)) {
10381 return IterableMixinWorkaround.reduce(this, combine);
10382 }
10383
10384 dynamic fold(dynamic initialValue,
10385 dynamic combine(dynamic previousValue, Node element)) {
10386 return IterableMixinWorkaround.fold(this, initialValue, combine);
10387 }
10388
10389 bool contains(Node element) => IterableMixinWorkaround.contains(this, element) ;
10390
10391 void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f) ;
10392
10393 String join([String separator = ""]) =>
10394 IterableMixinWorkaround.joinList(this, separator);
10395
10396 Iterable map(f(Node element)) =>
10397 IterableMixinWorkaround.mapList(this, f);
10398
10399 Iterable<Node> where(bool f(Node element)) =>
10400 IterableMixinWorkaround.where(this, f);
10401
10402 Iterable expand(Iterable f(Node element)) =>
10403 IterableMixinWorkaround.expand(this, f);
10404
10405 bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
10406
10407 bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
10408
10409 List<Node> toList({ bool growable: true }) =>
10410 new List<Node>.from(this, growable: growable);
10411
10412 Set<Node> toSet() => new Set<Node>.from(this);
10413
10414 bool get isEmpty => this.length == 0;
10415
10416 Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
10417
10418 Iterable<Node> takeWhile(bool test(Node value)) {
10419 return IterableMixinWorkaround.takeWhile(this, test);
10420 }
10421
10422 Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
10423
10424 Iterable<Node> skipWhile(bool test(Node value)) {
10425 return IterableMixinWorkaround.skipWhile(this, test);
10426 }
10427
10428 Node firstWhere(bool test(Node value), { Node orElse() }) {
10429 return IterableMixinWorkaround.firstWhere(this, test, orElse);
10430 }
10431
10432 Node lastWhere(bool test(Node value), {Node orElse()}) {
10433 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
10434 }
10435
10436 Node singleWhere(bool test(Node value)) {
10437 return IterableMixinWorkaround.singleWhere(this, test);
10438 }
10439
10440 Node elementAt(int index) {
10441 return this[index];
10442 }
10443
10444 // From Collection<Node>:
10445
10446 void add(Node value) {
10447 throw new UnsupportedError("Cannot add to immutable List.");
10448 }
10449
10450 void addAll(Iterable<Node> iterable) {
10451 throw new UnsupportedError("Cannot add to immutable List.");
10452 }
10453
10454 // From List<Node>:
10455 void set length(int value) { 10002 void set length(int value) {
10456 throw new UnsupportedError("Cannot resize immutable List."); 10003 throw new UnsupportedError("Cannot resize immutable List.");
10457 } 10004 }
10458 10005
10459 void clear() {
10460 throw new UnsupportedError("Cannot clear immutable List.");
10461 }
10462
10463 Iterable<Node> get reversed {
10464 return IterableMixinWorkaround.reversedList(this);
10465 }
10466
10467 void sort([int compare(Node a, Node b)]) {
10468 throw new UnsupportedError("Cannot sort immutable List.");
10469 }
10470
10471 int indexOf(Node element, [int start = 0]) =>
10472 Lists.indexOf(this, element, start, this.length);
10473
10474 int lastIndexOf(Node element, [int start]) {
10475 if (start == null) start = length - 1;
10476 return Lists.lastIndexOf(this, element, start);
10477 }
10478
10479 Node get first {
10480 if (this.length > 0) return this[0];
10481 throw new StateError("No elements");
10482 }
10483
10484 Node get last {
10485 if (this.length > 0) return this[this.length - 1];
10486 throw new StateError("No elements");
10487 }
10488
10489 Node get single {
10490 if (length == 1) return this[0];
10491 if (length == 0) throw new StateError("No elements");
10492 throw new StateError("More than one element");
10493 }
10494
10495 void insert(int index, Node element) {
10496 throw new UnsupportedError("Cannot add to immutable List.");
10497 }
10498
10499 void insertAll(int index, Iterable<Node> iterable) {
10500 throw new UnsupportedError("Cannot add to immutable List.");
10501 }
10502
10503 void setAll(int index, Iterable<Node> iterable) {
10504 throw new UnsupportedError("Cannot modify an immutable List.");
10505 }
10506
10507 Node removeAt(int pos) {
10508 throw new UnsupportedError("Cannot remove from immutable List.");
10509 }
10510
10511 Node removeLast() {
10512 throw new UnsupportedError("Cannot remove from immutable List.");
10513 }
10514
10515 bool remove(Object object) {
10516 throw new UnsupportedError("Cannot remove from immutable List.");
10517 }
10518
10519 void removeWhere(bool test(Node element)) {
10520 throw new UnsupportedError("Cannot remove from immutable List.");
10521 }
10522
10523 void retainWhere(bool test(Node element)) {
10524 throw new UnsupportedError("Cannot remove from immutable List.");
10525 }
10526
10527 void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
10528 throw new UnsupportedError("Cannot setRange on immutable List.");
10529 }
10530
10531 void removeRange(int start, int end) {
10532 throw new UnsupportedError("Cannot removeRange on immutable List.");
10533 }
10534
10535 void replaceRange(int start, int end, Iterable<Node> iterable) {
10536 throw new UnsupportedError("Cannot modify an immutable List.");
10537 }
10538
10539 void fillRange(int start, int end, [Node fillValue]) {
10540 throw new UnsupportedError("Cannot modify an immutable List.");
10541 }
10542
10543 Iterable<Node> getRange(int start, int end) =>
10544 IterableMixinWorkaround.getRangeList(this, start, end);
10545
10546 List<Node> sublist(int start, [int end]) {
10547 if (end == null) end = length;
10548 return Lists.getRange(this, start, end, <Node>[]);
10549 }
10550
10551 Map<int, Node> asMap() =>
10552 IterableMixinWorkaround.asMapList(this);
10553
10554 String toString() {
10555 StringBuffer buffer = new StringBuffer('[');
10556 buffer.writeAll(this, ', ');
10557 buffer.write(']');
10558 return buffer.toString();
10559 }
10560
10561 // -- end List<Node> mixins. 10006 // -- end List<Node> mixins.
10562 10007
10563 @DomName('HTMLAllCollection.item') 10008 @DomName('HTMLAllCollection.item')
10564 @DocsEditable 10009 @DocsEditable
10565 Node item(int index) native; 10010 Node item(int index) native;
10566 10011
10567 @DomName('HTMLAllCollection.namedItem') 10012 @DomName('HTMLAllCollection.namedItem')
10568 @DocsEditable 10013 @DocsEditable
10569 Node namedItem(String name) native; 10014 Node namedItem(String name) native;
10570 10015
10571 @DomName('HTMLAllCollection.tags') 10016 @DomName('HTMLAllCollection.tags')
10572 @DocsEditable 10017 @DocsEditable
10573 @Returns('NodeList') 10018 @Returns('NodeList')
10574 @Creates('NodeList') 10019 @Creates('NodeList')
10575 List<Node> tags(String name) native; 10020 List<Node> tags(String name) native;
10576 } 10021 }
10577 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10022 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10578 // for details. All rights reserved. Use of this source code is governed by a 10023 // for details. All rights reserved. Use of this source code is governed by a
10024 // BSD-style license that can be found in the LICENSE file.
10025
10026
10027 @DocsEditable
10028 @DomName('HTMLCollection')
10029 class HtmlCollection extends Object with ListMixin<Node>, ImmutableListMixin<Nod e> implements JavaScriptIndexingBehavior, List<Node> native "HTMLCollection" {
10030
10031 @DomName('HTMLCollection.length')
10032 @DocsEditable
10033 int get length => JS("int", "#.length", this);
10034
10035 Node operator[](int index) => JS("Node", "#[#]", this, index);
10036
10037 void operator[]=(int index, Node value) {
10038 throw new UnsupportedError("Cannot assign element of immutable List.");
10039 }
10040 // -- start List<Node> mixins.
10041 // Node is the element type.
10042
10043
10044 void set length(int value) {
10045 throw new UnsupportedError("Cannot resize immutable List.");
10046 }
10047
10048 // -- end List<Node> mixins.
10049
10050 @DomName('HTMLCollection.item')
10051 @DocsEditable
10052 Node item(int index) native;
10053
10054 @DomName('HTMLCollection.namedItem')
10055 @DocsEditable
10056 Node namedItem(String name) native;
10057 }
10058 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10059 // for details. All rights reserved. Use of this source code is governed by a
10060 // BSD-style license that can be found in the LICENSE file.
10061
10062 // WARNING: Do not edit - generated code.
10063
10064
10065 @DomName('HTMLDocument')
10066 class HtmlDocument extends Document native "HTMLDocument" {
10067
10068 @DomName('HTMLDocument.activeElement')
10069 @DocsEditable
10070 final Element activeElement;
10071
10072
10073 @DomName('Document.body')
10074 BodyElement body;
10075
10076 @DomName('Document.caretRangeFromPoint')
10077 Range caretRangeFromPoint(int x, int y) {
10078 return $dom_caretRangeFromPoint(x, y);
10079 }
10080
10081 @DomName('Document.elementFromPoint')
10082 Element elementFromPoint(int x, int y) {
10083 return $dom_elementFromPoint(x, y);
10084 }
10085
10086 /**
10087 * Checks if the getCssCanvasContext API is supported on the current platform.
10088 *
10089 * See also:
10090 *
10091 * * [getCssCanvasContext]
10092 */
10093 static bool get supportsCssCanvasContext =>
10094 JS('bool', '!!(document.getCSSCanvasContext)');
10095
10096
10097 /**
10098 * Gets a CanvasRenderingContext which can be used as the CSS background of an
10099 * element.
10100 *
10101 * CSS:
10102 *
10103 * background: -webkit-canvas(backgroundCanvas)
10104 *
10105 * Generate the canvas:
10106 *
10107 * var context = document.getCssCanvasContext('2d', 'backgroundCanvas',
10108 * 100, 100);
10109 * context.fillStyle = 'red';
10110 * context.fillRect(0, 0, 100, 100);
10111 *
10112 * See also:
10113 *
10114 * * [supportsCssCanvasContext]
10115 * * [CanvasElement.getContext]
10116 */
10117 @SupportedBrowser(SupportedBrowser.CHROME)
10118 @SupportedBrowser(SupportedBrowser.SAFARI)
10119 @Experimental
10120 @DomName('Document.getCSSCanvasContext')
10121 CanvasRenderingContext getCssCanvasContext(String contextId, String name,
10122 int width, int height) {
10123 return $dom_getCssCanvasContext(contextId, name, width, height);
10124 }
10125
10126 @DomName('Document.head')
10127 HeadElement get head => $dom_head;
10128
10129 @DomName('Document.lastModified')
10130 String get lastModified => $dom_lastModified;
10131
10132 @DomName('Document.preferredStylesheetSet')
10133 String get preferredStylesheetSet => $dom_preferredStylesheetSet;
10134
10135 @DomName('Document.referrer')
10136 String get referrer => $dom_referrer;
10137
10138 @DomName('Document.selectedStylesheetSet')
10139 String get selectedStylesheetSet => $dom_selectedStylesheetSet;
10140 void set selectedStylesheetSet(String value) {
10141 $dom_selectedStylesheetSet = value;
10142 }
10143
10144 @DomName('Document.styleSheets')
10145 List<StyleSheet> get styleSheets => $dom_styleSheets;
10146
10147 @DomName('Document.title')
10148 String get title => $dom_title;
10149
10150 @DomName('Document.title')
10151 void set title(String value) {
10152 $dom_title = value;
10153 }
10154
10155 @DomName('Document.webkitCancelFullScreen')
10156 @SupportedBrowser(SupportedBrowser.CHROME)
10157 @SupportedBrowser(SupportedBrowser.SAFARI)
10158 @Experimental
10159 void cancelFullScreen() {
10160 $dom_webkitCancelFullScreen();
10161 }
10162
10163 @DomName('Document.webkitExitFullscreen')
10164 @SupportedBrowser(SupportedBrowser.CHROME)
10165 @SupportedBrowser(SupportedBrowser.SAFARI)
10166 @Experimental
10167 void exitFullscreen() {
10168 $dom_webkitExitFullscreen();
10169 }
10170
10171 @DomName('Document.webkitExitPointerLock')
10172 @SupportedBrowser(SupportedBrowser.CHROME)
10173 @SupportedBrowser(SupportedBrowser.SAFARI)
10174 @Experimental
10175 void exitPointerLock() {
10176 $dom_webkitExitPointerLock();
10177 }
10178
10179 @DomName('Document.webkitFullscreenElement')
10180 @SupportedBrowser(SupportedBrowser.CHROME)
10181 @SupportedBrowser(SupportedBrowser.SAFARI)
10182 @Experimental
10183 Element get fullscreenElement => $dom_webkitFullscreenElement;
10184
10185 @DomName('Document.webkitFullscreenEnabled')
10186 @SupportedBrowser(SupportedBrowser.CHROME)
10187 @SupportedBrowser(SupportedBrowser.SAFARI)
10188 @Experimental
10189 bool get fullscreenEnabled => $dom_webkitFullscreenEnabled;
10190
10191 @DomName('Document.webkitHidden')
10192 @SupportedBrowser(SupportedBrowser.CHROME)
10193 @SupportedBrowser(SupportedBrowser.SAFARI)
10194 @Experimental
10195 bool get hidden => $dom_webkitHidden;
10196
10197 @DomName('Document.webkitIsFullScreen')
10198 @SupportedBrowser(SupportedBrowser.CHROME)
10199 @SupportedBrowser(SupportedBrowser.SAFARI)
10200 @Experimental
10201 bool get isFullScreen => $dom_webkitIsFullScreen;
10202
10203 @DomName('Document.webkitPointerLockElement')
10204 @SupportedBrowser(SupportedBrowser.CHROME)
10205 @SupportedBrowser(SupportedBrowser.SAFARI)
10206 @Experimental
10207 Element get pointerLockElement =>
10208 $dom_webkitPointerLockElement;
10209
10210 @DomName('Document.webkitVisibilityState')
10211 @SupportedBrowser(SupportedBrowser.CHROME)
10212 @SupportedBrowser(SupportedBrowser.SAFARI)
10213 @Experimental
10214 String get visibilityState => $dom_webkitVisibilityState;
10215 }
10216 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10217 // for details. All rights reserved. Use of this source code is governed by a
10218 // BSD-style license that can be found in the LICENSE file.
10219
10220
10221 @DocsEditable
10222 @DomName('HTMLHtmlElement')
10223 class HtmlElement extends Element native "HTMLHtmlElement" {
10224
10225 @DomName('HTMLHtmlElement.HTMLHtmlElement')
10226 @DocsEditable
10227 factory HtmlElement() => document.$dom_createElement("html");
10228 }
10229 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10230 // for details. All rights reserved. Use of this source code is governed by a
10579 // BSD-style license that can be found in the LICENSE file. 10231 // BSD-style license that can be found in the LICENSE file.
10580 10232
10581 10233
10582 @DocsEditable 10234 @DocsEditable
10583 @DomName('HTMLCollection') 10235 @DomName('HTMLFormControlsCollection')
10584 class HtmlCollection implements JavaScriptIndexingBehavior, List<Node> native "H TMLCollection" { 10236 class HtmlFormControlsCollection extends HtmlCollection native "HTMLFormControls Collection" {
10585 10237
10586 @DomName('HTMLCollection.length') 10238 @DomName('HTMLFormControlsCollection.namedItem')
10587 @DocsEditable
10588 int get length => JS("int", "#.length", this);
10589
10590 Node operator[](int index) => JS("Node", "#[#]", this, index);
10591
10592 void operator[]=(int index, Node value) {
10593 throw new UnsupportedError("Cannot assign element of immutable List.");
10594 }
10595 // -- start List<Node> mixins.
10596 // Node is the element type.
10597
10598 // From Iterable<Node>:
10599
10600 Iterator<Node> get iterator {
10601 // Note: NodeLists are not fixed size. And most probably length shouldn't
10602 // be cached in both iterator _and_ forEach method. For now caching it
10603 // for consistency.
10604 return new FixedSizeListIterator<Node>(this);
10605 }
10606
10607 Node reduce(Node combine(Node value, Node element)) {
10608 return IterableMixinWorkaround.reduce(this, combine);
10609 }
10610
10611 dynamic fold(dynamic initialValue,
10612 dynamic combine(dynamic previousValue, Node element)) {
10613 return IterableMixinWorkaround.fold(this, initialValue, combine);
10614 }
10615
10616 bool contains(Node element) => IterableMixinWorkaround.contains(this, element) ;
10617
10618 void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f) ;
10619
10620 String join([String separator = ""]) =>
10621 IterableMixinWorkaround.joinList(this, separator);
10622
10623 Iterable map(f(Node element)) =>
10624 IterableMixinWorkaround.mapList(this, f);
10625
10626 Iterable<Node> where(bool f(Node element)) =>
10627 IterableMixinWorkaround.where(this, f);
10628
10629 Iterable expand(Iterable f(Node element)) =>
10630 IterableMixinWorkaround.expand(this, f);
10631
10632 bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
10633
10634 bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
10635
10636 List<Node> toList({ bool growable: true }) =>
10637 new List<Node>.from(this, growable: growable);
10638
10639 Set<Node> toSet() => new Set<Node>.from(this);
10640
10641 bool get isEmpty => this.length == 0;
10642
10643 Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
10644
10645 Iterable<Node> takeWhile(bool test(Node value)) {
10646 return IterableMixinWorkaround.takeWhile(this, test);
10647 }
10648
10649 Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
10650
10651 Iterable<Node> skipWhile(bool test(Node value)) {
10652 return IterableMixinWorkaround.skipWhile(this, test);
10653 }
10654
10655 Node firstWhere(bool test(Node value), { Node orElse() }) {
10656 return IterableMixinWorkaround.firstWhere(this, test, orElse);
10657 }
10658
10659 Node lastWhere(bool test(Node value), {Node orElse()}) {
10660 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
10661 }
10662
10663 Node singleWhere(bool test(Node value)) {
10664 return IterableMixinWorkaround.singleWhere(this, test);
10665 }
10666
10667 Node elementAt(int index) {
10668 return this[index];
10669 }
10670
10671 // From Collection<Node>:
10672
10673 void add(Node value) {
10674 throw new UnsupportedError("Cannot add to immutable List.");
10675 }
10676
10677 void addAll(Iterable<Node> iterable) {
10678 throw new UnsupportedError("Cannot add to immutable List.");
10679 }
10680
10681 // From List<Node>:
10682 void set length(int value) {
10683 throw new UnsupportedError("Cannot resize immutable List.");
10684 }
10685
10686 void clear() {
10687 throw new UnsupportedError("Cannot clear immutable List.");
10688 }
10689
10690 Iterable<Node> get reversed {
10691 return IterableMixinWorkaround.reversedList(this);
10692 }
10693
10694 void sort([int compare(Node a, Node b)]) {
10695 throw new UnsupportedError("Cannot sort immutable List.");
10696 }
10697
10698 int indexOf(Node element, [int start = 0]) =>
10699 Lists.indexOf(this, element, start, this.length);
10700
10701 int lastIndexOf(Node element, [int start]) {
10702 if (start == null) start = length - 1;
10703 return Lists.lastIndexOf(this, element, start);
10704 }
10705
10706 Node get first {
10707 if (this.length > 0) return this[0];
10708 throw new StateError("No elements");
10709 }
10710
10711 Node get last {
10712 if (this.length > 0) return this[this.length - 1];
10713 throw new StateError("No elements");
10714 }
10715
10716 Node get single {
10717 if (length == 1) return this[0];
10718 if (length == 0) throw new StateError("No elements");
10719 throw new StateError("More than one element");
10720 }
10721
10722 void insert(int index, Node element) {
10723 throw new UnsupportedError("Cannot add to immutable List.");
10724 }
10725
10726 void insertAll(int index, Iterable<Node> iterable) {
10727 throw new UnsupportedError("Cannot add to immutable List.");
10728 }
10729
10730 void setAll(int index, Iterable<Node> iterable) {
10731 throw new UnsupportedError("Cannot modify an immutable List.");
10732 }
10733
10734 Node removeAt(int pos) {
10735 throw new UnsupportedError("Cannot remove from immutable List.");
10736 }
10737
10738 Node removeLast() {
10739 throw new UnsupportedError("Cannot remove from immutable List.");
10740 }
10741
10742 bool remove(Object object) {
10743 throw new UnsupportedError("Cannot remove from immutable List.");
10744 }
10745
10746 void removeWhere(bool test(Node element)) {
10747 throw new UnsupportedError("Cannot remove from immutable List.");
10748 }
10749
10750 void retainWhere(bool test(Node element)) {
10751 throw new UnsupportedError("Cannot remove from immutable List.");
10752 }
10753
10754 void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
10755 throw new UnsupportedError("Cannot setRange on immutable List.");
10756 }
10757
10758 void removeRange(int start, int end) {
10759 throw new UnsupportedError("Cannot removeRange on immutable List.");
10760 }
10761
10762 void replaceRange(int start, int end, Iterable<Node> iterable) {
10763 throw new UnsupportedError("Cannot modify an immutable List.");
10764 }
10765
10766 void fillRange(int start, int end, [Node fillValue]) {
10767 throw new UnsupportedError("Cannot modify an immutable List.");
10768 }
10769
10770 Iterable<Node> getRange(int start, int end) =>
10771 IterableMixinWorkaround.getRangeList(this, start, end);
10772
10773 List<Node> sublist(int start, [int end]) {
10774 if (end == null) end = length;
10775 return Lists.getRange(this, start, end, <Node>[]);
10776 }
10777
10778 Map<int, Node> asMap() =>
10779 IterableMixinWorkaround.asMapList(this);
10780
10781 String toString() {
10782 StringBuffer buffer = new StringBuffer('[');
10783 buffer.writeAll(this, ', ');
10784 buffer.write(']');
10785 return buffer.toString();
10786 }
10787
10788 // -- end List<Node> mixins.
10789
10790 @DomName('HTMLCollection.item')
10791 @DocsEditable
10792 Node item(int index) native;
10793
10794 @DomName('HTMLCollection.namedItem')
10795 @DocsEditable 10239 @DocsEditable
10796 Node namedItem(String name) native; 10240 Node namedItem(String name) native;
10797 } 10241 }
10798 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10242 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10799 // for details. All rights reserved. Use of this source code is governed by a 10243 // for details. All rights reserved. Use of this source code is governed by a
10800 // BSD-style license that can be found in the LICENSE file. 10244 // BSD-style license that can be found in the LICENSE file.
10801 10245
10802 // WARNING: Do not edit - generated code. 10246
10803 10247 @DocsEditable
10804 10248 @DomName('HTMLOptionsCollection')
10805 @DomName('HTMLDocument') 10249 class HtmlOptionsCollection extends HtmlCollection native "HTMLOptionsCollection " {
10806 class HtmlDocument extends Document native "HTMLDocument" {
10807
10808 @DomName('HTMLDocument.activeElement')
10809 @DocsEditable
10810 final Element activeElement;
10811
10812
10813 @DomName('Document.body')
10814 BodyElement body;
10815
10816 @DomName('Document.caretRangeFromPoint')
10817 Range caretRangeFromPoint(int x, int y) {
10818 return $dom_caretRangeFromPoint(x, y);
10819 }
10820
10821 @DomName('Document.elementFromPoint')
10822 Element elementFromPoint(int x, int y) {
10823 return $dom_elementFromPoint(x, y);
10824 }
10825
10826 /**
10827 * Checks if the getCssCanvasContext API is supported on the current platform.
10828 *
10829 * See also:
10830 *
10831 * * [getCssCanvasContext]
10832 */
10833 static bool get supportsCssCanvasContext =>
10834 JS('bool', '!!(document.getCSSCanvasContext)');
10835
10836
10837 /**
10838 * Gets a CanvasRenderingContext which can be used as the CSS background of an
10839 * element.
10840 *
10841 * CSS:
10842 *
10843 * background: -webkit-canvas(backgroundCanvas)
10844 *
10845 * Generate the canvas:
10846 *
10847 * var context = document.getCssCanvasContext('2d', 'backgroundCanvas',
10848 * 100, 100);
10849 * context.fillStyle = 'red';
10850 * context.fillRect(0, 0, 100, 100);
10851 *
10852 * See also:
10853 *
10854 * * [supportsCssCanvasContext]
10855 * * [CanvasElement.getContext]
10856 */
10857 @SupportedBrowser(SupportedBrowser.CHROME)
10858 @SupportedBrowser(SupportedBrowser.SAFARI)
10859 @Experimental
10860 @DomName('Document.getCSSCanvasContext')
10861 CanvasRenderingContext getCssCanvasContext(String contextId, String name,
10862 int width, int height) {
10863 return $dom_getCssCanvasContext(contextId, name, width, height);
10864 }
10865
10866 @DomName('Document.head')
10867 HeadElement get head => $dom_head;
10868
10869 @DomName('Document.lastModified')
10870 String get lastModified => $dom_lastModified;
10871
10872 @DomName('Document.preferredStylesheetSet')
10873 String get preferredStylesheetSet => $dom_preferredStylesheetSet;
10874
10875 @DomName('Document.referrer')
10876 String get referrer => $dom_referrer;
10877
10878 @DomName('Document.selectedStylesheetSet')
10879 String get selectedStylesheetSet => $dom_selectedStylesheetSet;
10880 void set selectedStylesheetSet(String value) {
10881 $dom_selectedStylesheetSet = value;
10882 }
10883
10884 @DomName('Document.styleSheets')
10885 List<StyleSheet> get styleSheets => $dom_styleSheets;
10886
10887 @DomName('Document.title')
10888 String get title => $dom_title;
10889
10890 @DomName('Document.title')
10891 void set title(String value) {
10892 $dom_title = value;
10893 }
10894
10895 @DomName('Document.webkitCancelFullScreen')
10896 @SupportedBrowser(SupportedBrowser.CHROME)
10897 @SupportedBrowser(SupportedBrowser.SAFARI)
10898 @Experimental
10899 void cancelFullScreen() {
10900 $dom_webkitCancelFullScreen();
10901 }
10902
10903 @DomName('Document.webkitExitFullscreen')
10904 @SupportedBrowser(SupportedBrowser.CHROME)
10905 @SupportedBrowser(SupportedBrowser.SAFARI)
10906 @Experimental
10907 void exitFullscreen() {
10908 $dom_webkitExitFullscreen();
10909 }
10910
10911 @DomName('Document.webkitExitPointerLock')
10912 @SupportedBrowser(SupportedBrowser.CHROME)
10913 @SupportedBrowser(SupportedBrowser.SAFARI)
10914 @Experimental
10915 void exitPointerLock() {
10916 $dom_webkitExitPointerLock();
10917 }
10918
10919 @DomName('Document.webkitFullscreenElement')
10920 @SupportedBrowser(SupportedBrowser.CHROME)
10921 @SupportedBrowser(SupportedBrowser.SAFARI)
10922 @Experimental
10923 Element get fullscreenElement => $dom_webkitFullscreenElement;
10924
10925 @DomName('Document.webkitFullscreenEnabled')
10926 @SupportedBrowser(SupportedBrowser.CHROME)
10927 @SupportedBrowser(SupportedBrowser.SAFARI)
10928 @Experimental
10929 bool get fullscreenEnabled => $dom_webkitFullscreenEnabled;
10930
10931 @DomName('Document.webkitHidden')
10932 @SupportedBrowser(SupportedBrowser.CHROME)
10933 @SupportedBrowser(SupportedBrowser.SAFARI)
10934 @Experimental
10935 bool get hidden => $dom_webkitHidden;
10936
10937 @DomName('Document.webkitIsFullScreen')
10938 @SupportedBrowser(SupportedBrowser.CHROME)
10939 @SupportedBrowser(SupportedBrowser.SAFARI)
10940 @Experimental
10941 bool get isFullScreen => $dom_webkitIsFullScreen;
10942
10943 @DomName('Document.webkitPointerLockElement')
10944 @SupportedBrowser(SupportedBrowser.CHROME)
10945 @SupportedBrowser(SupportedBrowser.SAFARI)
10946 @Experimental
10947 Element get pointerLockElement =>
10948 $dom_webkitPointerLockElement;
10949
10950 @DomName('Document.webkitVisibilityState')
10951 @SupportedBrowser(SupportedBrowser.CHROME)
10952 @SupportedBrowser(SupportedBrowser.SAFARI)
10953 @Experimental
10954 String get visibilityState => $dom_webkitVisibilityState;
10955 } 10250 }
10956 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10251 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10957 // for details. All rights reserved. Use of this source code is governed by a 10252 // for details. All rights reserved. Use of this source code is governed by a
10253 // BSD-style license that can be found in the LICENSE file.
10254
10255
10256 /**
10257 * A utility for retrieving data from a URL.
10258 *
10259 * HttpRequest can be used to obtain data from http, ftp, and file
10260 * protocols.
10261 *
10262 * For example, suppose we're developing these API docs, and we
10263 * wish to retrieve the HTML of the top-level page and print it out.
10264 * The easiest way to do that would be:
10265 *
10266 * HttpRequest.getString('http://api.dartlang.org').then((response) {
10267 * print(response);
10268 * });
10269 *
10270 * **Important**: With the default behavior of this class, your
10271 * code making the request should be served from the same origin (domain name,
10272 * port, and application layer protocol) as the URL you are trying to access
10273 * with HttpRequest. However, there are ways to
10274 * [get around this restriction](http://www.dartlang.org/articles/json-web-servi ce/#note-on-jsonp).
10275 *
10276 * See also:
10277 *
10278 * * [Dart article on using HttpRequests](http://www.dartlang.org/articles/json- web-service/#getting-data)
10279 * * [JS XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpReq uest)
10280 * * [Using XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttp Request/Using_XMLHttpRequest)
10281 */
10282 @DomName('XMLHttpRequest')
10283 class HttpRequest extends EventTarget native "XMLHttpRequest" {
10284
10285 /**
10286 * Creates a URL get request for the specified [url].
10287 *
10288 * The server response must be a `text/` mime type for this request to
10289 * succeed.
10290 *
10291 * This is similar to [request] but specialized for HTTP GET requests which
10292 * return text content.
10293 *
10294 * See also:
10295 *
10296 * * [request]
10297 */
10298 static Future<String> getString(String url,
10299 {bool withCredentials, void onProgress(ProgressEvent e)}) {
10300 return request(url, withCredentials: withCredentials,
10301 onProgress: onProgress).then((xhr) => xhr.responseText);
10302 }
10303
10304 /**
10305 * Creates a URL request for the specified [url].
10306 *
10307 * By default this will do an HTTP GET request, this can be overridden with
10308 * [method].
10309 *
10310 * The Future is completed when the response is available.
10311 *
10312 * The [withCredentials] parameter specified that credentials such as a cookie
10313 * (already) set in the header or
10314 * [authorization headers](http://tools.ietf.org/html/rfc1945#section-10.2)
10315 * should be specified for the request. Details to keep in mind when using
10316 * credentials:
10317 *
10318 * * Using credentials is only useful for cross-origin requests.
10319 * * The `Access-Control-Allow-Origin` header of `url` cannot contain a wildca rd (*).
10320 * * The `Access-Control-Allow-Credentials` header of `url` must be set to tru e.
10321 * * If `Access-Control-Expose-Headers` has not been set to true, only a subse t of all the response headers will be returned when calling [getAllRequestHeader s].
10322 *
10323 * Note that requests for file:// URIs are only supported by Chrome extensions
10324 * with appropriate permissions in their manifest. Requests to file:// URIs
10325 * will also never fail- the Future will always complete successfully, even
10326 * when the file cannot be found.
10327 *
10328 * See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access _authentication).
10329 */
10330 static Future<HttpRequest> request(String url,
10331 {String method, bool withCredentials, String responseType, sendData,
10332 void onProgress(ProgressEvent e)}) {
10333 var completer = new Completer<HttpRequest>();
10334
10335 var xhr = new HttpRequest();
10336 if (method == null) {
10337 method = 'GET';
10338 }
10339 xhr.open(method, url, async: true);
10340
10341 if (withCredentials != null) {
10342 xhr.withCredentials = withCredentials;
10343 }
10344
10345 if (responseType != null) {
10346 xhr.responseType = responseType;
10347 }
10348
10349 if (onProgress != null) {
10350 xhr.onProgress.listen(onProgress);
10351 }
10352
10353 xhr.onLoad.listen((e) {
10354 // Note: file:// URIs have status of 0.
10355 if ((xhr.status >= 200 && xhr.status < 300) ||
10356 xhr.status == 0 || xhr.status == 304) {
10357 completer.complete(xhr);
10358 } else {
10359 completer.completeError(e);
10360 }
10361 });
10362
10363 xhr.onError.listen((e) {
10364 completer.completeError(e);
10365 });
10366
10367 if (sendData != null) {
10368 xhr.send(sendData);
10369 } else {
10370 xhr.send();
10371 }
10372
10373 return completer.future;
10374 }
10375
10376 /**
10377 * Checks to see if the Progress event is supported on the current platform.
10378 */
10379 static bool get supportsProgressEvent {
10380 var xhr = new HttpRequest();
10381 return JS('bool', '("onprogress" in #)', xhr);
10382 }
10383
10384 /**
10385 * Checks to see if the current platform supports making cross origin
10386 * requests.
10387 *
10388 * Note that even if cross origin requests are supported, they still may fail
10389 * if the destination server does not support CORS requests.
10390 */
10391 static bool get supportsCrossOrigin {
10392 var xhr = new HttpRequest();
10393 return JS('bool', '("withCredentials" in #)', xhr);
10394 }
10395
10396 /**
10397 * Checks to see if the LoadEnd event is supported on the current platform.
10398 */
10399 static bool get supportsLoadEndEvent {
10400 var xhr = new HttpRequest();
10401 return JS('bool', '("onloadend" in #)', xhr);
10402 }
10403
10404
10405 @DomName('XMLHttpRequest.abortEvent')
10406 @DocsEditable
10407 static const EventStreamProvider<ProgressEvent> abortEvent = const EventStream Provider<ProgressEvent>('abort');
10408
10409 @DomName('XMLHttpRequest.errorEvent')
10410 @DocsEditable
10411 static const EventStreamProvider<ProgressEvent> errorEvent = const EventStream Provider<ProgressEvent>('error');
10412
10413 @DomName('XMLHttpRequest.loadEvent')
10414 @DocsEditable
10415 static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamP rovider<ProgressEvent>('load');
10416
10417 @DomName('XMLHttpRequest.loadendEvent')
10418 @DocsEditable
10419 static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStre amProvider<ProgressEvent>('loadend');
10420
10421 @DomName('XMLHttpRequest.loadstartEvent')
10422 @DocsEditable
10423 static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventSt reamProvider<ProgressEvent>('loadstart');
10424
10425 @DomName('XMLHttpRequest.progressEvent')
10426 @DocsEditable
10427 static const EventStreamProvider<ProgressEvent> progressEvent = const EventStr eamProvider<ProgressEvent>('progress');
10428
10429 @DomName('XMLHttpRequest.readystatechangeEvent')
10430 @DocsEditable
10431 static const EventStreamProvider<ProgressEvent> readyStateChangeEvent = const EventStreamProvider<ProgressEvent>('readystatechange');
10432
10433 /**
10434 * General constructor for any type of request (GET, POST, etc).
10435 *
10436 * This call is used in conjunction with [open]:
10437 *
10438 * var request = new HttpRequest();
10439 * request.open('GET', 'http://dartlang.org')
10440 * request.on.load.add((event) => print('Request complete'));
10441 *
10442 * is the (more verbose) equivalent of
10443 *
10444 * var request = new HttpRequest.get('http://dartlang.org',
10445 * (event) => print('Request complete'));
10446 */
10447 @DomName('XMLHttpRequest.XMLHttpRequest')
10448 @DocsEditable
10449 factory HttpRequest() {
10450 return HttpRequest._create_1();
10451 }
10452 static HttpRequest _create_1() => JS('HttpRequest', 'new XMLHttpRequest()');
10453
10454 static const int DONE = 4;
10455
10456 static const int HEADERS_RECEIVED = 2;
10457
10458 static const int LOADING = 3;
10459
10460 static const int OPENED = 1;
10461
10462 static const int UNSENT = 0;
10463
10464 /**
10465 * Indicator of the current state of the request:
10466 *
10467 * <table>
10468 * <tr>
10469 * <td>Value</td>
10470 * <td>State</td>
10471 * <td>Meaning</td>
10472 * </tr>
10473 * <tr>
10474 * <td>0</td>
10475 * <td>unsent</td>
10476 * <td><code>open()</code> has not yet been called</td>
10477 * </tr>
10478 * <tr>
10479 * <td>1</td>
10480 * <td>opened</td>
10481 * <td><code>send()</code> has not yet been called</td>
10482 * </tr>
10483 * <tr>
10484 * <td>2</td>
10485 * <td>headers received</td>
10486 * <td><code>sent()</code> has been called; response headers and <code>sta tus</code> are available</td>
10487 * </tr>
10488 * <tr>
10489 * <td>3</td> <td>loading</td> <td><code>responseText</code> holds some da ta</td>
10490 * </tr>
10491 * <tr>
10492 * <td>4</td> <td>done</td> <td>request is complete</td>
10493 * </tr>
10494 * </table>
10495 */
10496 @DomName('XMLHttpRequest.readyState')
10497 @DocsEditable
10498 final int readyState;
10499
10500 /**
10501 * The data received as a reponse from the request.
10502 *
10503 * The data could be in the
10504 * form of a [String], [ArrayBuffer], [Document], [Blob], or json (also a
10505 * [String]). `null` indicates request failure.
10506 */
10507 @DomName('XMLHttpRequest.response')
10508 @DocsEditable
10509 @SupportedBrowser(SupportedBrowser.CHROME)
10510 @SupportedBrowser(SupportedBrowser.FIREFOX)
10511 @SupportedBrowser(SupportedBrowser.IE, '10')
10512 @SupportedBrowser(SupportedBrowser.SAFARI)
10513 @Creates('ByteBuffer|Blob|Document|=Object|=List|String|num')
10514 final Object response;
10515
10516 /**
10517 * The response in string form or `null on failure.
10518 */
10519 @DomName('XMLHttpRequest.responseText')
10520 @DocsEditable
10521 final String responseText;
10522
10523 /**
10524 * [String] telling the server the desired response format.
10525 *
10526 * Default is `String`.
10527 * Other options are one of 'arraybuffer', 'blob', 'document', 'json',
10528 * 'text'. Some newer browsers will throw NS_ERROR_DOM_INVALID_ACCESS_ERR if
10529 * `responseType` is set while performing a synchronous request.
10530 *
10531 * See also: [MDN responseType](https://developer.mozilla.org/en-US/docs/DOM/X MLHttpRequest#responseType)
10532 */
10533 @DomName('XMLHttpRequest.responseType')
10534 @DocsEditable
10535 String responseType;
10536
10537 @JSName('responseXML')
10538 /**
10539 * The request response, or null on failure.
10540 *
10541 * The response is processed as
10542 * `text/xml` stream, unless responseType = 'document' and the request is
10543 * synchronous.
10544 */
10545 @DomName('XMLHttpRequest.responseXML')
10546 @DocsEditable
10547 final Document responseXml;
10548
10549 /**
10550 * The http result code from the request (200, 404, etc).
10551 * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_sta tus_codes)
10552 */
10553 @DomName('XMLHttpRequest.status')
10554 @DocsEditable
10555 final int status;
10556
10557 /**
10558 * The request response string (such as \"200 OK\").
10559 * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_sta tus_codes)
10560 */
10561 @DomName('XMLHttpRequest.statusText')
10562 @DocsEditable
10563 final String statusText;
10564
10565 /**
10566 * [EventTarget] that can hold listeners to track the progress of the request.
10567 * The events fired will be members of [HttpRequestUploadEvents].
10568 */
10569 @DomName('XMLHttpRequest.upload')
10570 @DocsEditable
10571 final HttpRequestUpload upload;
10572
10573 /**
10574 * True if cross-site requests should use credentials such as cookies
10575 * or authorization headers; false otherwise.
10576 *
10577 * This value is ignored for same-site requests.
10578 */
10579 @DomName('XMLHttpRequest.withCredentials')
10580 @DocsEditable
10581 bool withCredentials;
10582
10583 /**
10584 * Stop the current request.
10585 *
10586 * The request can only be stopped if readyState is `HEADERS_RECIEVED` or
10587 * `LOADING`. If this method is not in the process of being sent, the method
10588 * has no effect.
10589 */
10590 @DomName('XMLHttpRequest.abort')
10591 @DocsEditable
10592 void abort() native;
10593
10594 @JSName('addEventListener')
10595 @DomName('XMLHttpRequest.addEventListener')
10596 @DocsEditable
10597 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
10598
10599 @DomName('XMLHttpRequest.dispatchEvent')
10600 @DocsEditable
10601 bool dispatchEvent(Event evt) native;
10602
10603 /**
10604 * Retrieve all the response headers from a request.
10605 *
10606 * `null` if no headers have been received. For multipart requests,
10607 * `getAllResponseHeaders` will return the response headers for the current
10608 * part of the request.
10609 *
10610 * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_ header_fields#Responses)
10611 * for a list of common response headers.
10612 */
10613 @DomName('XMLHttpRequest.getAllResponseHeaders')
10614 @DocsEditable
10615 String getAllResponseHeaders() native;
10616
10617 /**
10618 * Return the response header named `header`, or `null` if not found.
10619 *
10620 * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_ header_fields#Responses)
10621 * for a list of common response headers.
10622 */
10623 @DomName('XMLHttpRequest.getResponseHeader')
10624 @DocsEditable
10625 String getResponseHeader(String header) native;
10626
10627 /**
10628 * Specify the desired `url`, and `method` to use in making the request.
10629 *
10630 * By default the request is done asyncronously, with no user or password
10631 * authentication information. If `async` is false, the request will be send
10632 * synchronously.
10633 *
10634 * Calling `open` again on a currently active request is equivalent to
10635 * calling `abort`.
10636 */
10637 @DomName('XMLHttpRequest.open')
10638 @DocsEditable
10639 void open(String method, String url, {bool async, String user, String password }) native;
10640
10641 /**
10642 * Specify a particular MIME type (such as `text/xml`) desired for the
10643 * response.
10644 *
10645 * This value must be set before the request has been sent. See also the list
10646 * of [common MIME types](http://en.wikipedia.org/wiki/Internet_media_type#Lis t_of_common_media_types)
10647 */
10648 @DomName('XMLHttpRequest.overrideMimeType')
10649 @DocsEditable
10650 void overrideMimeType(String override) native;
10651
10652 @JSName('removeEventListener')
10653 @DomName('XMLHttpRequest.removeEventListener')
10654 @DocsEditable
10655 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
10656
10657 /**
10658 * Send the request with any given `data`.
10659 *
10660 * See also:
10661 *
10662 * * [send](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send %28%29)
10663 * from MDN.
10664 */
10665 @DomName('XMLHttpRequest.send')
10666 @DocsEditable
10667 void send([data]) native;
10668
10669 @DomName('XMLHttpRequest.setRequestHeader')
10670 @DocsEditable
10671 void setRequestHeader(String header, String value) native;
10672
10673 /**
10674 * Event listeners to be notified when request has been aborted,
10675 * generally due to calling `httpRequest.abort()`.
10676 */
10677 @DomName('XMLHttpRequest.onabort')
10678 @DocsEditable
10679 Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
10680
10681 /**
10682 * Event listeners to be notified when a request has failed, such as when a
10683 * cross-domain error occurred or the file wasn't found on the server.
10684 */
10685 @DomName('XMLHttpRequest.onerror')
10686 @DocsEditable
10687 Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
10688
10689 /**
10690 * Event listeners to be notified once the request has completed
10691 * *successfully*.
10692 */
10693 @DomName('XMLHttpRequest.onload')
10694 @DocsEditable
10695 Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
10696
10697 /**
10698 * Event listeners to be notified once the request has completed (on
10699 * either success or failure).
10700 */
10701 @DomName('XMLHttpRequest.onloadend')
10702 @DocsEditable
10703 @SupportedBrowser(SupportedBrowser.CHROME)
10704 @SupportedBrowser(SupportedBrowser.FIREFOX)
10705 @SupportedBrowser(SupportedBrowser.IE, '10')
10706 @SupportedBrowser(SupportedBrowser.SAFARI)
10707 Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
10708
10709 /**
10710 * Event listeners to be notified when the request starts, once
10711 * `httpRequest.send()` has been called.
10712 */
10713 @DomName('XMLHttpRequest.onloadstart')
10714 @DocsEditable
10715 Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
10716
10717 /**
10718 * Event listeners to be notified when data for the request
10719 * is being sent or loaded.
10720 *
10721 * Progress events are fired every 50ms or for every byte transmitted,
10722 * whichever is less frequent.
10723 */
10724 @DomName('XMLHttpRequest.onprogress')
10725 @DocsEditable
10726 @SupportedBrowser(SupportedBrowser.CHROME)
10727 @SupportedBrowser(SupportedBrowser.FIREFOX)
10728 @SupportedBrowser(SupportedBrowser.IE, '10')
10729 @SupportedBrowser(SupportedBrowser.SAFARI)
10730 Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
10731
10732 /**
10733 * Event listeners to be notified every time the [HttpRequest]
10734 * object's `readyState` changes values.
10735 */
10736 @DomName('XMLHttpRequest.onreadystatechange')
10737 @DocsEditable
10738 Stream<ProgressEvent> get onReadyStateChange => readyStateChangeEvent.forTarge t(this);
10739
10740 }
10741 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10742 // for details. All rights reserved. Use of this source code is governed by a
10958 // BSD-style license that can be found in the LICENSE file. 10743 // BSD-style license that can be found in the LICENSE file.
10959 10744
10960 10745
10961 @DocsEditable 10746 @DocsEditable
10962 @DomName('HTMLHtmlElement') 10747 @DomName('XMLHttpRequestException')
10963 class HtmlElement extends Element native "HTMLHtmlElement" { 10748 class HttpRequestException native "XMLHttpRequestException" {
10964 10749
10965 @DomName('HTMLHtmlElement.HTMLHtmlElement') 10750 static const int ABORT_ERR = 102;
10751
10752 static const int NETWORK_ERR = 101;
10753
10754 @DomName('XMLHttpRequestException.code')
10966 @DocsEditable 10755 @DocsEditable
10967 factory HtmlElement() => document.$dom_createElement("html"); 10756 final int code;
10757
10758 @DomName('XMLHttpRequestException.message')
10759 @DocsEditable
10760 final String message;
10761
10762 @DomName('XMLHttpRequestException.name')
10763 @DocsEditable
10764 final String name;
10765
10766 @DomName('XMLHttpRequestException.toString')
10767 @DocsEditable
10768 String toString() native;
10968 } 10769 }
10969 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10770 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10970 // for details. All rights reserved. Use of this source code is governed by a 10771 // for details. All rights reserved. Use of this source code is governed by a
10971 // BSD-style license that can be found in the LICENSE file.
10972
10973
10974 @DocsEditable
10975 @DomName('HTMLFormControlsCollection')
10976 class HtmlFormControlsCollection extends HtmlCollection native "HTMLFormControls Collection" {
10977
10978 @DomName('HTMLFormControlsCollection.namedItem')
10979 @DocsEditable
10980 Node namedItem(String name) native;
10981 }
10982 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10983 // for details. All rights reserved. Use of this source code is governed by a
10984 // BSD-style license that can be found in the LICENSE file. 10772 // BSD-style license that can be found in the LICENSE file.
10985 10773
10986 10774
10987 @DocsEditable 10775 @DocsEditable
10988 @DomName('HTMLOptionsCollection')
10989 class HtmlOptionsCollection extends HtmlCollection native "HTMLOptionsCollection " {
10990 }
10991 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10992 // for details. All rights reserved. Use of this source code is governed by a
10993 // BSD-style license that can be found in the LICENSE file.
10994
10995
10996 /**
10997 * A utility for retrieving data from a URL.
10998 *
10999 * HttpRequest can be used to obtain data from http, ftp, and file
11000 * protocols.
11001 *
11002 * For example, suppose we're developing these API docs, and we
11003 * wish to retrieve the HTML of the top-level page and print it out.
11004 * The easiest way to do that would be:
11005 *
11006 * HttpRequest.getString('http://api.dartlang.org').then((response) {
11007 * print(response);
11008 * });
11009 *
11010 * **Important**: With the default behavior of this class, your
11011 * code making the request should be served from the same origin (domain name,
11012 * port, and application layer protocol) as the URL you are trying to access
11013 * with HttpRequest. However, there are ways to
11014 * [get around this restriction](http://www.dartlang.org/articles/json-web-servi ce/#note-on-jsonp).
11015 *
11016 * See also:
11017 *
11018 * * [Dart article on using HttpRequests](http://www.dartlang.org/articles/json- web-service/#getting-data)
11019 * * [JS XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpReq uest)
11020 * * [Using XMLHttpRequest](https://developer.mozilla.org/en-US/docs/DOM/XMLHttp Request/Using_XMLHttpRequest)
11021 */
11022 @DomName('XMLHttpRequest')
11023 class HttpRequest extends EventTarget native "XMLHttpRequest" {
11024
11025 /**
11026 * Creates a URL get request for the specified [url].
11027 *
11028 * The server response must be a `text/` mime type for this request to
11029 * succeed.
11030 *
11031 * This is similar to [request] but specialized for HTTP GET requests which
11032 * return text content.
11033 *
11034 * See also:
11035 *
11036 * * [request]
11037 */
11038 static Future<String> getString(String url,
11039 {bool withCredentials, void onProgress(ProgressEvent e)}) {
11040 return request(url, withCredentials: withCredentials,
11041 onProgress: onProgress).then((xhr) => xhr.responseText);
11042 }
11043
11044 /**
11045 * Creates a URL request for the specified [url].
11046 *
11047 * By default this will do an HTTP GET request, this can be overridden with
11048 * [method].
11049 *
11050 * The Future is completed when the response is available.
11051 *
11052 * The [withCredentials] parameter specified that credentials such as a cookie
11053 * (already) set in the header or
11054 * [authorization headers](http://tools.ietf.org/html/rfc1945#section-10.2)
11055 * should be specified for the request. Details to keep in mind when using
11056 * credentials:
11057 *
11058 * * Using credentials is only useful for cross-origin requests.
11059 * * The `Access-Control-Allow-Origin` header of `url` cannot contain a wildca rd (*).
11060 * * The `Access-Control-Allow-Credentials` header of `url` must be set to tru e.
11061 * * If `Access-Control-Expose-Headers` has not been set to true, only a subse t of all the response headers will be returned when calling [getAllRequestHeader s].
11062 *
11063 * Note that requests for file:// URIs are only supported by Chrome extensions
11064 * with appropriate permissions in their manifest. Requests to file:// URIs
11065 * will also never fail- the Future will always complete successfully, even
11066 * when the file cannot be found.
11067 *
11068 * See also: [authorization headers](http://en.wikipedia.org/wiki/Basic_access _authentication).
11069 */
11070 static Future<HttpRequest> request(String url,
11071 {String method, bool withCredentials, String responseType, sendData,
11072 void onProgress(ProgressEvent e)}) {
11073 var completer = new Completer<HttpRequest>();
11074
11075 var xhr = new HttpRequest();
11076 if (method == null) {
11077 method = 'GET';
11078 }
11079 xhr.open(method, url, async: true);
11080
11081 if (withCredentials != null) {
11082 xhr.withCredentials = withCredentials;
11083 }
11084
11085 if (responseType != null) {
11086 xhr.responseType = responseType;
11087 }
11088
11089 if (onProgress != null) {
11090 xhr.onProgress.listen(onProgress);
11091 }
11092
11093 xhr.onLoad.listen((e) {
11094 // Note: file:// URIs have status of 0.
11095 if ((xhr.status >= 200 && xhr.status < 300) ||
11096 xhr.status == 0 || xhr.status == 304) {
11097 completer.complete(xhr);
11098 } else {
11099 completer.completeError(e);
11100 }
11101 });
11102
11103 xhr.onError.listen((e) {
11104 completer.completeError(e);
11105 });
11106
11107 if (sendData != null) {
11108 xhr.send(sendData);
11109 } else {
11110 xhr.send();
11111 }
11112
11113 return completer.future;
11114 }
11115
11116 /**
11117 * Checks to see if the Progress event is supported on the current platform.
11118 */
11119 static bool get supportsProgressEvent {
11120 var xhr = new HttpRequest();
11121 return JS('bool', '("onprogress" in #)', xhr);
11122 }
11123
11124 /**
11125 * Checks to see if the current platform supports making cross origin
11126 * requests.
11127 *
11128 * Note that even if cross origin requests are supported, they still may fail
11129 * if the destination server does not support CORS requests.
11130 */
11131 static bool get supportsCrossOrigin {
11132 var xhr = new HttpRequest();
11133 return JS('bool', '("withCredentials" in #)', xhr);
11134 }
11135
11136 /**
11137 * Checks to see if the LoadEnd event is supported on the current platform.
11138 */
11139 static bool get supportsLoadEndEvent {
11140 var xhr = new HttpRequest();
11141 return JS('bool', '("onloadend" in #)', xhr);
11142 }
11143
11144
11145 @DomName('XMLHttpRequest.abortEvent')
11146 @DocsEditable
11147 static const EventStreamProvider<ProgressEvent> abortEvent = const EventStream Provider<ProgressEvent>('abort');
11148
11149 @DomName('XMLHttpRequest.errorEvent')
11150 @DocsEditable
11151 static const EventStreamProvider<ProgressEvent> errorEvent = const EventStream Provider<ProgressEvent>('error');
11152
11153 @DomName('XMLHttpRequest.loadEvent')
11154 @DocsEditable
11155 static const EventStreamProvider<ProgressEvent> loadEvent = const EventStreamP rovider<ProgressEvent>('load');
11156
11157 @DomName('XMLHttpRequest.loadendEvent')
11158 @DocsEditable
11159 static const EventStreamProvider<ProgressEvent> loadEndEvent = const EventStre amProvider<ProgressEvent>('loadend');
11160
11161 @DomName('XMLHttpRequest.loadstartEvent')
11162 @DocsEditable
11163 static const EventStreamProvider<ProgressEvent> loadStartEvent = const EventSt reamProvider<ProgressEvent>('loadstart');
11164
11165 @DomName('XMLHttpRequest.progressEvent')
11166 @DocsEditable
11167 static const EventStreamProvider<ProgressEvent> progressEvent = const EventStr eamProvider<ProgressEvent>('progress');
11168
11169 @DomName('XMLHttpRequest.readystatechangeEvent')
11170 @DocsEditable
11171 static const EventStreamProvider<ProgressEvent> readyStateChangeEvent = const EventStreamProvider<ProgressEvent>('readystatechange');
11172
11173 /**
11174 * General constructor for any type of request (GET, POST, etc).
11175 *
11176 * This call is used in conjunction with [open]:
11177 *
11178 * var request = new HttpRequest();
11179 * request.open('GET', 'http://dartlang.org')
11180 * request.on.load.add((event) => print('Request complete'));
11181 *
11182 * is the (more verbose) equivalent of
11183 *
11184 * var request = new HttpRequest.get('http://dartlang.org',
11185 * (event) => print('Request complete'));
11186 */
11187 @DomName('XMLHttpRequest.XMLHttpRequest')
11188 @DocsEditable
11189 factory HttpRequest() {
11190 return HttpRequest._create_1();
11191 }
11192 static HttpRequest _create_1() => JS('HttpRequest', 'new XMLHttpRequest()');
11193
11194 static const int DONE = 4;
11195
11196 static const int HEADERS_RECEIVED = 2;
11197
11198 static const int LOADING = 3;
11199
11200 static const int OPENED = 1;
11201
11202 static const int UNSENT = 0;
11203
11204 /**
11205 * Indicator of the current state of the request:
11206 *
11207 * <table>
11208 * <tr>
11209 * <td>Value</td>
11210 * <td>State</td>
11211 * <td>Meaning</td>
11212 * </tr>
11213 * <tr>
11214 * <td>0</td>
11215 * <td>unsent</td>
11216 * <td><code>open()</code> has not yet been called</td>
11217 * </tr>
11218 * <tr>
11219 * <td>1</td>
11220 * <td>opened</td>
11221 * <td><code>send()</code> has not yet been called</td>
11222 * </tr>
11223 * <tr>
11224 * <td>2</td>
11225 * <td>headers received</td>
11226 * <td><code>sent()</code> has been called; response headers and <code>sta tus</code> are available</td>
11227 * </tr>
11228 * <tr>
11229 * <td>3</td> <td>loading</td> <td><code>responseText</code> holds some da ta</td>
11230 * </tr>
11231 * <tr>
11232 * <td>4</td> <td>done</td> <td>request is complete</td>
11233 * </tr>
11234 * </table>
11235 */
11236 @DomName('XMLHttpRequest.readyState')
11237 @DocsEditable
11238 final int readyState;
11239
11240 /**
11241 * The data received as a reponse from the request.
11242 *
11243 * The data could be in the
11244 * form of a [String], [ArrayBuffer], [Document], [Blob], or json (also a
11245 * [String]). `null` indicates request failure.
11246 */
11247 @DomName('XMLHttpRequest.response')
11248 @DocsEditable
11249 @SupportedBrowser(SupportedBrowser.CHROME)
11250 @SupportedBrowser(SupportedBrowser.FIREFOX)
11251 @SupportedBrowser(SupportedBrowser.IE, '10')
11252 @SupportedBrowser(SupportedBrowser.SAFARI)
11253 @Creates('ByteBuffer|Blob|Document|=Object|=List|String|num')
11254 final Object response;
11255
11256 /**
11257 * The response in string form or `null on failure.
11258 */
11259 @DomName('XMLHttpRequest.responseText')
11260 @DocsEditable
11261 final String responseText;
11262
11263 /**
11264 * [String] telling the server the desired response format.
11265 *
11266 * Default is `String`.
11267 * Other options are one of 'arraybuffer', 'blob', 'document', 'json',
11268 * 'text'. Some newer browsers will throw NS_ERROR_DOM_INVALID_ACCESS_ERR if
11269 * `responseType` is set while performing a synchronous request.
11270 *
11271 * See also: [MDN responseType](https://developer.mozilla.org/en-US/docs/DOM/X MLHttpRequest#responseType)
11272 */
11273 @DomName('XMLHttpRequest.responseType')
11274 @DocsEditable
11275 String responseType;
11276
11277 @JSName('responseXML')
11278 /**
11279 * The request response, or null on failure.
11280 *
11281 * The response is processed as
11282 * `text/xml` stream, unless responseType = 'document' and the request is
11283 * synchronous.
11284 */
11285 @DomName('XMLHttpRequest.responseXML')
11286 @DocsEditable
11287 final Document responseXml;
11288
11289 /**
11290 * The http result code from the request (200, 404, etc).
11291 * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_sta tus_codes)
11292 */
11293 @DomName('XMLHttpRequest.status')
11294 @DocsEditable
11295 final int status;
11296
11297 /**
11298 * The request response string (such as \"200 OK\").
11299 * See also: [Http Status Codes](http://en.wikipedia.org/wiki/List_of_HTTP_sta tus_codes)
11300 */
11301 @DomName('XMLHttpRequest.statusText')
11302 @DocsEditable
11303 final String statusText;
11304
11305 /**
11306 * [EventTarget] that can hold listeners to track the progress of the request.
11307 * The events fired will be members of [HttpRequestUploadEvents].
11308 */
11309 @DomName('XMLHttpRequest.upload')
11310 @DocsEditable
11311 final HttpRequestUpload upload;
11312
11313 /**
11314 * True if cross-site requests should use credentials such as cookies
11315 * or authorization headers; false otherwise.
11316 *
11317 * This value is ignored for same-site requests.
11318 */
11319 @DomName('XMLHttpRequest.withCredentials')
11320 @DocsEditable
11321 bool withCredentials;
11322
11323 /**
11324 * Stop the current request.
11325 *
11326 * The request can only be stopped if readyState is `HEADERS_RECIEVED` or
11327 * `LOADING`. If this method is not in the process of being sent, the method
11328 * has no effect.
11329 */
11330 @DomName('XMLHttpRequest.abort')
11331 @DocsEditable
11332 void abort() native;
11333
11334 @JSName('addEventListener')
11335 @DomName('XMLHttpRequest.addEventListener')
11336 @DocsEditable
11337 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
11338
11339 @DomName('XMLHttpRequest.dispatchEvent')
11340 @DocsEditable
11341 bool dispatchEvent(Event evt) native;
11342
11343 /**
11344 * Retrieve all the response headers from a request.
11345 *
11346 * `null` if no headers have been received. For multipart requests,
11347 * `getAllResponseHeaders` will return the response headers for the current
11348 * part of the request.
11349 *
11350 * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_ header_fields#Responses)
11351 * for a list of common response headers.
11352 */
11353 @DomName('XMLHttpRequest.getAllResponseHeaders')
11354 @DocsEditable
11355 String getAllResponseHeaders() native;
11356
11357 /**
11358 * Return the response header named `header`, or `null` if not found.
11359 *
11360 * See also [HTTP response headers](http://en.wikipedia.org/wiki/List_of_HTTP_ header_fields#Responses)
11361 * for a list of common response headers.
11362 */
11363 @DomName('XMLHttpRequest.getResponseHeader')
11364 @DocsEditable
11365 String getResponseHeader(String header) native;
11366
11367 /**
11368 * Specify the desired `url`, and `method` to use in making the request.
11369 *
11370 * By default the request is done asyncronously, with no user or password
11371 * authentication information. If `async` is false, the request will be send
11372 * synchronously.
11373 *
11374 * Calling `open` again on a currently active request is equivalent to
11375 * calling `abort`.
11376 */
11377 @DomName('XMLHttpRequest.open')
11378 @DocsEditable
11379 void open(String method, String url, {bool async, String user, String password }) native;
11380
11381 /**
11382 * Specify a particular MIME type (such as `text/xml`) desired for the
11383 * response.
11384 *
11385 * This value must be set before the request has been sent. See also the list
11386 * of [common MIME types](http://en.wikipedia.org/wiki/Internet_media_type#Lis t_of_common_media_types)
11387 */
11388 @DomName('XMLHttpRequest.overrideMimeType')
11389 @DocsEditable
11390 void overrideMimeType(String override) native;
11391
11392 @JSName('removeEventListener')
11393 @DomName('XMLHttpRequest.removeEventListener')
11394 @DocsEditable
11395 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
11396
11397 /**
11398 * Send the request with any given `data`.
11399 *
11400 * See also:
11401 *
11402 * * [send](https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest#send %28%29)
11403 * from MDN.
11404 */
11405 @DomName('XMLHttpRequest.send')
11406 @DocsEditable
11407 void send([data]) native;
11408
11409 @DomName('XMLHttpRequest.setRequestHeader')
11410 @DocsEditable
11411 void setRequestHeader(String header, String value) native;
11412
11413 /**
11414 * Event listeners to be notified when request has been aborted,
11415 * generally due to calling `httpRequest.abort()`.
11416 */
11417 @DomName('XMLHttpRequest.onabort')
11418 @DocsEditable
11419 Stream<ProgressEvent> get onAbort => abortEvent.forTarget(this);
11420
11421 /**
11422 * Event listeners to be notified when a request has failed, such as when a
11423 * cross-domain error occurred or the file wasn't found on the server.
11424 */
11425 @DomName('XMLHttpRequest.onerror')
11426 @DocsEditable
11427 Stream<ProgressEvent> get onError => errorEvent.forTarget(this);
11428
11429 /**
11430 * Event listeners to be notified once the request has completed
11431 * *successfully*.
11432 */
11433 @DomName('XMLHttpRequest.onload')
11434 @DocsEditable
11435 Stream<ProgressEvent> get onLoad => loadEvent.forTarget(this);
11436
11437 /**
11438 * Event listeners to be notified once the request has completed (on
11439 * either success or failure).
11440 */
11441 @DomName('XMLHttpRequest.onloadend')
11442 @DocsEditable
11443 @SupportedBrowser(SupportedBrowser.CHROME)
11444 @SupportedBrowser(SupportedBrowser.FIREFOX)
11445 @SupportedBrowser(SupportedBrowser.IE, '10')
11446 @SupportedBrowser(SupportedBrowser.SAFARI)
11447 Stream<ProgressEvent> get onLoadEnd => loadEndEvent.forTarget(this);
11448
11449 /**
11450 * Event listeners to be notified when the request starts, once
11451 * `httpRequest.send()` has been called.
11452 */
11453 @DomName('XMLHttpRequest.onloadstart')
11454 @DocsEditable
11455 Stream<ProgressEvent> get onLoadStart => loadStartEvent.forTarget(this);
11456
11457 /**
11458 * Event listeners to be notified when data for the request
11459 * is being sent or loaded.
11460 *
11461 * Progress events are fired every 50ms or for every byte transmitted,
11462 * whichever is less frequent.
11463 */
11464 @DomName('XMLHttpRequest.onprogress')
11465 @DocsEditable
11466 @SupportedBrowser(SupportedBrowser.CHROME)
11467 @SupportedBrowser(SupportedBrowser.FIREFOX)
11468 @SupportedBrowser(SupportedBrowser.IE, '10')
11469 @SupportedBrowser(SupportedBrowser.SAFARI)
11470 Stream<ProgressEvent> get onProgress => progressEvent.forTarget(this);
11471
11472 /**
11473 * Event listeners to be notified every time the [HttpRequest]
11474 * object's `readyState` changes values.
11475 */
11476 @DomName('XMLHttpRequest.onreadystatechange')
11477 @DocsEditable
11478 Stream<ProgressEvent> get onReadyStateChange => readyStateChangeEvent.forTarge t(this);
11479
11480 }
11481 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
11482 // for details. All rights reserved. Use of this source code is governed by a
11483 // BSD-style license that can be found in the LICENSE file.
11484
11485
11486 @DocsEditable
11487 @DomName('XMLHttpRequestException')
11488 class HttpRequestException native "XMLHttpRequestException" {
11489
11490 static const int ABORT_ERR = 102;
11491
11492 static const int NETWORK_ERR = 101;
11493
11494 @DomName('XMLHttpRequestException.code')
11495 @DocsEditable
11496 final int code;
11497
11498 @DomName('XMLHttpRequestException.message')
11499 @DocsEditable
11500 final String message;
11501
11502 @DomName('XMLHttpRequestException.name')
11503 @DocsEditable
11504 final String name;
11505
11506 @DomName('XMLHttpRequestException.toString')
11507 @DocsEditable
11508 String toString() native;
11509 }
11510 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
11511 // for details. All rights reserved. Use of this source code is governed by a
11512 // BSD-style license that can be found in the LICENSE file.
11513
11514
11515 @DocsEditable
11516 @DomName('XMLHttpRequestProgressEvent') 10776 @DomName('XMLHttpRequestProgressEvent')
11517 @SupportedBrowser(SupportedBrowser.CHROME) 10777 @SupportedBrowser(SupportedBrowser.CHROME)
11518 @SupportedBrowser(SupportedBrowser.SAFARI) 10778 @SupportedBrowser(SupportedBrowser.SAFARI)
11519 @Experimental 10779 @Experimental
11520 class HttpRequestProgressEvent extends ProgressEvent native "XMLHttpRequestProgr essEvent" { 10780 class HttpRequestProgressEvent extends ProgressEvent native "XMLHttpRequestProgr essEvent" {
11521 10781
11522 /// Checks if this type is supported on the current platform. 10782 /// Checks if this type is supported on the current platform.
11523 static bool get supported => Device.isEventTypeSupported('XMLHttpRequestProgre ssEvent'); 10783 static bool get supported => Device.isEventTypeSupported('XMLHttpRequestProgre ssEvent');
11524 10784
11525 @DomName('XMLHttpRequestProgressEvent.position') 10785 @DomName('XMLHttpRequestProgressEvent.position')
(...skipping 2715 matching lines...) Expand 10 before | Expand all | Expand 10 after
14241 @DocsEditable 13501 @DocsEditable
14242 final String type; 13502 final String type;
14243 } 13503 }
14244 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 13504 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
14245 // for details. All rights reserved. Use of this source code is governed by a 13505 // for details. All rights reserved. Use of this source code is governed by a
14246 // BSD-style license that can be found in the LICENSE file. 13506 // BSD-style license that can be found in the LICENSE file.
14247 13507
14248 13508
14249 @DocsEditable 13509 @DocsEditable
14250 @DomName('MimeTypeArray') 13510 @DomName('MimeTypeArray')
14251 class MimeTypeArray implements JavaScriptIndexingBehavior, List<MimeType> native "MimeTypeArray" { 13511 class MimeTypeArray extends Object with ListMixin<MimeType>, ImmutableListMixin< MimeType> implements JavaScriptIndexingBehavior, List<MimeType> native "MimeType Array" {
14252 13512
14253 @DomName('DOMMimeTypeArray.length') 13513 @DomName('DOMMimeTypeArray.length')
14254 @DocsEditable 13514 @DocsEditable
14255 int get length => JS("int", "#.length", this); 13515 int get length => JS("int", "#.length", this);
14256 13516
14257 MimeType operator[](int index) => JS("MimeType", "#[#]", this, index); 13517 MimeType operator[](int index) => JS("MimeType", "#[#]", this, index);
14258 13518
14259 void operator[]=(int index, MimeType value) { 13519 void operator[]=(int index, MimeType value) {
14260 throw new UnsupportedError("Cannot assign element of immutable List."); 13520 throw new UnsupportedError("Cannot assign element of immutable List.");
14261 } 13521 }
14262 // -- start List<MimeType> mixins. 13522 // -- start List<MimeType> mixins.
14263 // MimeType is the element type. 13523 // MimeType is the element type.
14264 13524
14265 // From Iterable<MimeType>:
14266 13525
14267 Iterator<MimeType> get iterator {
14268 // Note: NodeLists are not fixed size. And most probably length shouldn't
14269 // be cached in both iterator _and_ forEach method. For now caching it
14270 // for consistency.
14271 return new FixedSizeListIterator<MimeType>(this);
14272 }
14273
14274 MimeType reduce(MimeType combine(MimeType value, MimeType element)) {
14275 return IterableMixinWorkaround.reduce(this, combine);
14276 }
14277
14278 dynamic fold(dynamic initialValue,
14279 dynamic combine(dynamic previousValue, MimeType element)) {
14280 return IterableMixinWorkaround.fold(this, initialValue, combine);
14281 }
14282
14283 bool contains(MimeType element) => IterableMixinWorkaround.contains(this, elem ent);
14284
14285 void forEach(void f(MimeType element)) => IterableMixinWorkaround.forEach(this , f);
14286
14287 String join([String separator = ""]) =>
14288 IterableMixinWorkaround.joinList(this, separator);
14289
14290 Iterable map(f(MimeType element)) =>
14291 IterableMixinWorkaround.mapList(this, f);
14292
14293 Iterable<MimeType> where(bool f(MimeType element)) =>
14294 IterableMixinWorkaround.where(this, f);
14295
14296 Iterable expand(Iterable f(MimeType element)) =>
14297 IterableMixinWorkaround.expand(this, f);
14298
14299 bool every(bool f(MimeType element)) => IterableMixinWorkaround.every(this, f) ;
14300
14301 bool any(bool f(MimeType element)) => IterableMixinWorkaround.any(this, f);
14302
14303 List<MimeType> toList({ bool growable: true }) =>
14304 new List<MimeType>.from(this, growable: growable);
14305
14306 Set<MimeType> toSet() => new Set<MimeType>.from(this);
14307
14308 bool get isEmpty => this.length == 0;
14309
14310 Iterable<MimeType> take(int n) => IterableMixinWorkaround.takeList(this, n);
14311
14312 Iterable<MimeType> takeWhile(bool test(MimeType value)) {
14313 return IterableMixinWorkaround.takeWhile(this, test);
14314 }
14315
14316 Iterable<MimeType> skip(int n) => IterableMixinWorkaround.skipList(this, n);
14317
14318 Iterable<MimeType> skipWhile(bool test(MimeType value)) {
14319 return IterableMixinWorkaround.skipWhile(this, test);
14320 }
14321
14322 MimeType firstWhere(bool test(MimeType value), { MimeType orElse() }) {
14323 return IterableMixinWorkaround.firstWhere(this, test, orElse);
14324 }
14325
14326 MimeType lastWhere(bool test(MimeType value), {MimeType orElse()}) {
14327 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
14328 }
14329
14330 MimeType singleWhere(bool test(MimeType value)) {
14331 return IterableMixinWorkaround.singleWhere(this, test);
14332 }
14333
14334 MimeType elementAt(int index) {
14335 return this[index];
14336 }
14337
14338 // From Collection<MimeType>:
14339
14340 void add(MimeType value) {
14341 throw new UnsupportedError("Cannot add to immutable List.");
14342 }
14343
14344 void addAll(Iterable<MimeType> iterable) {
14345 throw new UnsupportedError("Cannot add to immutable List.");
14346 }
14347
14348 // From List<MimeType>:
14349 void set length(int value) { 13526 void set length(int value) {
14350 throw new UnsupportedError("Cannot resize immutable List."); 13527 throw new UnsupportedError("Cannot resize immutable List.");
14351 } 13528 }
14352 13529
14353 void clear() {
14354 throw new UnsupportedError("Cannot clear immutable List.");
14355 }
14356
14357 Iterable<MimeType> get reversed {
14358 return IterableMixinWorkaround.reversedList(this);
14359 }
14360
14361 void sort([int compare(MimeType a, MimeType b)]) {
14362 throw new UnsupportedError("Cannot sort immutable List.");
14363 }
14364
14365 int indexOf(MimeType element, [int start = 0]) =>
14366 Lists.indexOf(this, element, start, this.length);
14367
14368 int lastIndexOf(MimeType element, [int start]) {
14369 if (start == null) start = length - 1;
14370 return Lists.lastIndexOf(this, element, start);
14371 }
14372
14373 MimeType get first {
14374 if (this.length > 0) return this[0];
14375 throw new StateError("No elements");
14376 }
14377
14378 MimeType get last {
14379 if (this.length > 0) return this[this.length - 1];
14380 throw new StateError("No elements");
14381 }
14382
14383 MimeType get single {
14384 if (length == 1) return this[0];
14385 if (length == 0) throw new StateError("No elements");
14386 throw new StateError("More than one element");
14387 }
14388
14389 void insert(int index, MimeType element) {
14390 throw new UnsupportedError("Cannot add to immutable List.");
14391 }
14392
14393 void insertAll(int index, Iterable<MimeType> iterable) {
14394 throw new UnsupportedError("Cannot add to immutable List.");
14395 }
14396
14397 void setAll(int index, Iterable<MimeType> iterable) {
14398 throw new UnsupportedError("Cannot modify an immutable List.");
14399 }
14400
14401 MimeType removeAt(int pos) {
14402 throw new UnsupportedError("Cannot remove from immutable List.");
14403 }
14404
14405 MimeType removeLast() {
14406 throw new UnsupportedError("Cannot remove from immutable List.");
14407 }
14408
14409 bool remove(Object object) {
14410 throw new UnsupportedError("Cannot remove from immutable List.");
14411 }
14412
14413 void removeWhere(bool test(MimeType element)) {
14414 throw new UnsupportedError("Cannot remove from immutable List.");
14415 }
14416
14417 void retainWhere(bool test(MimeType element)) {
14418 throw new UnsupportedError("Cannot remove from immutable List.");
14419 }
14420
14421 void setRange(int start, int end, Iterable<MimeType> iterable, [int skipCount= 0]) {
14422 throw new UnsupportedError("Cannot setRange on immutable List.");
14423 }
14424
14425 void removeRange(int start, int end) {
14426 throw new UnsupportedError("Cannot removeRange on immutable List.");
14427 }
14428
14429 void replaceRange(int start, int end, Iterable<MimeType> iterable) {
14430 throw new UnsupportedError("Cannot modify an immutable List.");
14431 }
14432
14433 void fillRange(int start, int end, [MimeType fillValue]) {
14434 throw new UnsupportedError("Cannot modify an immutable List.");
14435 }
14436
14437 Iterable<MimeType> getRange(int start, int end) =>
14438 IterableMixinWorkaround.getRangeList(this, start, end);
14439
14440 List<MimeType> sublist(int start, [int end]) {
14441 if (end == null) end = length;
14442 return Lists.getRange(this, start, end, <MimeType>[]);
14443 }
14444
14445 Map<int, MimeType> asMap() =>
14446 IterableMixinWorkaround.asMapList(this);
14447
14448 String toString() {
14449 StringBuffer buffer = new StringBuffer('[');
14450 buffer.writeAll(this, ', ');
14451 buffer.write(']');
14452 return buffer.toString();
14453 }
14454
14455 // -- end List<MimeType> mixins. 13530 // -- end List<MimeType> mixins.
14456 13531
14457 @DomName('DOMMimeTypeArray.item') 13532 @DomName('DOMMimeTypeArray.item')
14458 @DocsEditable 13533 @DocsEditable
14459 MimeType item(int index) native; 13534 MimeType item(int index) native;
14460 13535
14461 @DomName('DOMMimeTypeArray.namedItem') 13536 @DomName('DOMMimeTypeArray.namedItem')
14462 @DocsEditable 13537 @DocsEditable
14463 MimeType namedItem(String name) native; 13538 MimeType namedItem(String name) native;
14464 } 13539 }
(...skipping 1213 matching lines...) Expand 10 before | Expand all | Expand 10 after
15678 Node previousNode() native; 14753 Node previousNode() native;
15679 14754
15680 } 14755 }
15681 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 14756 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
15682 // for details. All rights reserved. Use of this source code is governed by a 14757 // for details. All rights reserved. Use of this source code is governed by a
15683 // BSD-style license that can be found in the LICENSE file. 14758 // BSD-style license that can be found in the LICENSE file.
15684 14759
15685 14760
15686 @DocsEditable 14761 @DocsEditable
15687 @DomName('NodeList') 14762 @DomName('NodeList')
15688 class NodeList implements JavaScriptIndexingBehavior, List<Node> native "NodeLis t,RadioNodeList" { 14763 class NodeList extends Object with ListMixin<Node>, ImmutableListMixin<Node> imp lements JavaScriptIndexingBehavior, List<Node> native "NodeList,RadioNodeList" {
15689 14764
15690 @DomName('NodeList.length') 14765 @DomName('NodeList.length')
15691 @DocsEditable 14766 @DocsEditable
15692 int get length => JS("int", "#.length", this); 14767 int get length => JS("int", "#.length", this);
15693 14768
15694 Node operator[](int index) => JS("Node", "#[#]", this, index); 14769 Node operator[](int index) => JS("Node", "#[#]", this, index);
15695 14770
15696 void operator[]=(int index, Node value) { 14771 void operator[]=(int index, Node value) {
15697 throw new UnsupportedError("Cannot assign element of immutable List."); 14772 throw new UnsupportedError("Cannot assign element of immutable List.");
15698 } 14773 }
15699 // -- start List<Node> mixins. 14774 // -- start List<Node> mixins.
15700 // Node is the element type. 14775 // Node is the element type.
15701 14776
15702 // From Iterable<Node>:
15703 14777
15704 Iterator<Node> get iterator {
15705 // Note: NodeLists are not fixed size. And most probably length shouldn't
15706 // be cached in both iterator _and_ forEach method. For now caching it
15707 // for consistency.
15708 return new FixedSizeListIterator<Node>(this);
15709 }
15710
15711 Node reduce(Node combine(Node value, Node element)) {
15712 return IterableMixinWorkaround.reduce(this, combine);
15713 }
15714
15715 dynamic fold(dynamic initialValue,
15716 dynamic combine(dynamic previousValue, Node element)) {
15717 return IterableMixinWorkaround.fold(this, initialValue, combine);
15718 }
15719
15720 bool contains(Node element) => IterableMixinWorkaround.contains(this, element) ;
15721
15722 void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f) ;
15723
15724 String join([String separator = ""]) =>
15725 IterableMixinWorkaround.joinList(this, separator);
15726
15727 Iterable map(f(Node element)) =>
15728 IterableMixinWorkaround.mapList(this, f);
15729
15730 Iterable<Node> where(bool f(Node element)) =>
15731 IterableMixinWorkaround.where(this, f);
15732
15733 Iterable expand(Iterable f(Node element)) =>
15734 IterableMixinWorkaround.expand(this, f);
15735
15736 bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
15737
15738 bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
15739
15740 List<Node> toList({ bool growable: true }) =>
15741 new List<Node>.from(this, growable: growable);
15742
15743 Set<Node> toSet() => new Set<Node>.from(this);
15744
15745 bool get isEmpty => this.length == 0;
15746
15747 Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
15748
15749 Iterable<Node> takeWhile(bool test(Node value)) {
15750 return IterableMixinWorkaround.takeWhile(this, test);
15751 }
15752
15753 Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
15754
15755 Iterable<Node> skipWhile(bool test(Node value)) {
15756 return IterableMixinWorkaround.skipWhile(this, test);
15757 }
15758
15759 Node firstWhere(bool test(Node value), { Node orElse() }) {
15760 return IterableMixinWorkaround.firstWhere(this, test, orElse);
15761 }
15762
15763 Node lastWhere(bool test(Node value), {Node orElse()}) {
15764 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
15765 }
15766
15767 Node singleWhere(bool test(Node value)) {
15768 return IterableMixinWorkaround.singleWhere(this, test);
15769 }
15770
15771 Node elementAt(int index) {
15772 return this[index];
15773 }
15774
15775 // From Collection<Node>:
15776
15777 void add(Node value) {
15778 throw new UnsupportedError("Cannot add to immutable List.");
15779 }
15780
15781 void addAll(Iterable<Node> iterable) {
15782 throw new UnsupportedError("Cannot add to immutable List.");
15783 }
15784
15785 // From List<Node>:
15786 void set length(int value) { 14778 void set length(int value) {
15787 throw new UnsupportedError("Cannot resize immutable List."); 14779 throw new UnsupportedError("Cannot resize immutable List.");
15788 } 14780 }
15789 14781
15790 void clear() {
15791 throw new UnsupportedError("Cannot clear immutable List.");
15792 }
15793
15794 Iterable<Node> get reversed {
15795 return IterableMixinWorkaround.reversedList(this);
15796 }
15797
15798 void sort([int compare(Node a, Node b)]) {
15799 throw new UnsupportedError("Cannot sort immutable List.");
15800 }
15801
15802 int indexOf(Node element, [int start = 0]) =>
15803 Lists.indexOf(this, element, start, this.length);
15804
15805 int lastIndexOf(Node element, [int start]) {
15806 if (start == null) start = length - 1;
15807 return Lists.lastIndexOf(this, element, start);
15808 }
15809
15810 Node get first {
15811 if (this.length > 0) return this[0];
15812 throw new StateError("No elements");
15813 }
15814
15815 Node get last {
15816 if (this.length > 0) return this[this.length - 1];
15817 throw new StateError("No elements");
15818 }
15819
15820 Node get single {
15821 if (length == 1) return this[0];
15822 if (length == 0) throw new StateError("No elements");
15823 throw new StateError("More than one element");
15824 }
15825
15826 void insert(int index, Node element) {
15827 throw new UnsupportedError("Cannot add to immutable List.");
15828 }
15829
15830 void insertAll(int index, Iterable<Node> iterable) {
15831 throw new UnsupportedError("Cannot add to immutable List.");
15832 }
15833
15834 void setAll(int index, Iterable<Node> iterable) {
15835 throw new UnsupportedError("Cannot modify an immutable List.");
15836 }
15837
15838 Node removeAt(int pos) {
15839 throw new UnsupportedError("Cannot remove from immutable List.");
15840 }
15841
15842 Node removeLast() {
15843 throw new UnsupportedError("Cannot remove from immutable List.");
15844 }
15845
15846 bool remove(Object object) {
15847 throw new UnsupportedError("Cannot remove from immutable List.");
15848 }
15849
15850 void removeWhere(bool test(Node element)) {
15851 throw new UnsupportedError("Cannot remove from immutable List.");
15852 }
15853
15854 void retainWhere(bool test(Node element)) {
15855 throw new UnsupportedError("Cannot remove from immutable List.");
15856 }
15857
15858 void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
15859 throw new UnsupportedError("Cannot setRange on immutable List.");
15860 }
15861
15862 void removeRange(int start, int end) {
15863 throw new UnsupportedError("Cannot removeRange on immutable List.");
15864 }
15865
15866 void replaceRange(int start, int end, Iterable<Node> iterable) {
15867 throw new UnsupportedError("Cannot modify an immutable List.");
15868 }
15869
15870 void fillRange(int start, int end, [Node fillValue]) {
15871 throw new UnsupportedError("Cannot modify an immutable List.");
15872 }
15873
15874 Iterable<Node> getRange(int start, int end) =>
15875 IterableMixinWorkaround.getRangeList(this, start, end);
15876
15877 List<Node> sublist(int start, [int end]) {
15878 if (end == null) end = length;
15879 return Lists.getRange(this, start, end, <Node>[]);
15880 }
15881
15882 Map<int, Node> asMap() =>
15883 IterableMixinWorkaround.asMapList(this);
15884
15885 String toString() {
15886 StringBuffer buffer = new StringBuffer('[');
15887 buffer.writeAll(this, ', ');
15888 buffer.write(']');
15889 return buffer.toString();
15890 }
15891
15892 // -- end List<Node> mixins. 14782 // -- end List<Node> mixins.
15893 14783
15894 @JSName('item') 14784 @JSName('item')
15895 @DomName('NodeList.item') 14785 @DomName('NodeList.item')
15896 @DocsEditable 14786 @DocsEditable
15897 Node _item(int index) native; 14787 Node _item(int index) native;
15898 } 14788 }
15899 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 14789 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
15900 // for details. All rights reserved. Use of this source code is governed by a 14790 // for details. All rights reserved. Use of this source code is governed by a
15901 // BSD-style license that can be found in the LICENSE file. 14791 // BSD-style license that can be found in the LICENSE file.
(...skipping 942 matching lines...) Expand 10 before | Expand all | Expand 10 after
16844 @DocsEditable 15734 @DocsEditable
16845 MimeType namedItem(String name) native; 15735 MimeType namedItem(String name) native;
16846 } 15736 }
16847 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 15737 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
16848 // for details. All rights reserved. Use of this source code is governed by a 15738 // for details. All rights reserved. Use of this source code is governed by a
16849 // BSD-style license that can be found in the LICENSE file. 15739 // BSD-style license that can be found in the LICENSE file.
16850 15740
16851 15741
16852 @DocsEditable 15742 @DocsEditable
16853 @DomName('PluginArray') 15743 @DomName('PluginArray')
16854 class PluginArray implements JavaScriptIndexingBehavior, List<Plugin> native "Pl uginArray" { 15744 class PluginArray extends Object with ListMixin<Plugin>, ImmutableListMixin<Plug in> implements JavaScriptIndexingBehavior, List<Plugin> native "PluginArray" {
16855 15745
16856 @DomName('DOMPluginArray.length') 15746 @DomName('DOMPluginArray.length')
16857 @DocsEditable 15747 @DocsEditable
16858 int get length => JS("int", "#.length", this); 15748 int get length => JS("int", "#.length", this);
16859 15749
16860 Plugin operator[](int index) => JS("Plugin", "#[#]", this, index); 15750 Plugin operator[](int index) => JS("Plugin", "#[#]", this, index);
16861 15751
16862 void operator[]=(int index, Plugin value) { 15752 void operator[]=(int index, Plugin value) {
16863 throw new UnsupportedError("Cannot assign element of immutable List."); 15753 throw new UnsupportedError("Cannot assign element of immutable List.");
16864 } 15754 }
16865 // -- start List<Plugin> mixins. 15755 // -- start List<Plugin> mixins.
16866 // Plugin is the element type. 15756 // Plugin is the element type.
16867 15757
16868 // From Iterable<Plugin>:
16869 15758
16870 Iterator<Plugin> get iterator {
16871 // Note: NodeLists are not fixed size. And most probably length shouldn't
16872 // be cached in both iterator _and_ forEach method. For now caching it
16873 // for consistency.
16874 return new FixedSizeListIterator<Plugin>(this);
16875 }
16876
16877 Plugin reduce(Plugin combine(Plugin value, Plugin element)) {
16878 return IterableMixinWorkaround.reduce(this, combine);
16879 }
16880
16881 dynamic fold(dynamic initialValue,
16882 dynamic combine(dynamic previousValue, Plugin element)) {
16883 return IterableMixinWorkaround.fold(this, initialValue, combine);
16884 }
16885
16886 bool contains(Plugin element) => IterableMixinWorkaround.contains(this, elemen t);
16887
16888 void forEach(void f(Plugin element)) => IterableMixinWorkaround.forEach(this, f);
16889
16890 String join([String separator = ""]) =>
16891 IterableMixinWorkaround.joinList(this, separator);
16892
16893 Iterable map(f(Plugin element)) =>
16894 IterableMixinWorkaround.mapList(this, f);
16895
16896 Iterable<Plugin> where(bool f(Plugin element)) =>
16897 IterableMixinWorkaround.where(this, f);
16898
16899 Iterable expand(Iterable f(Plugin element)) =>
16900 IterableMixinWorkaround.expand(this, f);
16901
16902 bool every(bool f(Plugin element)) => IterableMixinWorkaround.every(this, f);
16903
16904 bool any(bool f(Plugin element)) => IterableMixinWorkaround.any(this, f);
16905
16906 List<Plugin> toList({ bool growable: true }) =>
16907 new List<Plugin>.from(this, growable: growable);
16908
16909 Set<Plugin> toSet() => new Set<Plugin>.from(this);
16910
16911 bool get isEmpty => this.length == 0;
16912
16913 Iterable<Plugin> take(int n) => IterableMixinWorkaround.takeList(this, n);
16914
16915 Iterable<Plugin> takeWhile(bool test(Plugin value)) {
16916 return IterableMixinWorkaround.takeWhile(this, test);
16917 }
16918
16919 Iterable<Plugin> skip(int n) => IterableMixinWorkaround.skipList(this, n);
16920
16921 Iterable<Plugin> skipWhile(bool test(Plugin value)) {
16922 return IterableMixinWorkaround.skipWhile(this, test);
16923 }
16924
16925 Plugin firstWhere(bool test(Plugin value), { Plugin orElse() }) {
16926 return IterableMixinWorkaround.firstWhere(this, test, orElse);
16927 }
16928
16929 Plugin lastWhere(bool test(Plugin value), {Plugin orElse()}) {
16930 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
16931 }
16932
16933 Plugin singleWhere(bool test(Plugin value)) {
16934 return IterableMixinWorkaround.singleWhere(this, test);
16935 }
16936
16937 Plugin elementAt(int index) {
16938 return this[index];
16939 }
16940
16941 // From Collection<Plugin>:
16942
16943 void add(Plugin value) {
16944 throw new UnsupportedError("Cannot add to immutable List.");
16945 }
16946
16947 void addAll(Iterable<Plugin> iterable) {
16948 throw new UnsupportedError("Cannot add to immutable List.");
16949 }
16950
16951 // From List<Plugin>:
16952 void set length(int value) { 15759 void set length(int value) {
16953 throw new UnsupportedError("Cannot resize immutable List."); 15760 throw new UnsupportedError("Cannot resize immutable List.");
16954 } 15761 }
16955 15762
16956 void clear() {
16957 throw new UnsupportedError("Cannot clear immutable List.");
16958 }
16959
16960 Iterable<Plugin> get reversed {
16961 return IterableMixinWorkaround.reversedList(this);
16962 }
16963
16964 void sort([int compare(Plugin a, Plugin b)]) {
16965 throw new UnsupportedError("Cannot sort immutable List.");
16966 }
16967
16968 int indexOf(Plugin element, [int start = 0]) =>
16969 Lists.indexOf(this, element, start, this.length);
16970
16971 int lastIndexOf(Plugin element, [int start]) {
16972 if (start == null) start = length - 1;
16973 return Lists.lastIndexOf(this, element, start);
16974 }
16975
16976 Plugin get first {
16977 if (this.length > 0) return this[0];
16978 throw new StateError("No elements");
16979 }
16980
16981 Plugin get last {
16982 if (this.length > 0) return this[this.length - 1];
16983 throw new StateError("No elements");
16984 }
16985
16986 Plugin get single {
16987 if (length == 1) return this[0];
16988 if (length == 0) throw new StateError("No elements");
16989 throw new StateError("More than one element");
16990 }
16991
16992 void insert(int index, Plugin element) {
16993 throw new UnsupportedError("Cannot add to immutable List.");
16994 }
16995
16996 void insertAll(int index, Iterable<Plugin> iterable) {
16997 throw new UnsupportedError("Cannot add to immutable List.");
16998 }
16999
17000 void setAll(int index, Iterable<Plugin> iterable) {
17001 throw new UnsupportedError("Cannot modify an immutable List.");
17002 }
17003
17004 Plugin removeAt(int pos) {
17005 throw new UnsupportedError("Cannot remove from immutable List.");
17006 }
17007
17008 Plugin removeLast() {
17009 throw new UnsupportedError("Cannot remove from immutable List.");
17010 }
17011
17012 bool remove(Object object) {
17013 throw new UnsupportedError("Cannot remove from immutable List.");
17014 }
17015
17016 void removeWhere(bool test(Plugin element)) {
17017 throw new UnsupportedError("Cannot remove from immutable List.");
17018 }
17019
17020 void retainWhere(bool test(Plugin element)) {
17021 throw new UnsupportedError("Cannot remove from immutable List.");
17022 }
17023
17024 void setRange(int start, int end, Iterable<Plugin> iterable, [int skipCount=0] ) {
17025 throw new UnsupportedError("Cannot setRange on immutable List.");
17026 }
17027
17028 void removeRange(int start, int end) {
17029 throw new UnsupportedError("Cannot removeRange on immutable List.");
17030 }
17031
17032 void replaceRange(int start, int end, Iterable<Plugin> iterable) {
17033 throw new UnsupportedError("Cannot modify an immutable List.");
17034 }
17035
17036 void fillRange(int start, int end, [Plugin fillValue]) {
17037 throw new UnsupportedError("Cannot modify an immutable List.");
17038 }
17039
17040 Iterable<Plugin> getRange(int start, int end) =>
17041 IterableMixinWorkaround.getRangeList(this, start, end);
17042
17043 List<Plugin> sublist(int start, [int end]) {
17044 if (end == null) end = length;
17045 return Lists.getRange(this, start, end, <Plugin>[]);
17046 }
17047
17048 Map<int, Plugin> asMap() =>
17049 IterableMixinWorkaround.asMapList(this);
17050
17051 String toString() {
17052 StringBuffer buffer = new StringBuffer('[');
17053 buffer.writeAll(this, ', ');
17054 buffer.write(']');
17055 return buffer.toString();
17056 }
17057
17058 // -- end List<Plugin> mixins. 15763 // -- end List<Plugin> mixins.
17059 15764
17060 @DomName('DOMPluginArray.item') 15765 @DomName('DOMPluginArray.item')
17061 @DocsEditable 15766 @DocsEditable
17062 Plugin item(int index) native; 15767 Plugin item(int index) native;
17063 15768
17064 @DomName('DOMPluginArray.namedItem') 15769 @DomName('DOMPluginArray.namedItem')
17065 @DocsEditable 15770 @DocsEditable
17066 Plugin namedItem(String name) native; 15771 Plugin namedItem(String name) native;
17067 15772
(...skipping 1616 matching lines...) Expand 10 before | Expand all | Expand 10 after
18684 @DocsEditable 17389 @DocsEditable
18685 void append(Uint8List data) native; 17390 void append(Uint8List data) native;
18686 } 17391 }
18687 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 17392 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
18688 // for details. All rights reserved. Use of this source code is governed by a 17393 // for details. All rights reserved. Use of this source code is governed by a
18689 // BSD-style license that can be found in the LICENSE file. 17394 // BSD-style license that can be found in the LICENSE file.
18690 17395
18691 17396
18692 @DocsEditable 17397 @DocsEditable
18693 @DomName('SourceBufferList') 17398 @DomName('SourceBufferList')
18694 class SourceBufferList extends EventTarget implements JavaScriptIndexingBehavior , List<SourceBuffer> native "SourceBufferList" { 17399 class SourceBufferList extends EventTarget with ListMixin<SourceBuffer>, Immutab leListMixin<SourceBuffer> implements JavaScriptIndexingBehavior, List<SourceBuff er> native "SourceBufferList" {
18695 17400
18696 @DomName('SourceBufferList.length') 17401 @DomName('SourceBufferList.length')
18697 @DocsEditable 17402 @DocsEditable
18698 int get length => JS("int", "#.length", this); 17403 int get length => JS("int", "#.length", this);
18699 17404
18700 SourceBuffer operator[](int index) => JS("SourceBuffer", "#[#]", this, index); 17405 SourceBuffer operator[](int index) => JS("SourceBuffer", "#[#]", this, index);
18701 17406
18702 void operator[]=(int index, SourceBuffer value) { 17407 void operator[]=(int index, SourceBuffer value) {
18703 throw new UnsupportedError("Cannot assign element of immutable List."); 17408 throw new UnsupportedError("Cannot assign element of immutable List.");
18704 } 17409 }
18705 // -- start List<SourceBuffer> mixins. 17410 // -- start List<SourceBuffer> mixins.
18706 // SourceBuffer is the element type. 17411 // SourceBuffer is the element type.
18707 17412
18708 // From Iterable<SourceBuffer>:
18709 17413
18710 Iterator<SourceBuffer> get iterator {
18711 // Note: NodeLists are not fixed size. And most probably length shouldn't
18712 // be cached in both iterator _and_ forEach method. For now caching it
18713 // for consistency.
18714 return new FixedSizeListIterator<SourceBuffer>(this);
18715 }
18716
18717 SourceBuffer reduce(SourceBuffer combine(SourceBuffer value, SourceBuffer elem ent)) {
18718 return IterableMixinWorkaround.reduce(this, combine);
18719 }
18720
18721 dynamic fold(dynamic initialValue,
18722 dynamic combine(dynamic previousValue, SourceBuffer element)) {
18723 return IterableMixinWorkaround.fold(this, initialValue, combine);
18724 }
18725
18726 bool contains(SourceBuffer element) => IterableMixinWorkaround.contains(this, element);
18727
18728 void forEach(void f(SourceBuffer element)) => IterableMixinWorkaround.forEach( this, f);
18729
18730 String join([String separator = ""]) =>
18731 IterableMixinWorkaround.joinList(this, separator);
18732
18733 Iterable map(f(SourceBuffer element)) =>
18734 IterableMixinWorkaround.mapList(this, f);
18735
18736 Iterable<SourceBuffer> where(bool f(SourceBuffer element)) =>
18737 IterableMixinWorkaround.where(this, f);
18738
18739 Iterable expand(Iterable f(SourceBuffer element)) =>
18740 IterableMixinWorkaround.expand(this, f);
18741
18742 bool every(bool f(SourceBuffer element)) => IterableMixinWorkaround.every(this , f);
18743
18744 bool any(bool f(SourceBuffer element)) => IterableMixinWorkaround.any(this, f) ;
18745
18746 List<SourceBuffer> toList({ bool growable: true }) =>
18747 new List<SourceBuffer>.from(this, growable: growable);
18748
18749 Set<SourceBuffer> toSet() => new Set<SourceBuffer>.from(this);
18750
18751 bool get isEmpty => this.length == 0;
18752
18753 Iterable<SourceBuffer> take(int n) => IterableMixinWorkaround.takeList(this, n );
18754
18755 Iterable<SourceBuffer> takeWhile(bool test(SourceBuffer value)) {
18756 return IterableMixinWorkaround.takeWhile(this, test);
18757 }
18758
18759 Iterable<SourceBuffer> skip(int n) => IterableMixinWorkaround.skipList(this, n );
18760
18761 Iterable<SourceBuffer> skipWhile(bool test(SourceBuffer value)) {
18762 return IterableMixinWorkaround.skipWhile(this, test);
18763 }
18764
18765 SourceBuffer firstWhere(bool test(SourceBuffer value), { SourceBuffer orElse() }) {
18766 return IterableMixinWorkaround.firstWhere(this, test, orElse);
18767 }
18768
18769 SourceBuffer lastWhere(bool test(SourceBuffer value), {SourceBuffer orElse()}) {
18770 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
18771 }
18772
18773 SourceBuffer singleWhere(bool test(SourceBuffer value)) {
18774 return IterableMixinWorkaround.singleWhere(this, test);
18775 }
18776
18777 SourceBuffer elementAt(int index) {
18778 return this[index];
18779 }
18780
18781 // From Collection<SourceBuffer>:
18782
18783 void add(SourceBuffer value) {
18784 throw new UnsupportedError("Cannot add to immutable List.");
18785 }
18786
18787 void addAll(Iterable<SourceBuffer> iterable) {
18788 throw new UnsupportedError("Cannot add to immutable List.");
18789 }
18790
18791 // From List<SourceBuffer>:
18792 void set length(int value) { 17414 void set length(int value) {
18793 throw new UnsupportedError("Cannot resize immutable List."); 17415 throw new UnsupportedError("Cannot resize immutable List.");
18794 } 17416 }
18795 17417
18796 void clear() {
18797 throw new UnsupportedError("Cannot clear immutable List.");
18798 }
18799
18800 Iterable<SourceBuffer> get reversed {
18801 return IterableMixinWorkaround.reversedList(this);
18802 }
18803
18804 void sort([int compare(SourceBuffer a, SourceBuffer b)]) {
18805 throw new UnsupportedError("Cannot sort immutable List.");
18806 }
18807
18808 int indexOf(SourceBuffer element, [int start = 0]) =>
18809 Lists.indexOf(this, element, start, this.length);
18810
18811 int lastIndexOf(SourceBuffer element, [int start]) {
18812 if (start == null) start = length - 1;
18813 return Lists.lastIndexOf(this, element, start);
18814 }
18815
18816 SourceBuffer get first {
18817 if (this.length > 0) return this[0];
18818 throw new StateError("No elements");
18819 }
18820
18821 SourceBuffer get last {
18822 if (this.length > 0) return this[this.length - 1];
18823 throw new StateError("No elements");
18824 }
18825
18826 SourceBuffer get single {
18827 if (length == 1) return this[0];
18828 if (length == 0) throw new StateError("No elements");
18829 throw new StateError("More than one element");
18830 }
18831
18832 void insert(int index, SourceBuffer element) {
18833 throw new UnsupportedError("Cannot add to immutable List.");
18834 }
18835
18836 void insertAll(int index, Iterable<SourceBuffer> iterable) {
18837 throw new UnsupportedError("Cannot add to immutable List.");
18838 }
18839
18840 void setAll(int index, Iterable<SourceBuffer> iterable) {
18841 throw new UnsupportedError("Cannot modify an immutable List.");
18842 }
18843
18844 SourceBuffer removeAt(int pos) {
18845 throw new UnsupportedError("Cannot remove from immutable List.");
18846 }
18847
18848 SourceBuffer removeLast() {
18849 throw new UnsupportedError("Cannot remove from immutable List.");
18850 }
18851
18852 bool remove(Object object) {
18853 throw new UnsupportedError("Cannot remove from immutable List.");
18854 }
18855
18856 void removeWhere(bool test(SourceBuffer element)) {
18857 throw new UnsupportedError("Cannot remove from immutable List.");
18858 }
18859
18860 void retainWhere(bool test(SourceBuffer element)) {
18861 throw new UnsupportedError("Cannot remove from immutable List.");
18862 }
18863
18864 void setRange(int start, int end, Iterable<SourceBuffer> iterable, [int skipCo unt=0]) {
18865 throw new UnsupportedError("Cannot setRange on immutable List.");
18866 }
18867
18868 void removeRange(int start, int end) {
18869 throw new UnsupportedError("Cannot removeRange on immutable List.");
18870 }
18871
18872 void replaceRange(int start, int end, Iterable<SourceBuffer> iterable) {
18873 throw new UnsupportedError("Cannot modify an immutable List.");
18874 }
18875
18876 void fillRange(int start, int end, [SourceBuffer fillValue]) {
18877 throw new UnsupportedError("Cannot modify an immutable List.");
18878 }
18879
18880 Iterable<SourceBuffer> getRange(int start, int end) =>
18881 IterableMixinWorkaround.getRangeList(this, start, end);
18882
18883 List<SourceBuffer> sublist(int start, [int end]) {
18884 if (end == null) end = length;
18885 return Lists.getRange(this, start, end, <SourceBuffer>[]);
18886 }
18887
18888 Map<int, SourceBuffer> asMap() =>
18889 IterableMixinWorkaround.asMapList(this);
18890
18891 String toString() {
18892 StringBuffer buffer = new StringBuffer('[');
18893 buffer.writeAll(this, ', ');
18894 buffer.write(']');
18895 return buffer.toString();
18896 }
18897
18898 // -- end List<SourceBuffer> mixins. 17418 // -- end List<SourceBuffer> mixins.
18899 17419
18900 @JSName('addEventListener') 17420 @JSName('addEventListener')
18901 @DomName('SourceBufferList.addEventListener') 17421 @DomName('SourceBufferList.addEventListener')
18902 @DocsEditable 17422 @DocsEditable
18903 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 17423 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
18904 17424
18905 @DomName('SourceBufferList.dispatchEvent') 17425 @DomName('SourceBufferList.dispatchEvent')
18906 @DocsEditable 17426 @DocsEditable
18907 bool dispatchEvent(Event event) native; 17427 bool dispatchEvent(Event event) native;
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
18977 @DocsEditable 17497 @DocsEditable
18978 num weight; 17498 num weight;
18979 } 17499 }
18980 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 17500 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
18981 // for details. All rights reserved. Use of this source code is governed by a 17501 // for details. All rights reserved. Use of this source code is governed by a
18982 // BSD-style license that can be found in the LICENSE file. 17502 // BSD-style license that can be found in the LICENSE file.
18983 17503
18984 17504
18985 @DocsEditable 17505 @DocsEditable
18986 @DomName('SpeechGrammarList') 17506 @DomName('SpeechGrammarList')
18987 class SpeechGrammarList implements JavaScriptIndexingBehavior, List<SpeechGramma r> native "SpeechGrammarList" { 17507 class SpeechGrammarList extends Object with ListMixin<SpeechGrammar>, ImmutableL istMixin<SpeechGrammar> implements JavaScriptIndexingBehavior, List<SpeechGramma r> native "SpeechGrammarList" {
18988 17508
18989 @DomName('SpeechGrammarList.SpeechGrammarList') 17509 @DomName('SpeechGrammarList.SpeechGrammarList')
18990 @DocsEditable 17510 @DocsEditable
18991 factory SpeechGrammarList() { 17511 factory SpeechGrammarList() {
18992 return SpeechGrammarList._create_1(); 17512 return SpeechGrammarList._create_1();
18993 } 17513 }
18994 static SpeechGrammarList _create_1() => JS('SpeechGrammarList', 'new SpeechGra mmarList()'); 17514 static SpeechGrammarList _create_1() => JS('SpeechGrammarList', 'new SpeechGra mmarList()');
18995 17515
18996 @DomName('SpeechGrammarList.length') 17516 @DomName('SpeechGrammarList.length')
18997 @DocsEditable 17517 @DocsEditable
18998 int get length => JS("int", "#.length", this); 17518 int get length => JS("int", "#.length", this);
18999 17519
19000 SpeechGrammar operator[](int index) => JS("SpeechGrammar", "#[#]", this, index ); 17520 SpeechGrammar operator[](int index) => JS("SpeechGrammar", "#[#]", this, index );
19001 17521
19002 void operator[]=(int index, SpeechGrammar value) { 17522 void operator[]=(int index, SpeechGrammar value) {
19003 throw new UnsupportedError("Cannot assign element of immutable List."); 17523 throw new UnsupportedError("Cannot assign element of immutable List.");
19004 } 17524 }
19005 // -- start List<SpeechGrammar> mixins. 17525 // -- start List<SpeechGrammar> mixins.
19006 // SpeechGrammar is the element type. 17526 // SpeechGrammar is the element type.
19007 17527
19008 // From Iterable<SpeechGrammar>:
19009 17528
19010 Iterator<SpeechGrammar> get iterator {
19011 // Note: NodeLists are not fixed size. And most probably length shouldn't
19012 // be cached in both iterator _and_ forEach method. For now caching it
19013 // for consistency.
19014 return new FixedSizeListIterator<SpeechGrammar>(this);
19015 }
19016
19017 SpeechGrammar reduce(SpeechGrammar combine(SpeechGrammar value, SpeechGrammar element)) {
19018 return IterableMixinWorkaround.reduce(this, combine);
19019 }
19020
19021 dynamic fold(dynamic initialValue,
19022 dynamic combine(dynamic previousValue, SpeechGrammar element)) {
19023 return IterableMixinWorkaround.fold(this, initialValue, combine);
19024 }
19025
19026 bool contains(SpeechGrammar element) => IterableMixinWorkaround.contains(this, element);
19027
19028 void forEach(void f(SpeechGrammar element)) => IterableMixinWorkaround.forEach (this, f);
19029
19030 String join([String separator = ""]) =>
19031 IterableMixinWorkaround.joinList(this, separator);
19032
19033 Iterable map(f(SpeechGrammar element)) =>
19034 IterableMixinWorkaround.mapList(this, f);
19035
19036 Iterable<SpeechGrammar> where(bool f(SpeechGrammar element)) =>
19037 IterableMixinWorkaround.where(this, f);
19038
19039 Iterable expand(Iterable f(SpeechGrammar element)) =>
19040 IterableMixinWorkaround.expand(this, f);
19041
19042 bool every(bool f(SpeechGrammar element)) => IterableMixinWorkaround.every(thi s, f);
19043
19044 bool any(bool f(SpeechGrammar element)) => IterableMixinWorkaround.any(this, f );
19045
19046 List<SpeechGrammar> toList({ bool growable: true }) =>
19047 new List<SpeechGrammar>.from(this, growable: growable);
19048
19049 Set<SpeechGrammar> toSet() => new Set<SpeechGrammar>.from(this);
19050
19051 bool get isEmpty => this.length == 0;
19052
19053 Iterable<SpeechGrammar> take(int n) => IterableMixinWorkaround.takeList(this, n);
19054
19055 Iterable<SpeechGrammar> takeWhile(bool test(SpeechGrammar value)) {
19056 return IterableMixinWorkaround.takeWhile(this, test);
19057 }
19058
19059 Iterable<SpeechGrammar> skip(int n) => IterableMixinWorkaround.skipList(this, n);
19060
19061 Iterable<SpeechGrammar> skipWhile(bool test(SpeechGrammar value)) {
19062 return IterableMixinWorkaround.skipWhile(this, test);
19063 }
19064
19065 SpeechGrammar firstWhere(bool test(SpeechGrammar value), { SpeechGrammar orEls e() }) {
19066 return IterableMixinWorkaround.firstWhere(this, test, orElse);
19067 }
19068
19069 SpeechGrammar lastWhere(bool test(SpeechGrammar value), {SpeechGrammar orElse( )}) {
19070 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
19071 }
19072
19073 SpeechGrammar singleWhere(bool test(SpeechGrammar value)) {
19074 return IterableMixinWorkaround.singleWhere(this, test);
19075 }
19076
19077 SpeechGrammar elementAt(int index) {
19078 return this[index];
19079 }
19080
19081 // From Collection<SpeechGrammar>:
19082
19083 void add(SpeechGrammar value) {
19084 throw new UnsupportedError("Cannot add to immutable List.");
19085 }
19086
19087 void addAll(Iterable<SpeechGrammar> iterable) {
19088 throw new UnsupportedError("Cannot add to immutable List.");
19089 }
19090
19091 // From List<SpeechGrammar>:
19092 void set length(int value) { 17529 void set length(int value) {
19093 throw new UnsupportedError("Cannot resize immutable List."); 17530 throw new UnsupportedError("Cannot resize immutable List.");
19094 } 17531 }
19095 17532
19096 void clear() {
19097 throw new UnsupportedError("Cannot clear immutable List.");
19098 }
19099
19100 Iterable<SpeechGrammar> get reversed {
19101 return IterableMixinWorkaround.reversedList(this);
19102 }
19103
19104 void sort([int compare(SpeechGrammar a, SpeechGrammar b)]) {
19105 throw new UnsupportedError("Cannot sort immutable List.");
19106 }
19107
19108 int indexOf(SpeechGrammar element, [int start = 0]) =>
19109 Lists.indexOf(this, element, start, this.length);
19110
19111 int lastIndexOf(SpeechGrammar element, [int start]) {
19112 if (start == null) start = length - 1;
19113 return Lists.lastIndexOf(this, element, start);
19114 }
19115
19116 SpeechGrammar get first {
19117 if (this.length > 0) return this[0];
19118 throw new StateError("No elements");
19119 }
19120
19121 SpeechGrammar get last {
19122 if (this.length > 0) return this[this.length - 1];
19123 throw new StateError("No elements");
19124 }
19125
19126 SpeechGrammar get single {
19127 if (length == 1) return this[0];
19128 if (length == 0) throw new StateError("No elements");
19129 throw new StateError("More than one element");
19130 }
19131
19132 void insert(int index, SpeechGrammar element) {
19133 throw new UnsupportedError("Cannot add to immutable List.");
19134 }
19135
19136 void insertAll(int index, Iterable<SpeechGrammar> iterable) {
19137 throw new UnsupportedError("Cannot add to immutable List.");
19138 }
19139
19140 void setAll(int index, Iterable<SpeechGrammar> iterable) {
19141 throw new UnsupportedError("Cannot modify an immutable List.");
19142 }
19143
19144 SpeechGrammar removeAt(int pos) {
19145 throw new UnsupportedError("Cannot remove from immutable List.");
19146 }
19147
19148 SpeechGrammar removeLast() {
19149 throw new UnsupportedError("Cannot remove from immutable List.");
19150 }
19151
19152 bool remove(Object object) {
19153 throw new UnsupportedError("Cannot remove from immutable List.");
19154 }
19155
19156 void removeWhere(bool test(SpeechGrammar element)) {
19157 throw new UnsupportedError("Cannot remove from immutable List.");
19158 }
19159
19160 void retainWhere(bool test(SpeechGrammar element)) {
19161 throw new UnsupportedError("Cannot remove from immutable List.");
19162 }
19163
19164 void setRange(int start, int end, Iterable<SpeechGrammar> iterable, [int skipC ount=0]) {
19165 throw new UnsupportedError("Cannot setRange on immutable List.");
19166 }
19167
19168 void removeRange(int start, int end) {
19169 throw new UnsupportedError("Cannot removeRange on immutable List.");
19170 }
19171
19172 void replaceRange(int start, int end, Iterable<SpeechGrammar> iterable) {
19173 throw new UnsupportedError("Cannot modify an immutable List.");
19174 }
19175
19176 void fillRange(int start, int end, [SpeechGrammar fillValue]) {
19177 throw new UnsupportedError("Cannot modify an immutable List.");
19178 }
19179
19180 Iterable<SpeechGrammar> getRange(int start, int end) =>
19181 IterableMixinWorkaround.getRangeList(this, start, end);
19182
19183 List<SpeechGrammar> sublist(int start, [int end]) {
19184 if (end == null) end = length;
19185 return Lists.getRange(this, start, end, <SpeechGrammar>[]);
19186 }
19187
19188 Map<int, SpeechGrammar> asMap() =>
19189 IterableMixinWorkaround.asMapList(this);
19190
19191 String toString() {
19192 StringBuffer buffer = new StringBuffer('[');
19193 buffer.writeAll(this, ', ');
19194 buffer.write(']');
19195 return buffer.toString();
19196 }
19197
19198 // -- end List<SpeechGrammar> mixins. 17533 // -- end List<SpeechGrammar> mixins.
19199 17534
19200 @DomName('SpeechGrammarList.addFromString') 17535 @DomName('SpeechGrammarList.addFromString')
19201 @DocsEditable 17536 @DocsEditable
19202 void addFromString(String string, [num weight]) native; 17537 void addFromString(String string, [num weight]) native;
19203 17538
19204 @DomName('SpeechGrammarList.addFromUri') 17539 @DomName('SpeechGrammarList.addFromUri')
19205 @DocsEditable 17540 @DocsEditable
19206 void addFromUri(String src, [num weight]) native; 17541 void addFromUri(String src, [num weight]) native;
19207 17542
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
20451 @DocsEditable 18786 @DocsEditable
20452 Stream<Event> get onExit => exitEvent.forTarget(this); 18787 Stream<Event> get onExit => exitEvent.forTarget(this);
20453 } 18788 }
20454 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 18789 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
20455 // for details. All rights reserved. Use of this source code is governed by a 18790 // for details. All rights reserved. Use of this source code is governed by a
20456 // BSD-style license that can be found in the LICENSE file. 18791 // BSD-style license that can be found in the LICENSE file.
20457 18792
20458 18793
20459 @DocsEditable 18794 @DocsEditable
20460 @DomName('TextTrackCueList') 18795 @DomName('TextTrackCueList')
20461 class TextTrackCueList implements List<TextTrackCue>, JavaScriptIndexingBehavior native "TextTrackCueList" { 18796 class TextTrackCueList extends Object with ListMixin<TextTrackCue>, ImmutableLis tMixin<TextTrackCue> implements List<TextTrackCue>, JavaScriptIndexingBehavior n ative "TextTrackCueList" {
20462 18797
20463 @DomName('TextTrackCueList.length') 18798 @DomName('TextTrackCueList.length')
20464 @DocsEditable 18799 @DocsEditable
20465 int get length => JS("int", "#.length", this); 18800 int get length => JS("int", "#.length", this);
20466 18801
20467 TextTrackCue operator[](int index) => JS("TextTrackCue", "#[#]", this, index); 18802 TextTrackCue operator[](int index) => JS("TextTrackCue", "#[#]", this, index);
20468 18803
20469 void operator[]=(int index, TextTrackCue value) { 18804 void operator[]=(int index, TextTrackCue value) {
20470 throw new UnsupportedError("Cannot assign element of immutable List."); 18805 throw new UnsupportedError("Cannot assign element of immutable List.");
20471 } 18806 }
20472 // -- start List<TextTrackCue> mixins. 18807 // -- start List<TextTrackCue> mixins.
20473 // TextTrackCue is the element type. 18808 // TextTrackCue is the element type.
20474 18809
20475 // From Iterable<TextTrackCue>:
20476 18810
20477 Iterator<TextTrackCue> get iterator {
20478 // Note: NodeLists are not fixed size. And most probably length shouldn't
20479 // be cached in both iterator _and_ forEach method. For now caching it
20480 // for consistency.
20481 return new FixedSizeListIterator<TextTrackCue>(this);
20482 }
20483
20484 TextTrackCue reduce(TextTrackCue combine(TextTrackCue value, TextTrackCue elem ent)) {
20485 return IterableMixinWorkaround.reduce(this, combine);
20486 }
20487
20488 dynamic fold(dynamic initialValue,
20489 dynamic combine(dynamic previousValue, TextTrackCue element)) {
20490 return IterableMixinWorkaround.fold(this, initialValue, combine);
20491 }
20492
20493 bool contains(TextTrackCue element) => IterableMixinWorkaround.contains(this, element);
20494
20495 void forEach(void f(TextTrackCue element)) => IterableMixinWorkaround.forEach( this, f);
20496
20497 String join([String separator = ""]) =>
20498 IterableMixinWorkaround.joinList(this, separator);
20499
20500 Iterable map(f(TextTrackCue element)) =>
20501 IterableMixinWorkaround.mapList(this, f);
20502
20503 Iterable<TextTrackCue> where(bool f(TextTrackCue element)) =>
20504 IterableMixinWorkaround.where(this, f);
20505
20506 Iterable expand(Iterable f(TextTrackCue element)) =>
20507 IterableMixinWorkaround.expand(this, f);
20508
20509 bool every(bool f(TextTrackCue element)) => IterableMixinWorkaround.every(this , f);
20510
20511 bool any(bool f(TextTrackCue element)) => IterableMixinWorkaround.any(this, f) ;
20512
20513 List<TextTrackCue> toList({ bool growable: true }) =>
20514 new List<TextTrackCue>.from(this, growable: growable);
20515
20516 Set<TextTrackCue> toSet() => new Set<TextTrackCue>.from(this);
20517
20518 bool get isEmpty => this.length == 0;
20519
20520 Iterable<TextTrackCue> take(int n) => IterableMixinWorkaround.takeList(this, n );
20521
20522 Iterable<TextTrackCue> takeWhile(bool test(TextTrackCue value)) {
20523 return IterableMixinWorkaround.takeWhile(this, test);
20524 }
20525
20526 Iterable<TextTrackCue> skip(int n) => IterableMixinWorkaround.skipList(this, n );
20527
20528 Iterable<TextTrackCue> skipWhile(bool test(TextTrackCue value)) {
20529 return IterableMixinWorkaround.skipWhile(this, test);
20530 }
20531
20532 TextTrackCue firstWhere(bool test(TextTrackCue value), { TextTrackCue orElse() }) {
20533 return IterableMixinWorkaround.firstWhere(this, test, orElse);
20534 }
20535
20536 TextTrackCue lastWhere(bool test(TextTrackCue value), {TextTrackCue orElse()}) {
20537 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
20538 }
20539
20540 TextTrackCue singleWhere(bool test(TextTrackCue value)) {
20541 return IterableMixinWorkaround.singleWhere(this, test);
20542 }
20543
20544 TextTrackCue elementAt(int index) {
20545 return this[index];
20546 }
20547
20548 // From Collection<TextTrackCue>:
20549
20550 void add(TextTrackCue value) {
20551 throw new UnsupportedError("Cannot add to immutable List.");
20552 }
20553
20554 void addAll(Iterable<TextTrackCue> iterable) {
20555 throw new UnsupportedError("Cannot add to immutable List.");
20556 }
20557
20558 // From List<TextTrackCue>:
20559 void set length(int value) { 18811 void set length(int value) {
20560 throw new UnsupportedError("Cannot resize immutable List."); 18812 throw new UnsupportedError("Cannot resize immutable List.");
20561 } 18813 }
20562 18814
20563 void clear() {
20564 throw new UnsupportedError("Cannot clear immutable List.");
20565 }
20566
20567 Iterable<TextTrackCue> get reversed {
20568 return IterableMixinWorkaround.reversedList(this);
20569 }
20570
20571 void sort([int compare(TextTrackCue a, TextTrackCue b)]) {
20572 throw new UnsupportedError("Cannot sort immutable List.");
20573 }
20574
20575 int indexOf(TextTrackCue element, [int start = 0]) =>
20576 Lists.indexOf(this, element, start, this.length);
20577
20578 int lastIndexOf(TextTrackCue element, [int start]) {
20579 if (start == null) start = length - 1;
20580 return Lists.lastIndexOf(this, element, start);
20581 }
20582
20583 TextTrackCue get first {
20584 if (this.length > 0) return this[0];
20585 throw new StateError("No elements");
20586 }
20587
20588 TextTrackCue get last {
20589 if (this.length > 0) return this[this.length - 1];
20590 throw new StateError("No elements");
20591 }
20592
20593 TextTrackCue get single {
20594 if (length == 1) return this[0];
20595 if (length == 0) throw new StateError("No elements");
20596 throw new StateError("More than one element");
20597 }
20598
20599 void insert(int index, TextTrackCue element) {
20600 throw new UnsupportedError("Cannot add to immutable List.");
20601 }
20602
20603 void insertAll(int index, Iterable<TextTrackCue> iterable) {
20604 throw new UnsupportedError("Cannot add to immutable List.");
20605 }
20606
20607 void setAll(int index, Iterable<TextTrackCue> iterable) {
20608 throw new UnsupportedError("Cannot modify an immutable List.");
20609 }
20610
20611 TextTrackCue removeAt(int pos) {
20612 throw new UnsupportedError("Cannot remove from immutable List.");
20613 }
20614
20615 TextTrackCue removeLast() {
20616 throw new UnsupportedError("Cannot remove from immutable List.");
20617 }
20618
20619 bool remove(Object object) {
20620 throw new UnsupportedError("Cannot remove from immutable List.");
20621 }
20622
20623 void removeWhere(bool test(TextTrackCue element)) {
20624 throw new UnsupportedError("Cannot remove from immutable List.");
20625 }
20626
20627 void retainWhere(bool test(TextTrackCue element)) {
20628 throw new UnsupportedError("Cannot remove from immutable List.");
20629 }
20630
20631 void setRange(int start, int end, Iterable<TextTrackCue> iterable, [int skipCo unt=0]) {
20632 throw new UnsupportedError("Cannot setRange on immutable List.");
20633 }
20634
20635 void removeRange(int start, int end) {
20636 throw new UnsupportedError("Cannot removeRange on immutable List.");
20637 }
20638
20639 void replaceRange(int start, int end, Iterable<TextTrackCue> iterable) {
20640 throw new UnsupportedError("Cannot modify an immutable List.");
20641 }
20642
20643 void fillRange(int start, int end, [TextTrackCue fillValue]) {
20644 throw new UnsupportedError("Cannot modify an immutable List.");
20645 }
20646
20647 Iterable<TextTrackCue> getRange(int start, int end) =>
20648 IterableMixinWorkaround.getRangeList(this, start, end);
20649
20650 List<TextTrackCue> sublist(int start, [int end]) {
20651 if (end == null) end = length;
20652 return Lists.getRange(this, start, end, <TextTrackCue>[]);
20653 }
20654
20655 Map<int, TextTrackCue> asMap() =>
20656 IterableMixinWorkaround.asMapList(this);
20657
20658 String toString() {
20659 StringBuffer buffer = new StringBuffer('[');
20660 buffer.writeAll(this, ', ');
20661 buffer.write(']');
20662 return buffer.toString();
20663 }
20664
20665 // -- end List<TextTrackCue> mixins. 18815 // -- end List<TextTrackCue> mixins.
20666 18816
20667 @DomName('TextTrackCueList.getCueById') 18817 @DomName('TextTrackCueList.getCueById')
20668 @DocsEditable 18818 @DocsEditable
20669 TextTrackCue getCueById(String id) native; 18819 TextTrackCue getCueById(String id) native;
20670 18820
20671 @DomName('TextTrackCueList.item') 18821 @DomName('TextTrackCueList.item')
20672 @DocsEditable 18822 @DocsEditable
20673 TextTrackCue item(int index) native; 18823 TextTrackCue item(int index) native;
20674 } 18824 }
20675 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 18825 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
20676 // for details. All rights reserved. Use of this source code is governed by a 18826 // for details. All rights reserved. Use of this source code is governed by a
20677 // BSD-style license that can be found in the LICENSE file. 18827 // BSD-style license that can be found in the LICENSE file.
20678 18828
20679 18829
20680 @DocsEditable 18830 @DocsEditable
20681 @DomName('TextTrackList') 18831 @DomName('TextTrackList')
20682 class TextTrackList extends EventTarget implements JavaScriptIndexingBehavior, L ist<TextTrack> native "TextTrackList" { 18832 class TextTrackList extends EventTarget with ListMixin<TextTrack>, ImmutableList Mixin<TextTrack> implements JavaScriptIndexingBehavior, List<TextTrack> native " TextTrackList" {
20683 18833
20684 @DomName('TextTrackList.addtrackEvent') 18834 @DomName('TextTrackList.addtrackEvent')
20685 @DocsEditable 18835 @DocsEditable
20686 static const EventStreamProvider<TrackEvent> addTrackEvent = const EventStream Provider<TrackEvent>('addtrack'); 18836 static const EventStreamProvider<TrackEvent> addTrackEvent = const EventStream Provider<TrackEvent>('addtrack');
20687 18837
20688 @DomName('TextTrackList.length') 18838 @DomName('TextTrackList.length')
20689 @DocsEditable 18839 @DocsEditable
20690 int get length => JS("int", "#.length", this); 18840 int get length => JS("int", "#.length", this);
20691 18841
20692 TextTrack operator[](int index) => JS("TextTrack", "#[#]", this, index); 18842 TextTrack operator[](int index) => JS("TextTrack", "#[#]", this, index);
20693 18843
20694 void operator[]=(int index, TextTrack value) { 18844 void operator[]=(int index, TextTrack value) {
20695 throw new UnsupportedError("Cannot assign element of immutable List."); 18845 throw new UnsupportedError("Cannot assign element of immutable List.");
20696 } 18846 }
20697 // -- start List<TextTrack> mixins. 18847 // -- start List<TextTrack> mixins.
20698 // TextTrack is the element type. 18848 // TextTrack is the element type.
20699 18849
20700 // From Iterable<TextTrack>:
20701 18850
20702 Iterator<TextTrack> get iterator {
20703 // Note: NodeLists are not fixed size. And most probably length shouldn't
20704 // be cached in both iterator _and_ forEach method. For now caching it
20705 // for consistency.
20706 return new FixedSizeListIterator<TextTrack>(this);
20707 }
20708
20709 TextTrack reduce(TextTrack combine(TextTrack value, TextTrack element)) {
20710 return IterableMixinWorkaround.reduce(this, combine);
20711 }
20712
20713 dynamic fold(dynamic initialValue,
20714 dynamic combine(dynamic previousValue, TextTrack element)) {
20715 return IterableMixinWorkaround.fold(this, initialValue, combine);
20716 }
20717
20718 bool contains(TextTrack element) => IterableMixinWorkaround.contains(this, ele ment);
20719
20720 void forEach(void f(TextTrack element)) => IterableMixinWorkaround.forEach(thi s, f);
20721
20722 String join([String separator = ""]) =>
20723 IterableMixinWorkaround.joinList(this, separator);
20724
20725 Iterable map(f(TextTrack element)) =>
20726 IterableMixinWorkaround.mapList(this, f);
20727
20728 Iterable<TextTrack> where(bool f(TextTrack element)) =>
20729 IterableMixinWorkaround.where(this, f);
20730
20731 Iterable expand(Iterable f(TextTrack element)) =>
20732 IterableMixinWorkaround.expand(this, f);
20733
20734 bool every(bool f(TextTrack element)) => IterableMixinWorkaround.every(this, f );
20735
20736 bool any(bool f(TextTrack element)) => IterableMixinWorkaround.any(this, f);
20737
20738 List<TextTrack> toList({ bool growable: true }) =>
20739 new List<TextTrack>.from(this, growable: growable);
20740
20741 Set<TextTrack> toSet() => new Set<TextTrack>.from(this);
20742
20743 bool get isEmpty => this.length == 0;
20744
20745 Iterable<TextTrack> take(int n) => IterableMixinWorkaround.takeList(this, n);
20746
20747 Iterable<TextTrack> takeWhile(bool test(TextTrack value)) {
20748 return IterableMixinWorkaround.takeWhile(this, test);
20749 }
20750
20751 Iterable<TextTrack> skip(int n) => IterableMixinWorkaround.skipList(this, n);
20752
20753 Iterable<TextTrack> skipWhile(bool test(TextTrack value)) {
20754 return IterableMixinWorkaround.skipWhile(this, test);
20755 }
20756
20757 TextTrack firstWhere(bool test(TextTrack value), { TextTrack orElse() }) {
20758 return IterableMixinWorkaround.firstWhere(this, test, orElse);
20759 }
20760
20761 TextTrack lastWhere(bool test(TextTrack value), {TextTrack orElse()}) {
20762 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
20763 }
20764
20765 TextTrack singleWhere(bool test(TextTrack value)) {
20766 return IterableMixinWorkaround.singleWhere(this, test);
20767 }
20768
20769 TextTrack elementAt(int index) {
20770 return this[index];
20771 }
20772
20773 // From Collection<TextTrack>:
20774
20775 void add(TextTrack value) {
20776 throw new UnsupportedError("Cannot add to immutable List.");
20777 }
20778
20779 void addAll(Iterable<TextTrack> iterable) {
20780 throw new UnsupportedError("Cannot add to immutable List.");
20781 }
20782
20783 // From List<TextTrack>:
20784 void set length(int value) { 18851 void set length(int value) {
20785 throw new UnsupportedError("Cannot resize immutable List."); 18852 throw new UnsupportedError("Cannot resize immutable List.");
20786 } 18853 }
20787 18854
20788 void clear() {
20789 throw new UnsupportedError("Cannot clear immutable List.");
20790 }
20791
20792 Iterable<TextTrack> get reversed {
20793 return IterableMixinWorkaround.reversedList(this);
20794 }
20795
20796 void sort([int compare(TextTrack a, TextTrack b)]) {
20797 throw new UnsupportedError("Cannot sort immutable List.");
20798 }
20799
20800 int indexOf(TextTrack element, [int start = 0]) =>
20801 Lists.indexOf(this, element, start, this.length);
20802
20803 int lastIndexOf(TextTrack element, [int start]) {
20804 if (start == null) start = length - 1;
20805 return Lists.lastIndexOf(this, element, start);
20806 }
20807
20808 TextTrack get first {
20809 if (this.length > 0) return this[0];
20810 throw new StateError("No elements");
20811 }
20812
20813 TextTrack get last {
20814 if (this.length > 0) return this[this.length - 1];
20815 throw new StateError("No elements");
20816 }
20817
20818 TextTrack get single {
20819 if (length == 1) return this[0];
20820 if (length == 0) throw new StateError("No elements");
20821 throw new StateError("More than one element");
20822 }
20823
20824 void insert(int index, TextTrack element) {
20825 throw new UnsupportedError("Cannot add to immutable List.");
20826 }
20827
20828 void insertAll(int index, Iterable<TextTrack> iterable) {
20829 throw new UnsupportedError("Cannot add to immutable List.");
20830 }
20831
20832 void setAll(int index, Iterable<TextTrack> iterable) {
20833 throw new UnsupportedError("Cannot modify an immutable List.");
20834 }
20835
20836 TextTrack removeAt(int pos) {
20837 throw new UnsupportedError("Cannot remove from immutable List.");
20838 }
20839
20840 TextTrack removeLast() {
20841 throw new UnsupportedError("Cannot remove from immutable List.");
20842 }
20843
20844 bool remove(Object object) {
20845 throw new UnsupportedError("Cannot remove from immutable List.");
20846 }
20847
20848 void removeWhere(bool test(TextTrack element)) {
20849 throw new UnsupportedError("Cannot remove from immutable List.");
20850 }
20851
20852 void retainWhere(bool test(TextTrack element)) {
20853 throw new UnsupportedError("Cannot remove from immutable List.");
20854 }
20855
20856 void setRange(int start, int end, Iterable<TextTrack> iterable, [int skipCount =0]) {
20857 throw new UnsupportedError("Cannot setRange on immutable List.");
20858 }
20859
20860 void removeRange(int start, int end) {
20861 throw new UnsupportedError("Cannot removeRange on immutable List.");
20862 }
20863
20864 void replaceRange(int start, int end, Iterable<TextTrack> iterable) {
20865 throw new UnsupportedError("Cannot modify an immutable List.");
20866 }
20867
20868 void fillRange(int start, int end, [TextTrack fillValue]) {
20869 throw new UnsupportedError("Cannot modify an immutable List.");
20870 }
20871
20872 Iterable<TextTrack> getRange(int start, int end) =>
20873 IterableMixinWorkaround.getRangeList(this, start, end);
20874
20875 List<TextTrack> sublist(int start, [int end]) {
20876 if (end == null) end = length;
20877 return Lists.getRange(this, start, end, <TextTrack>[]);
20878 }
20879
20880 Map<int, TextTrack> asMap() =>
20881 IterableMixinWorkaround.asMapList(this);
20882
20883 String toString() {
20884 StringBuffer buffer = new StringBuffer('[');
20885 buffer.writeAll(this, ', ');
20886 buffer.write(']');
20887 return buffer.toString();
20888 }
20889
20890 // -- end List<TextTrack> mixins. 18855 // -- end List<TextTrack> mixins.
20891 18856
20892 @JSName('addEventListener') 18857 @JSName('addEventListener')
20893 @DomName('TextTrackList.addEventListener') 18858 @DomName('TextTrackList.addEventListener')
20894 @DocsEditable 18859 @DocsEditable
20895 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 18860 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
20896 18861
20897 @DomName('TextTrackList.dispatchEvent') 18862 @DomName('TextTrackList.dispatchEvent')
20898 @DocsEditable 18863 @DocsEditable
20899 bool dispatchEvent(Event evt) native; 18864 bool dispatchEvent(Event evt) native;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
21120 } 19085 }
21121 } 19086 }
21122 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 19087 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
21123 // for details. All rights reserved. Use of this source code is governed by a 19088 // for details. All rights reserved. Use of this source code is governed by a
21124 // BSD-style license that can be found in the LICENSE file. 19089 // BSD-style license that can be found in the LICENSE file.
21125 19090
21126 // WARNING: Do not edit - generated code. 19091 // WARNING: Do not edit - generated code.
21127 19092
21128 19093
21129 @DomName('TouchList') 19094 @DomName('TouchList')
21130 class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "Touch List" { 19095 class TouchList extends Object with ListMixin<Touch>, ImmutableListMixin<Touch> implements JavaScriptIndexingBehavior, List<Touch> native "TouchList" {
21131 /// NB: This constructor likely does not work as you might expect it to! This 19096 /// NB: This constructor likely does not work as you might expect it to! This
21132 /// constructor will simply fail (returning null) if you are not on a device 19097 /// constructor will simply fail (returning null) if you are not on a device
21133 /// with touch enabled. See dartbug.com/8314. 19098 /// with touch enabled. See dartbug.com/8314.
21134 factory TouchList() => document.$dom_createTouchList(); 19099 factory TouchList() => document.$dom_createTouchList();
21135 19100
21136 /// Checks if this type is supported on the current platform. 19101 /// Checks if this type is supported on the current platform.
21137 static bool get supported => JS('bool', '!!document.createTouchList'); 19102 static bool get supported => JS('bool', '!!document.createTouchList');
21138 19103
21139 @DomName('TouchList.length') 19104 @DomName('TouchList.length')
21140 @DocsEditable 19105 @DocsEditable
21141 int get length => JS("int", "#.length", this); 19106 int get length => JS("int", "#.length", this);
21142 19107
21143 Touch operator[](int index) => JS("Touch", "#[#]", this, index); 19108 Touch operator[](int index) => JS("Touch", "#[#]", this, index);
21144 19109
21145 void operator[]=(int index, Touch value) { 19110 void operator[]=(int index, Touch value) {
21146 throw new UnsupportedError("Cannot assign element of immutable List."); 19111 throw new UnsupportedError("Cannot assign element of immutable List.");
21147 } 19112 }
21148 // -- start List<Touch> mixins. 19113 // -- start List<Touch> mixins.
21149 // Touch is the element type. 19114 // Touch is the element type.
21150 19115
21151 // From Iterable<Touch>:
21152 19116
21153 Iterator<Touch> get iterator {
21154 // Note: NodeLists are not fixed size. And most probably length shouldn't
21155 // be cached in both iterator _and_ forEach method. For now caching it
21156 // for consistency.
21157 return new FixedSizeListIterator<Touch>(this);
21158 }
21159
21160 Touch reduce(Touch combine(Touch value, Touch element)) {
21161 return IterableMixinWorkaround.reduce(this, combine);
21162 }
21163
21164 dynamic fold(dynamic initialValue,
21165 dynamic combine(dynamic previousValue, Touch element)) {
21166 return IterableMixinWorkaround.fold(this, initialValue, combine);
21167 }
21168
21169 bool contains(Touch element) => IterableMixinWorkaround.contains(this, element );
21170
21171 void forEach(void f(Touch element)) => IterableMixinWorkaround.forEach(this, f );
21172
21173 String join([String separator = ""]) =>
21174 IterableMixinWorkaround.joinList(this, separator);
21175
21176 Iterable map(f(Touch element)) =>
21177 IterableMixinWorkaround.mapList(this, f);
21178
21179 Iterable<Touch> where(bool f(Touch element)) =>
21180 IterableMixinWorkaround.where(this, f);
21181
21182 Iterable expand(Iterable f(Touch element)) =>
21183 IterableMixinWorkaround.expand(this, f);
21184
21185 bool every(bool f(Touch element)) => IterableMixinWorkaround.every(this, f);
21186
21187 bool any(bool f(Touch element)) => IterableMixinWorkaround.any(this, f);
21188
21189 List<Touch> toList({ bool growable: true }) =>
21190 new List<Touch>.from(this, growable: growable);
21191
21192 Set<Touch> toSet() => new Set<Touch>.from(this);
21193
21194 bool get isEmpty => this.length == 0;
21195
21196 Iterable<Touch> take(int n) => IterableMixinWorkaround.takeList(this, n);
21197
21198 Iterable<Touch> takeWhile(bool test(Touch value)) {
21199 return IterableMixinWorkaround.takeWhile(this, test);
21200 }
21201
21202 Iterable<Touch> skip(int n) => IterableMixinWorkaround.skipList(this, n);
21203
21204 Iterable<Touch> skipWhile(bool test(Touch value)) {
21205 return IterableMixinWorkaround.skipWhile(this, test);
21206 }
21207
21208 Touch firstWhere(bool test(Touch value), { Touch orElse() }) {
21209 return IterableMixinWorkaround.firstWhere(this, test, orElse);
21210 }
21211
21212 Touch lastWhere(bool test(Touch value), {Touch orElse()}) {
21213 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
21214 }
21215
21216 Touch singleWhere(bool test(Touch value)) {
21217 return IterableMixinWorkaround.singleWhere(this, test);
21218 }
21219
21220 Touch elementAt(int index) {
21221 return this[index];
21222 }
21223
21224 // From Collection<Touch>:
21225
21226 void add(Touch value) {
21227 throw new UnsupportedError("Cannot add to immutable List.");
21228 }
21229
21230 void addAll(Iterable<Touch> iterable) {
21231 throw new UnsupportedError("Cannot add to immutable List.");
21232 }
21233
21234 // From List<Touch>:
21235 void set length(int value) { 19117 void set length(int value) {
21236 throw new UnsupportedError("Cannot resize immutable List."); 19118 throw new UnsupportedError("Cannot resize immutable List.");
21237 } 19119 }
21238 19120
21239 void clear() {
21240 throw new UnsupportedError("Cannot clear immutable List.");
21241 }
21242
21243 Iterable<Touch> get reversed {
21244 return IterableMixinWorkaround.reversedList(this);
21245 }
21246
21247 void sort([int compare(Touch a, Touch b)]) {
21248 throw new UnsupportedError("Cannot sort immutable List.");
21249 }
21250
21251 int indexOf(Touch element, [int start = 0]) =>
21252 Lists.indexOf(this, element, start, this.length);
21253
21254 int lastIndexOf(Touch element, [int start]) {
21255 if (start == null) start = length - 1;
21256 return Lists.lastIndexOf(this, element, start);
21257 }
21258
21259 Touch get first {
21260 if (this.length > 0) return this[0];
21261 throw new StateError("No elements");
21262 }
21263
21264 Touch get last {
21265 if (this.length > 0) return this[this.length - 1];
21266 throw new StateError("No elements");
21267 }
21268
21269 Touch get single {
21270 if (length == 1) return this[0];
21271 if (length == 0) throw new StateError("No elements");
21272 throw new StateError("More than one element");
21273 }
21274
21275 void insert(int index, Touch element) {
21276 throw new UnsupportedError("Cannot add to immutable List.");
21277 }
21278
21279 void insertAll(int index, Iterable<Touch> iterable) {
21280 throw new UnsupportedError("Cannot add to immutable List.");
21281 }
21282
21283 void setAll(int index, Iterable<Touch> iterable) {
21284 throw new UnsupportedError("Cannot modify an immutable List.");
21285 }
21286
21287 Touch removeAt(int pos) {
21288 throw new UnsupportedError("Cannot remove from immutable List.");
21289 }
21290
21291 Touch removeLast() {
21292 throw new UnsupportedError("Cannot remove from immutable List.");
21293 }
21294
21295 bool remove(Object object) {
21296 throw new UnsupportedError("Cannot remove from immutable List.");
21297 }
21298
21299 void removeWhere(bool test(Touch element)) {
21300 throw new UnsupportedError("Cannot remove from immutable List.");
21301 }
21302
21303 void retainWhere(bool test(Touch element)) {
21304 throw new UnsupportedError("Cannot remove from immutable List.");
21305 }
21306
21307 void setRange(int start, int end, Iterable<Touch> iterable, [int skipCount=0]) {
21308 throw new UnsupportedError("Cannot setRange on immutable List.");
21309 }
21310
21311 void removeRange(int start, int end) {
21312 throw new UnsupportedError("Cannot removeRange on immutable List.");
21313 }
21314
21315 void replaceRange(int start, int end, Iterable<Touch> iterable) {
21316 throw new UnsupportedError("Cannot modify an immutable List.");
21317 }
21318
21319 void fillRange(int start, int end, [Touch fillValue]) {
21320 throw new UnsupportedError("Cannot modify an immutable List.");
21321 }
21322
21323 Iterable<Touch> getRange(int start, int end) =>
21324 IterableMixinWorkaround.getRangeList(this, start, end);
21325
21326 List<Touch> sublist(int start, [int end]) {
21327 if (end == null) end = length;
21328 return Lists.getRange(this, start, end, <Touch>[]);
21329 }
21330
21331 Map<int, Touch> asMap() =>
21332 IterableMixinWorkaround.asMapList(this);
21333
21334 String toString() {
21335 StringBuffer buffer = new StringBuffer('[');
21336 buffer.writeAll(this, ', ');
21337 buffer.write(']');
21338 return buffer.toString();
21339 }
21340
21341 // -- end List<Touch> mixins. 19121 // -- end List<Touch> mixins.
21342 19122
21343 @DomName('TouchList.item') 19123 @DomName('TouchList.item')
21344 @DocsEditable 19124 @DocsEditable
21345 Touch item(int index) native; 19125 Touch item(int index) native;
21346 19126
21347 } 19127 }
21348 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 19128 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21349 // for details. All rights reserved. Use of this source code is governed by a 19129 // for details. All rights reserved. Use of this source code is governed by a
21350 // BSD-style license that can be found in the LICENSE file. 19130 // BSD-style license that can be found in the LICENSE file.
(...skipping 1878 matching lines...) Expand 10 before | Expand all | Expand 10 after
23229 @DomName('Worker.terminate') 21009 @DomName('Worker.terminate')
23230 @DocsEditable 21010 @DocsEditable
23231 void terminate() native; 21011 void terminate() native;
23232 21012
23233 @DomName('Worker.onmessage') 21013 @DomName('Worker.onmessage')
23234 @DocsEditable 21014 @DocsEditable
23235 Stream<MessageEvent> get onMessage => messageEvent.forTarget(this); 21015 Stream<MessageEvent> get onMessage => messageEvent.forTarget(this);
23236 } 21016 }
23237 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21017 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23238 // for details. All rights reserved. Use of this source code is governed by a 21018 // for details. All rights reserved. Use of this source code is governed by a
23239 // BSD-style license that can be found in the LICENSE file.
23240
23241
23242 @DocsEditable
23243 @DomName('XPathEvaluator')
23244 class XPathEvaluator native "XPathEvaluator" {
23245
23246 @DomName('XPathEvaluator.XPathEvaluator')
23247 @DocsEditable
23248 factory XPathEvaluator() {
23249 return XPathEvaluator._create_1();
23250 }
23251 static XPathEvaluator _create_1() => JS('XPathEvaluator', 'new XPathEvaluator( )');
23252
23253 @DomName('XPathEvaluator.createExpression')
23254 @DocsEditable
23255 XPathExpression createExpression(String expression, XPathNSResolver resolver) native;
23256
23257 @DomName('XPathEvaluator.createNSResolver')
23258 @DocsEditable
23259 XPathNSResolver createNSResolver(Node nodeResolver) native;
23260
23261 @DomName('XPathEvaluator.evaluate')
23262 @DocsEditable
23263 XPathResult evaluate(String expression, Node contextNode, XPathNSResolver reso lver, int type, XPathResult inResult) native;
23264 }
23265 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23266 // for details. All rights reserved. Use of this source code is governed by a
23267 // BSD-style license that can be found in the LICENSE file.
23268
23269
23270 @DocsEditable
23271 @DomName('XPathException')
23272 class XPathException native "XPathException" {
23273
23274 static const int INVALID_EXPRESSION_ERR = 51;
23275
23276 static const int TYPE_ERR = 52;
23277
23278 @DomName('XPathException.code')
23279 @DocsEditable
23280 final int code;
23281
23282 @DomName('XPathException.message')
23283 @DocsEditable
23284 final String message;
23285
23286 @DomName('XPathException.name')
23287 @DocsEditable
23288 final String name;
23289
23290 @DomName('XPathException.toString')
23291 @DocsEditable
23292 String toString() native;
23293 }
23294 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23295 // for details. All rights reserved. Use of this source code is governed by a
23296 // BSD-style license that can be found in the LICENSE file.
23297
23298
23299 @DocsEditable
23300 @DomName('XPathExpression')
23301 class XPathExpression native "XPathExpression" {
23302
23303 @DomName('XPathExpression.evaluate')
23304 @DocsEditable
23305 XPathResult evaluate(Node contextNode, int type, XPathResult inResult) native;
23306 }
23307 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23308 // for details. All rights reserved. Use of this source code is governed by a
23309 // BSD-style license that can be found in the LICENSE file.
23310
23311
23312 @DocsEditable
23313 @DomName('XPathNSResolver')
23314 class XPathNSResolver native "XPathNSResolver" {
23315
23316 @JSName('lookupNamespaceURI')
23317 @DomName('XPathNSResolver.lookupNamespaceURI')
23318 @DocsEditable
23319 String lookupNamespaceUri(String prefix) native;
23320 }
23321 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23322 // for details. All rights reserved. Use of this source code is governed by a
23323 // BSD-style license that can be found in the LICENSE file.
23324
23325
23326 @DocsEditable
23327 @DomName('XPathResult')
23328 class XPathResult native "XPathResult" {
23329
23330 static const int ANY_TYPE = 0;
23331
23332 static const int ANY_UNORDERED_NODE_TYPE = 8;
23333
23334 static const int BOOLEAN_TYPE = 3;
23335
23336 static const int FIRST_ORDERED_NODE_TYPE = 9;
23337
23338 static const int NUMBER_TYPE = 1;
23339
23340 static const int ORDERED_NODE_ITERATOR_TYPE = 5;
23341
23342 static const int ORDERED_NODE_SNAPSHOT_TYPE = 7;
23343
23344 static const int STRING_TYPE = 2;
23345
23346 static const int UNORDERED_NODE_ITERATOR_TYPE = 4;
23347
23348 static const int UNORDERED_NODE_SNAPSHOT_TYPE = 6;
23349
23350 @DomName('XPathResult.booleanValue')
23351 @DocsEditable
23352 final bool booleanValue;
23353
23354 @DomName('XPathResult.invalidIteratorState')
23355 @DocsEditable
23356 final bool invalidIteratorState;
23357
23358 @DomName('XPathResult.numberValue')
23359 @DocsEditable
23360 final num numberValue;
23361
23362 @DomName('XPathResult.resultType')
23363 @DocsEditable
23364 final int resultType;
23365
23366 @DomName('XPathResult.singleNodeValue')
23367 @DocsEditable
23368 final Node singleNodeValue;
23369
23370 @DomName('XPathResult.snapshotLength')
23371 @DocsEditable
23372 final int snapshotLength;
23373
23374 @DomName('XPathResult.stringValue')
23375 @DocsEditable
23376 final String stringValue;
23377
23378 @DomName('XPathResult.iterateNext')
23379 @DocsEditable
23380 Node iterateNext() native;
23381
23382 @DomName('XPathResult.snapshotItem')
23383 @DocsEditable
23384 Node snapshotItem(int index) native;
23385 }
23386 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23387 // for details. All rights reserved. Use of this source code is governed by a
23388 // BSD-style license that can be found in the LICENSE file.
23389
23390
23391 @DocsEditable
23392 @DomName('XMLSerializer')
23393 class XmlSerializer native "XMLSerializer" {
23394
23395 @DomName('XMLSerializer.XMLSerializer')
23396 @DocsEditable
23397 factory XmlSerializer() {
23398 return XmlSerializer._create_1();
23399 }
23400 static XmlSerializer _create_1() => JS('XmlSerializer', 'new XMLSerializer()') ;
23401
23402 @DomName('XMLSerializer.serializeToString')
23403 @DocsEditable
23404 String serializeToString(Node node) native;
23405 }
23406 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23407 // for details. All rights reserved. Use of this source code is governed by a
23408 // BSD-style license that can be found in the LICENSE file.
23409
23410
23411 @DocsEditable
23412 @DomName('XSLTProcessor')
23413 @SupportedBrowser(SupportedBrowser.CHROME)
23414 @SupportedBrowser(SupportedBrowser.FIREFOX)
23415 @SupportedBrowser(SupportedBrowser.SAFARI)
23416 class XsltProcessor native "XSLTProcessor" {
23417
23418 @DomName('XSLTProcessor.XSLTProcessor')
23419 @DocsEditable
23420 factory XsltProcessor() {
23421 return XsltProcessor._create_1();
23422 }
23423 static XsltProcessor _create_1() => JS('XsltProcessor', 'new XSLTProcessor()') ;
23424
23425 /// Checks if this type is supported on the current platform.
23426 static bool get supported => JS('bool', '!!(window.XSLTProcessor)');
23427
23428 @DomName('XSLTProcessor.clearParameters')
23429 @DocsEditable
23430 void clearParameters() native;
23431
23432 @DomName('XSLTProcessor.getParameter')
23433 @DocsEditable
23434 String getParameter(String namespaceURI, String localName) native;
23435
23436 @DomName('XSLTProcessor.importStylesheet')
23437 @DocsEditable
23438 void importStylesheet(Node stylesheet) native;
23439
23440 @DomName('XSLTProcessor.removeParameter')
23441 @DocsEditable
23442 void removeParameter(String namespaceURI, String localName) native;
23443
23444 @DomName('XSLTProcessor.reset')
23445 @DocsEditable
23446 void reset() native;
23447
23448 @DomName('XSLTProcessor.setParameter')
23449 @DocsEditable
23450 void setParameter(String namespaceURI, String localName, String value) native;
23451
23452 @DomName('XSLTProcessor.transformToDocument')
23453 @DocsEditable
23454 Document transformToDocument(Node source) native;
23455
23456 @DomName('XSLTProcessor.transformToFragment')
23457 @DocsEditable
23458 DocumentFragment transformToFragment(Node source, Document docVal) native;
23459 }
23460 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23461 // for details. All rights reserved. Use of this source code is governed by a
23462 // BSD-style license that can be found in the LICENSE file.
23463
23464
23465 @DocsEditable
23466 @DomName('CSSPrimitiveValue')
23467 abstract class _CSSPrimitiveValue extends _CSSValue native "CSSPrimitiveValue" {
23468 }
23469 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23470 // for details. All rights reserved. Use of this source code is governed by a
23471 // BSD-style license that can be found in the LICENSE file.
23472
23473
23474 @DocsEditable
23475 @DomName('CSSValue')
23476 abstract class _CSSValue native "CSSValue" {
23477 }
23478 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
23479 // for details. All rights reserved. Use of this source code is governed by a
23480 // BSD-style license that can be found in the LICENSE file.
23481
23482
23483 @DocsEditable
23484 @DomName('ClientRect')
23485 class _ClientRect implements Rect native "ClientRect" {
23486
23487 // NOTE! All code below should be common with Rect.
23488 // TODO(blois): implement with mixins when available.
23489
23490 String toString() {
23491 return '($left, $top, $width, $height)';
23492 }
23493
23494 bool operator ==(other) {
23495 if (other is !Rect) return false;
23496 return left == other.left && top == other.top && width == other.width &&
23497 height == other.height;
23498 }
23499
23500 /**
23501 * Computes the intersection of this rectangle and the rectangle parameter.
23502 * Returns null if there is no intersection.
23503 */
23504 Rect intersection(Rect rect) {
23505 var x0 = max(left, rect.left);
23506 var x1 = min(left + width, rect.left + rect.width);
23507
23508 if (x0 <= x1) {
23509 var y0 = max(top, rect.top);
23510 var y1 = min(top + height, rect.top + rect.height);
23511
23512 if (y0 <= y1) {
23513 return new Rect(x0, y0, x1 - x0, y1 - y0);
23514 }
23515 }
23516 return null;
23517 }
23518
23519
23520 /**
23521 * Returns whether a rectangle intersects this rectangle.
23522 */
23523 bool intersects(Rect other) {
23524 return (left <= other.left + other.width && other.left <= left + width &&
23525 top <= other.top + other.height && other.top <= top + height);
23526 }
23527
23528 /**
23529 * Returns a new rectangle which completely contains this rectangle and the
23530 * input rectangle.
23531 */
23532 Rect union(Rect rect) {
23533 var right = max(this.left + this.width, rect.left + rect.width);
23534 var bottom = max(this.top + this.height, rect.top + rect.height);
23535
23536 var left = min(this.left, rect.left);
23537 var top = min(this.top, rect.top);
23538
23539 return new Rect(left, top, right - left, bottom - top);
23540 }
23541
23542 /**
23543 * Tests whether this rectangle entirely contains another rectangle.
23544 */
23545 bool containsRect(Rect another) {
23546 return left <= another.left &&
23547 left + width >= another.left + another.width &&
23548 top <= another.top &&
23549 top + height >= another.top + another.height;
23550 }
23551
23552 /**
23553 * Tests whether this rectangle entirely contains a point.
23554 */
23555 bool containsPoint(Point another) {
23556 return another.x >= left &&
23557 another.x <= left + width &&
23558 another.y >= top &&
23559 another.y <= top + height;
23560 }
23561
23562 Rect ceil() => new Rect(left.ceil(), top.ceil(), width.ceil(), height.ceil());
23563 Rect floor() => new Rect(left.floor(), top.floor(), width.floor(),
23564 height.floor());
23565 Rect round() => new Rect(left.round(), top.round(), width.round(),
23566 height.round());
23567
23568 /**
23569 * Truncates coordinates to integers and returns the result as a new
23570 * rectangle.
23571 */
23572 Rect toInt() => new Rect(left.toInt(), top.toInt(), width.toInt(),
23573 height.toInt());
23574
23575 Point get topLeft => new Point(this.left, this.top);
23576 Point get bottomRight => new Point(this.left + this.width,
23577 this.top + this.height);
23578
23579 @DomName('ClientRect.bottom')
23580 @DocsEditable
23581 final num bottom;
23582
23583 @DomName('ClientRect.height')
23584 @DocsEditable
23585 final num height;
23586
23587 @DomName('ClientRect.left')
23588 @DocsEditable
23589 final num left;
23590
23591 @DomName('ClientRect.right')
23592 @DocsEditable
23593 final num right;
23594
23595 @DomName('ClientRect.top')
23596 @DocsEditable
23597 final num top;
23598
23599 @DomName('ClientRect.width')
23600 @DocsEditable
23601 final num width;
23602 }
23603 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23604 // for details. All rights reserved. Use of this source code is governed by a
23605 // BSD-style license that can be found in the LICENSE file.
23606
23607
23608 @DocsEditable
23609 @DomName('ClientRectList')
23610 class _ClientRectList implements JavaScriptIndexingBehavior, List<Rect> native " ClientRectList" {
23611
23612 @DomName('ClientRectList.length')
23613 @DocsEditable
23614 int get length => JS("int", "#.length", this);
23615
23616 Rect operator[](int index) => JS("Rect", "#[#]", this, index);
23617
23618 void operator[]=(int index, Rect value) {
23619 throw new UnsupportedError("Cannot assign element of immutable List.");
23620 }
23621 // -- start List<Rect> mixins.
23622 // Rect is the element type.
23623
23624 // From Iterable<Rect>:
23625
23626 Iterator<Rect> get iterator {
23627 // Note: NodeLists are not fixed size. And most probably length shouldn't
23628 // be cached in both iterator _and_ forEach method. For now caching it
23629 // for consistency.
23630 return new FixedSizeListIterator<Rect>(this);
23631 }
23632
23633 Rect reduce(Rect combine(Rect value, Rect element)) {
23634 return IterableMixinWorkaround.reduce(this, combine);
23635 }
23636
23637 dynamic fold(dynamic initialValue,
23638 dynamic combine(dynamic previousValue, Rect element)) {
23639 return IterableMixinWorkaround.fold(this, initialValue, combine);
23640 }
23641
23642 bool contains(Rect element) => IterableMixinWorkaround.contains(this, element) ;
23643
23644 void forEach(void f(Rect element)) => IterableMixinWorkaround.forEach(this, f) ;
23645
23646 String join([String separator = ""]) =>
23647 IterableMixinWorkaround.joinList(this, separator);
23648
23649 Iterable map(f(Rect element)) =>
23650 IterableMixinWorkaround.mapList(this, f);
23651
23652 Iterable<Rect> where(bool f(Rect element)) =>
23653 IterableMixinWorkaround.where(this, f);
23654
23655 Iterable expand(Iterable f(Rect element)) =>
23656 IterableMixinWorkaround.expand(this, f);
23657
23658 bool every(bool f(Rect element)) => IterableMixinWorkaround.every(this, f);
23659
23660 bool any(bool f(Rect element)) => IterableMixinWorkaround.any(this, f);
23661
23662 List<Rect> toList({ bool growable: true }) =>
23663 new List<Rect>.from(this, growable: growable);
23664
23665 Set<Rect> toSet() => new Set<Rect>.from(this);
23666
23667 bool get isEmpty => this.length == 0;
23668
23669 Iterable<Rect> take(int n) => IterableMixinWorkaround.takeList(this, n);
23670
23671 Iterable<Rect> takeWhile(bool test(Rect value)) {
23672 return IterableMixinWorkaround.takeWhile(this, test);
23673 }
23674
23675 Iterable<Rect> skip(int n) => IterableMixinWorkaround.skipList(this, n);
23676
23677 Iterable<Rect> skipWhile(bool test(Rect value)) {
23678 return IterableMixinWorkaround.skipWhile(this, test);
23679 }
23680
23681 Rect firstWhere(bool test(Rect value), { Rect orElse() }) {
23682 return IterableMixinWorkaround.firstWhere(this, test, orElse);
23683 }
23684
23685 Rect lastWhere(bool test(Rect value), {Rect orElse()}) {
23686 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
23687 }
23688
23689 Rect singleWhere(bool test(Rect value)) {
23690 return IterableMixinWorkaround.singleWhere(this, test);
23691 }
23692
23693 Rect elementAt(int index) {
23694 return this[index];
23695 }
23696
23697 // From Collection<Rect>:
23698
23699 void add(Rect value) {
23700 throw new UnsupportedError("Cannot add to immutable List.");
23701 }
23702
23703 void addAll(Iterable<Rect> iterable) {
23704 throw new UnsupportedError("Cannot add to immutable List.");
23705 }
23706
23707 // From List<Rect>:
23708 void set length(int value) {
23709 throw new UnsupportedError("Cannot resize immutable List.");
23710 }
23711
23712 void clear() {
23713 throw new UnsupportedError("Cannot clear immutable List.");
23714 }
23715
23716 Iterable<Rect> get reversed {
23717 return IterableMixinWorkaround.reversedList(this);
23718 }
23719
23720 void sort([int compare(Rect a, Rect b)]) {
23721 throw new UnsupportedError("Cannot sort immutable List.");
23722 }
23723
23724 int indexOf(Rect element, [int start = 0]) =>
23725 Lists.indexOf(this, element, start, this.length);
23726
23727 int lastIndexOf(Rect element, [int start]) {
23728 if (start == null) start = length - 1;
23729 return Lists.lastIndexOf(this, element, start);
23730 }
23731
23732 Rect get first {
23733 if (this.length > 0) return this[0];
23734 throw new StateError("No elements");
23735 }
23736
23737 Rect get last {
23738 if (this.length > 0) return this[this.length - 1];
23739 throw new StateError("No elements");
23740 }
23741
23742 Rect get single {
23743 if (length == 1) return this[0];
23744 if (length == 0) throw new StateError("No elements");
23745 throw new StateError("More than one element");
23746 }
23747
23748 void insert(int index, Rect element) {
23749 throw new UnsupportedError("Cannot add to immutable List.");
23750 }
23751
23752 void insertAll(int index, Iterable<Rect> iterable) {
23753 throw new UnsupportedError("Cannot add to immutable List.");
23754 }
23755
23756 void setAll(int index, Iterable<Rect> iterable) {
23757 throw new UnsupportedError("Cannot modify an immutable List.");
23758 }
23759
23760 Rect removeAt(int pos) {
23761 throw new UnsupportedError("Cannot remove from immutable List.");
23762 }
23763
23764 Rect removeLast() {
23765 throw new UnsupportedError("Cannot remove from immutable List.");
23766 }
23767
23768 bool remove(Object object) {
23769 throw new UnsupportedError("Cannot remove from immutable List.");
23770 }
23771
23772 void removeWhere(bool test(Rect element)) {
23773 throw new UnsupportedError("Cannot remove from immutable List.");
23774 }
23775
23776 void retainWhere(bool test(Rect element)) {
23777 throw new UnsupportedError("Cannot remove from immutable List.");
23778 }
23779
23780 void setRange(int start, int end, Iterable<Rect> iterable, [int skipCount=0]) {
23781 throw new UnsupportedError("Cannot setRange on immutable List.");
23782 }
23783
23784 void removeRange(int start, int end) {
23785 throw new UnsupportedError("Cannot removeRange on immutable List.");
23786 }
23787
23788 void replaceRange(int start, int end, Iterable<Rect> iterable) {
23789 throw new UnsupportedError("Cannot modify an immutable List.");
23790 }
23791
23792 void fillRange(int start, int end, [Rect fillValue]) {
23793 throw new UnsupportedError("Cannot modify an immutable List.");
23794 }
23795
23796 Iterable<Rect> getRange(int start, int end) =>
23797 IterableMixinWorkaround.getRangeList(this, start, end);
23798
23799 List<Rect> sublist(int start, [int end]) {
23800 if (end == null) end = length;
23801 return Lists.getRange(this, start, end, <Rect>[]);
23802 }
23803
23804 Map<int, Rect> asMap() =>
23805 IterableMixinWorkaround.asMapList(this);
23806
23807 String toString() {
23808 StringBuffer buffer = new StringBuffer('[');
23809 buffer.writeAll(this, ', ');
23810 buffer.write(']');
23811 return buffer.toString();
23812 }
23813
23814 // -- end List<Rect> mixins.
23815
23816 @DomName('ClientRectList.item')
23817 @DocsEditable
23818 Rect item(int index) native;
23819 }
23820 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23821 // for details. All rights reserved. Use of this source code is governed by a
23822 // BSD-style license that can be found in the LICENSE file.
23823
23824
23825 @DocsEditable
23826 @DomName('Counter')
23827 abstract class _Counter native "Counter" {
23828 }
23829 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23830 // for details. All rights reserved. Use of this source code is governed by a
23831 // BSD-style license that can be found in the LICENSE file.
23832
23833
23834 @DocsEditable
23835 @DomName('CSSRuleList')
23836 class _CssRuleList implements JavaScriptIndexingBehavior, List<CssRule> native " CSSRuleList" {
23837
23838 @DomName('CSSRuleList.length')
23839 @DocsEditable
23840 int get length => JS("int", "#.length", this);
23841
23842 CssRule operator[](int index) => JS("CssRule", "#[#]", this, index);
23843
23844 void operator[]=(int index, CssRule value) {
23845 throw new UnsupportedError("Cannot assign element of immutable List.");
23846 }
23847 // -- start List<CssRule> mixins.
23848 // CssRule is the element type.
23849
23850 // From Iterable<CssRule>:
23851
23852 Iterator<CssRule> get iterator {
23853 // Note: NodeLists are not fixed size. And most probably length shouldn't
23854 // be cached in both iterator _and_ forEach method. For now caching it
23855 // for consistency.
23856 return new FixedSizeListIterator<CssRule>(this);
23857 }
23858
23859 CssRule reduce(CssRule combine(CssRule value, CssRule element)) {
23860 return IterableMixinWorkaround.reduce(this, combine);
23861 }
23862
23863 dynamic fold(dynamic initialValue,
23864 dynamic combine(dynamic previousValue, CssRule element)) {
23865 return IterableMixinWorkaround.fold(this, initialValue, combine);
23866 }
23867
23868 bool contains(CssRule element) => IterableMixinWorkaround.contains(this, eleme nt);
23869
23870 void forEach(void f(CssRule element)) => IterableMixinWorkaround.forEach(this, f);
23871
23872 String join([String separator = ""]) =>
23873 IterableMixinWorkaround.joinList(this, separator);
23874
23875 Iterable map(f(CssRule element)) =>
23876 IterableMixinWorkaround.mapList(this, f);
23877
23878 Iterable<CssRule> where(bool f(CssRule element)) =>
23879 IterableMixinWorkaround.where(this, f);
23880
23881 Iterable expand(Iterable f(CssRule element)) =>
23882 IterableMixinWorkaround.expand(this, f);
23883
23884 bool every(bool f(CssRule element)) => IterableMixinWorkaround.every(this, f);
23885
23886 bool any(bool f(CssRule element)) => IterableMixinWorkaround.any(this, f);
23887
23888 List<CssRule> toList({ bool growable: true }) =>
23889 new List<CssRule>.from(this, growable: growable);
23890
23891 Set<CssRule> toSet() => new Set<CssRule>.from(this);
23892
23893 bool get isEmpty => this.length == 0;
23894
23895 Iterable<CssRule> take(int n) => IterableMixinWorkaround.takeList(this, n);
23896
23897 Iterable<CssRule> takeWhile(bool test(CssRule value)) {
23898 return IterableMixinWorkaround.takeWhile(this, test);
23899 }
23900
23901 Iterable<CssRule> skip(int n) => IterableMixinWorkaround.skipList(this, n);
23902
23903 Iterable<CssRule> skipWhile(bool test(CssRule value)) {
23904 return IterableMixinWorkaround.skipWhile(this, test);
23905 }
23906
23907 CssRule firstWhere(bool test(CssRule value), { CssRule orElse() }) {
23908 return IterableMixinWorkaround.firstWhere(this, test, orElse);
23909 }
23910
23911 CssRule lastWhere(bool test(CssRule value), {CssRule orElse()}) {
23912 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
23913 }
23914
23915 CssRule singleWhere(bool test(CssRule value)) {
23916 return IterableMixinWorkaround.singleWhere(this, test);
23917 }
23918
23919 CssRule elementAt(int index) {
23920 return this[index];
23921 }
23922
23923 // From Collection<CssRule>:
23924
23925 void add(CssRule value) {
23926 throw new UnsupportedError("Cannot add to immutable List.");
23927 }
23928
23929 void addAll(Iterable<CssRule> iterable) {
23930 throw new UnsupportedError("Cannot add to immutable List.");
23931 }
23932
23933 // From List<CssRule>:
23934 void set length(int value) {
23935 throw new UnsupportedError("Cannot resize immutable List.");
23936 }
23937
23938 void clear() {
23939 throw new UnsupportedError("Cannot clear immutable List.");
23940 }
23941
23942 Iterable<CssRule> get reversed {
23943 return IterableMixinWorkaround.reversedList(this);
23944 }
23945
23946 void sort([int compare(CssRule a, CssRule b)]) {
23947 throw new UnsupportedError("Cannot sort immutable List.");
23948 }
23949
23950 int indexOf(CssRule element, [int start = 0]) =>
23951 Lists.indexOf(this, element, start, this.length);
23952
23953 int lastIndexOf(CssRule element, [int start]) {
23954 if (start == null) start = length - 1;
23955 return Lists.lastIndexOf(this, element, start);
23956 }
23957
23958 CssRule get first {
23959 if (this.length > 0) return this[0];
23960 throw new StateError("No elements");
23961 }
23962
23963 CssRule get last {
23964 if (this.length > 0) return this[this.length - 1];
23965 throw new StateError("No elements");
23966 }
23967
23968 CssRule get single {
23969 if (length == 1) return this[0];
23970 if (length == 0) throw new StateError("No elements");
23971 throw new StateError("More than one element");
23972 }
23973
23974 void insert(int index, CssRule element) {
23975 throw new UnsupportedError("Cannot add to immutable List.");
23976 }
23977
23978 void insertAll(int index, Iterable<CssRule> iterable) {
23979 throw new UnsupportedError("Cannot add to immutable List.");
23980 }
23981
23982 void setAll(int index, Iterable<CssRule> iterable) {
23983 throw new UnsupportedError("Cannot modify an immutable List.");
23984 }
23985
23986 CssRule removeAt(int pos) {
23987 throw new UnsupportedError("Cannot remove from immutable List.");
23988 }
23989
23990 CssRule removeLast() {
23991 throw new UnsupportedError("Cannot remove from immutable List.");
23992 }
23993
23994 bool remove(Object object) {
23995 throw new UnsupportedError("Cannot remove from immutable List.");
23996 }
23997
23998 void removeWhere(bool test(CssRule element)) {
23999 throw new UnsupportedError("Cannot remove from immutable List.");
24000 }
24001
24002 void retainWhere(bool test(CssRule element)) {
24003 throw new UnsupportedError("Cannot remove from immutable List.");
24004 }
24005
24006 void setRange(int start, int end, Iterable<CssRule> iterable, [int skipCount=0 ]) {
24007 throw new UnsupportedError("Cannot setRange on immutable List.");
24008 }
24009
24010 void removeRange(int start, int end) {
24011 throw new UnsupportedError("Cannot removeRange on immutable List.");
24012 }
24013
24014 void replaceRange(int start, int end, Iterable<CssRule> iterable) {
24015 throw new UnsupportedError("Cannot modify an immutable List.");
24016 }
24017
24018 void fillRange(int start, int end, [CssRule fillValue]) {
24019 throw new UnsupportedError("Cannot modify an immutable List.");
24020 }
24021
24022 Iterable<CssRule> getRange(int start, int end) =>
24023 IterableMixinWorkaround.getRangeList(this, start, end);
24024
24025 List<CssRule> sublist(int start, [int end]) {
24026 if (end == null) end = length;
24027 return Lists.getRange(this, start, end, <CssRule>[]);
24028 }
24029
24030 Map<int, CssRule> asMap() =>
24031 IterableMixinWorkaround.asMapList(this);
24032
24033 String toString() {
24034 StringBuffer buffer = new StringBuffer('[');
24035 buffer.writeAll(this, ', ');
24036 buffer.write(']');
24037 return buffer.toString();
24038 }
24039
24040 // -- end List<CssRule> mixins.
24041
24042 @DomName('CSSRuleList.item')
24043 @DocsEditable
24044 CssRule item(int index) native;
24045 }
24046 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24047 // for details. All rights reserved. Use of this source code is governed by a
24048 // BSD-style license that can be found in the LICENSE file.
24049
24050
24051 @DocsEditable
24052 @DomName('CSSValueList')
24053 class _CssValueList extends _CSSValue implements JavaScriptIndexingBehavior, Lis t<_CSSValue> native "CSSValueList" {
24054
24055 @DomName('CSSValueList.length')
24056 @DocsEditable
24057 int get length => JS("int", "#.length", this);
24058
24059 _CSSValue operator[](int index) => JS("_CSSValue", "#[#]", this, index);
24060
24061 void operator[]=(int index, _CSSValue value) {
24062 throw new UnsupportedError("Cannot assign element of immutable List.");
24063 }
24064 // -- start List<_CSSValue> mixins.
24065 // _CSSValue is the element type.
24066
24067 // From Iterable<_CSSValue>:
24068
24069 Iterator<_CSSValue> get iterator {
24070 // Note: NodeLists are not fixed size. And most probably length shouldn't
24071 // be cached in both iterator _and_ forEach method. For now caching it
24072 // for consistency.
24073 return new FixedSizeListIterator<_CSSValue>(this);
24074 }
24075
24076 _CSSValue reduce(_CSSValue combine(_CSSValue value, _CSSValue element)) {
24077 return IterableMixinWorkaround.reduce(this, combine);
24078 }
24079
24080 dynamic fold(dynamic initialValue,
24081 dynamic combine(dynamic previousValue, _CSSValue element)) {
24082 return IterableMixinWorkaround.fold(this, initialValue, combine);
24083 }
24084
24085 bool contains(_CSSValue element) => IterableMixinWorkaround.contains(this, ele ment);
24086
24087 void forEach(void f(_CSSValue element)) => IterableMixinWorkaround.forEach(thi s, f);
24088
24089 String join([String separator = ""]) =>
24090 IterableMixinWorkaround.joinList(this, separator);
24091
24092 Iterable map(f(_CSSValue element)) =>
24093 IterableMixinWorkaround.mapList(this, f);
24094
24095 Iterable<_CSSValue> where(bool f(_CSSValue element)) =>
24096 IterableMixinWorkaround.where(this, f);
24097
24098 Iterable expand(Iterable f(_CSSValue element)) =>
24099 IterableMixinWorkaround.expand(this, f);
24100
24101 bool every(bool f(_CSSValue element)) => IterableMixinWorkaround.every(this, f );
24102
24103 bool any(bool f(_CSSValue element)) => IterableMixinWorkaround.any(this, f);
24104
24105 List<_CSSValue> toList({ bool growable: true }) =>
24106 new List<_CSSValue>.from(this, growable: growable);
24107
24108 Set<_CSSValue> toSet() => new Set<_CSSValue>.from(this);
24109
24110 bool get isEmpty => this.length == 0;
24111
24112 Iterable<_CSSValue> take(int n) => IterableMixinWorkaround.takeList(this, n);
24113
24114 Iterable<_CSSValue> takeWhile(bool test(_CSSValue value)) {
24115 return IterableMixinWorkaround.takeWhile(this, test);
24116 }
24117
24118 Iterable<_CSSValue> skip(int n) => IterableMixinWorkaround.skipList(this, n);
24119
24120 Iterable<_CSSValue> skipWhile(bool test(_CSSValue value)) {
24121 return IterableMixinWorkaround.skipWhile(this, test);
24122 }
24123
24124 _CSSValue firstWhere(bool test(_CSSValue value), { _CSSValue orElse() }) {
24125 return IterableMixinWorkaround.firstWhere(this, test, orElse);
24126 }
24127
24128 _CSSValue lastWhere(bool test(_CSSValue value), {_CSSValue orElse()}) {
24129 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
24130 }
24131
24132 _CSSValue singleWhere(bool test(_CSSValue value)) {
24133 return IterableMixinWorkaround.singleWhere(this, test);
24134 }
24135
24136 _CSSValue elementAt(int index) {
24137 return this[index];
24138 }
24139
24140 // From Collection<_CSSValue>:
24141
24142 void add(_CSSValue value) {
24143 throw new UnsupportedError("Cannot add to immutable List.");
24144 }
24145
24146 void addAll(Iterable<_CSSValue> iterable) {
24147 throw new UnsupportedError("Cannot add to immutable List.");
24148 }
24149
24150 // From List<_CSSValue>:
24151 void set length(int value) {
24152 throw new UnsupportedError("Cannot resize immutable List.");
24153 }
24154
24155 void clear() {
24156 throw new UnsupportedError("Cannot clear immutable List.");
24157 }
24158
24159 Iterable<_CSSValue> get reversed {
24160 return IterableMixinWorkaround.reversedList(this);
24161 }
24162
24163 void sort([int compare(_CSSValue a, _CSSValue b)]) {
24164 throw new UnsupportedError("Cannot sort immutable List.");
24165 }
24166
24167 int indexOf(_CSSValue element, [int start = 0]) =>
24168 Lists.indexOf(this, element, start, this.length);
24169
24170 int lastIndexOf(_CSSValue element, [int start]) {
24171 if (start == null) start = length - 1;
24172 return Lists.lastIndexOf(this, element, start);
24173 }
24174
24175 _CSSValue get first {
24176 if (this.length > 0) return this[0];
24177 throw new StateError("No elements");
24178 }
24179
24180 _CSSValue get last {
24181 if (this.length > 0) return this[this.length - 1];
24182 throw new StateError("No elements");
24183 }
24184
24185 _CSSValue get single {
24186 if (length == 1) return this[0];
24187 if (length == 0) throw new StateError("No elements");
24188 throw new StateError("More than one element");
24189 }
24190
24191 void insert(int index, _CSSValue element) {
24192 throw new UnsupportedError("Cannot add to immutable List.");
24193 }
24194
24195 void insertAll(int index, Iterable<_CSSValue> iterable) {
24196 throw new UnsupportedError("Cannot add to immutable List.");
24197 }
24198
24199 void setAll(int index, Iterable<_CSSValue> iterable) {
24200 throw new UnsupportedError("Cannot modify an immutable List.");
24201 }
24202
24203 _CSSValue removeAt(int pos) {
24204 throw new UnsupportedError("Cannot remove from immutable List.");
24205 }
24206
24207 _CSSValue removeLast() {
24208 throw new UnsupportedError("Cannot remove from immutable List.");
24209 }
24210
24211 bool remove(Object object) {
24212 throw new UnsupportedError("Cannot remove from immutable List.");
24213 }
24214
24215 void removeWhere(bool test(_CSSValue element)) {
24216 throw new UnsupportedError("Cannot remove from immutable List.");
24217 }
24218
24219 void retainWhere(bool test(_CSSValue element)) {
24220 throw new UnsupportedError("Cannot remove from immutable List.");
24221 }
24222
24223 void setRange(int start, int end, Iterable<_CSSValue> iterable, [int skipCount =0]) {
24224 throw new UnsupportedError("Cannot setRange on immutable List.");
24225 }
24226
24227 void removeRange(int start, int end) {
24228 throw new UnsupportedError("Cannot removeRange on immutable List.");
24229 }
24230
24231 void replaceRange(int start, int end, Iterable<_CSSValue> iterable) {
24232 throw new UnsupportedError("Cannot modify an immutable List.");
24233 }
24234
24235 void fillRange(int start, int end, [_CSSValue fillValue]) {
24236 throw new UnsupportedError("Cannot modify an immutable List.");
24237 }
24238
24239 Iterable<_CSSValue> getRange(int start, int end) =>
24240 IterableMixinWorkaround.getRangeList(this, start, end);
24241
24242 List<_CSSValue> sublist(int start, [int end]) {
24243 if (end == null) end = length;
24244 return Lists.getRange(this, start, end, <_CSSValue>[]);
24245 }
24246
24247 Map<int, _CSSValue> asMap() =>
24248 IterableMixinWorkaround.asMapList(this);
24249
24250 String toString() {
24251 StringBuffer buffer = new StringBuffer('[');
24252 buffer.writeAll(this, ', ');
24253 buffer.write(']');
24254 return buffer.toString();
24255 }
24256
24257 // -- end List<_CSSValue> mixins.
24258
24259 @DomName('CSSValueList.item')
24260 @DocsEditable
24261 _CSSValue item(int index) native;
24262 }
24263 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24264 // for details. All rights reserved. Use of this source code is governed by a
24265 // BSD-style license that can be found in the LICENSE file.
24266
24267
24268 @DocsEditable
24269 @DomName('DOMFileSystemSync')
24270 @SupportedBrowser(SupportedBrowser.CHROME)
24271 @Experimental
24272 abstract class _DOMFileSystemSync native "DOMFileSystemSync" {
24273 }
24274 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24275 // for details. All rights reserved. Use of this source code is governed by a
24276 // BSD-style license that can be found in the LICENSE file.
24277
24278
24279 @DocsEditable
24280 @DomName('DatabaseSync')
24281 @SupportedBrowser(SupportedBrowser.CHROME)
24282 @SupportedBrowser(SupportedBrowser.SAFARI)
24283 @Experimental
24284 abstract class _DatabaseSync native "DatabaseSync" {
24285 }
24286 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24287 // for details. All rights reserved. Use of this source code is governed by a
24288 // BSD-style license that can be found in the LICENSE file.
24289
24290
24291 @DocsEditable
24292 @DomName('DedicatedWorkerContext')
24293 abstract class _DedicatedWorkerContext extends _WorkerContext native "DedicatedW orkerContext" {
24294 }
24295 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24296 // for details. All rights reserved. Use of this source code is governed by a
24297 // BSD-style license that can be found in the LICENSE file.
24298
24299
24300 @DocsEditable
24301 @DomName('DirectoryEntrySync')
24302 abstract class _DirectoryEntrySync extends _EntrySync native "DirectoryEntrySync " {
24303 }
24304 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24305 // for details. All rights reserved. Use of this source code is governed by a
24306 // BSD-style license that can be found in the LICENSE file.
24307
24308
24309 @DocsEditable
24310 @DomName('DirectoryReaderSync')
24311 abstract class _DirectoryReaderSync native "DirectoryReaderSync" {
24312 }
24313 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24314 // for details. All rights reserved. Use of this source code is governed by a
24315 // BSD-style license that can be found in the LICENSE file.
24316
24317
24318 @DocsEditable
24319 @DomName('WebKitPoint')
24320 @SupportedBrowser(SupportedBrowser.CHROME)
24321 @SupportedBrowser(SupportedBrowser.SAFARI)
24322 @Experimental
24323 @SupportedBrowser(SupportedBrowser.CHROME)
24324 @SupportedBrowser(SupportedBrowser.SAFARI)
24325 @Experimental
24326 class _DomPoint native "WebKitPoint" {
24327
24328 @DomName('DOMPoint.DOMPoint')
24329 @DocsEditable
24330 factory _DomPoint(num x, num y) {
24331 return _DomPoint._create_1(x, y);
24332 }
24333 static _DomPoint _create_1(x, y) => JS('_DomPoint', 'new WebKitPoint(#,#)', x, y);
24334
24335 /// Checks if this type is supported on the current platform.
24336 static bool get supported => JS('bool', '!!(window.WebKitPoint)');
24337
24338 @DomName('DOMPoint.x')
24339 @DocsEditable
24340 num x;
24341
24342 @DomName('DOMPoint.y')
24343 @DocsEditable
24344 num y;
24345 }
24346 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24347 // for details. All rights reserved. Use of this source code is governed by a
24348 // BSD-style license that can be found in the LICENSE file.
24349
24350
24351 @DocsEditable
24352 @DomName('EntityReference')
24353 abstract class _EntityReference extends Node native "EntityReference" {
24354 }
24355 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24356 // for details. All rights reserved. Use of this source code is governed by a
24357 // BSD-style license that can be found in the LICENSE file.
24358
24359
24360 @DocsEditable
24361 @DomName('EntryArray')
24362 class _EntryArray implements JavaScriptIndexingBehavior, List<Entry> native "Ent ryArray" {
24363
24364 @DomName('EntryArray.length')
24365 @DocsEditable
24366 int get length => JS("int", "#.length", this);
24367
24368 Entry operator[](int index) => JS("Entry", "#[#]", this, index);
24369
24370 void operator[]=(int index, Entry value) {
24371 throw new UnsupportedError("Cannot assign element of immutable List.");
24372 }
24373 // -- start List<Entry> mixins.
24374 // Entry is the element type.
24375
24376 // From Iterable<Entry>:
24377
24378 Iterator<Entry> get iterator {
24379 // Note: NodeLists are not fixed size. And most probably length shouldn't
24380 // be cached in both iterator _and_ forEach method. For now caching it
24381 // for consistency.
24382 return new FixedSizeListIterator<Entry>(this);
24383 }
24384
24385 Entry reduce(Entry combine(Entry value, Entry element)) {
24386 return IterableMixinWorkaround.reduce(this, combine);
24387 }
24388
24389 dynamic fold(dynamic initialValue,
24390 dynamic combine(dynamic previousValue, Entry element)) {
24391 return IterableMixinWorkaround.fold(this, initialValue, combine);
24392 }
24393
24394 bool contains(Entry element) => IterableMixinWorkaround.contains(this, element );
24395
24396 void forEach(void f(Entry element)) => IterableMixinWorkaround.forEach(this, f );
24397
24398 String join([String separator = ""]) =>
24399 IterableMixinWorkaround.joinList(this, separator);
24400
24401 Iterable map(f(Entry element)) =>
24402 IterableMixinWorkaround.mapList(this, f);
24403
24404 Iterable<Entry> where(bool f(Entry element)) =>
24405 IterableMixinWorkaround.where(this, f);
24406
24407 Iterable expand(Iterable f(Entry element)) =>
24408 IterableMixinWorkaround.expand(this, f);
24409
24410 bool every(bool f(Entry element)) => IterableMixinWorkaround.every(this, f);
24411
24412 bool any(bool f(Entry element)) => IterableMixinWorkaround.any(this, f);
24413
24414 List<Entry> toList({ bool growable: true }) =>
24415 new List<Entry>.from(this, growable: growable);
24416
24417 Set<Entry> toSet() => new Set<Entry>.from(this);
24418
24419 bool get isEmpty => this.length == 0;
24420
24421 Iterable<Entry> take(int n) => IterableMixinWorkaround.takeList(this, n);
24422
24423 Iterable<Entry> takeWhile(bool test(Entry value)) {
24424 return IterableMixinWorkaround.takeWhile(this, test);
24425 }
24426
24427 Iterable<Entry> skip(int n) => IterableMixinWorkaround.skipList(this, n);
24428
24429 Iterable<Entry> skipWhile(bool test(Entry value)) {
24430 return IterableMixinWorkaround.skipWhile(this, test);
24431 }
24432
24433 Entry firstWhere(bool test(Entry value), { Entry orElse() }) {
24434 return IterableMixinWorkaround.firstWhere(this, test, orElse);
24435 }
24436
24437 Entry lastWhere(bool test(Entry value), {Entry orElse()}) {
24438 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
24439 }
24440
24441 Entry singleWhere(bool test(Entry value)) {
24442 return IterableMixinWorkaround.singleWhere(this, test);
24443 }
24444
24445 Entry elementAt(int index) {
24446 return this[index];
24447 }
24448
24449 // From Collection<Entry>:
24450
24451 void add(Entry value) {
24452 throw new UnsupportedError("Cannot add to immutable List.");
24453 }
24454
24455 void addAll(Iterable<Entry> iterable) {
24456 throw new UnsupportedError("Cannot add to immutable List.");
24457 }
24458
24459 // From List<Entry>:
24460 void set length(int value) {
24461 throw new UnsupportedError("Cannot resize immutable List.");
24462 }
24463
24464 void clear() {
24465 throw new UnsupportedError("Cannot clear immutable List.");
24466 }
24467
24468 Iterable<Entry> get reversed {
24469 return IterableMixinWorkaround.reversedList(this);
24470 }
24471
24472 void sort([int compare(Entry a, Entry b)]) {
24473 throw new UnsupportedError("Cannot sort immutable List.");
24474 }
24475
24476 int indexOf(Entry element, [int start = 0]) =>
24477 Lists.indexOf(this, element, start, this.length);
24478
24479 int lastIndexOf(Entry element, [int start]) {
24480 if (start == null) start = length - 1;
24481 return Lists.lastIndexOf(this, element, start);
24482 }
24483
24484 Entry get first {
24485 if (this.length > 0) return this[0];
24486 throw new StateError("No elements");
24487 }
24488
24489 Entry get last {
24490 if (this.length > 0) return this[this.length - 1];
24491 throw new StateError("No elements");
24492 }
24493
24494 Entry get single {
24495 if (length == 1) return this[0];
24496 if (length == 0) throw new StateError("No elements");
24497 throw new StateError("More than one element");
24498 }
24499
24500 void insert(int index, Entry element) {
24501 throw new UnsupportedError("Cannot add to immutable List.");
24502 }
24503
24504 void insertAll(int index, Iterable<Entry> iterable) {
24505 throw new UnsupportedError("Cannot add to immutable List.");
24506 }
24507
24508 void setAll(int index, Iterable<Entry> iterable) {
24509 throw new UnsupportedError("Cannot modify an immutable List.");
24510 }
24511
24512 Entry removeAt(int pos) {
24513 throw new UnsupportedError("Cannot remove from immutable List.");
24514 }
24515
24516 Entry removeLast() {
24517 throw new UnsupportedError("Cannot remove from immutable List.");
24518 }
24519
24520 bool remove(Object object) {
24521 throw new UnsupportedError("Cannot remove from immutable List.");
24522 }
24523
24524 void removeWhere(bool test(Entry element)) {
24525 throw new UnsupportedError("Cannot remove from immutable List.");
24526 }
24527
24528 void retainWhere(bool test(Entry element)) {
24529 throw new UnsupportedError("Cannot remove from immutable List.");
24530 }
24531
24532 void setRange(int start, int end, Iterable<Entry> iterable, [int skipCount=0]) {
24533 throw new UnsupportedError("Cannot setRange on immutable List.");
24534 }
24535
24536 void removeRange(int start, int end) {
24537 throw new UnsupportedError("Cannot removeRange on immutable List.");
24538 }
24539
24540 void replaceRange(int start, int end, Iterable<Entry> iterable) {
24541 throw new UnsupportedError("Cannot modify an immutable List.");
24542 }
24543
24544 void fillRange(int start, int end, [Entry fillValue]) {
24545 throw new UnsupportedError("Cannot modify an immutable List.");
24546 }
24547
24548 Iterable<Entry> getRange(int start, int end) =>
24549 IterableMixinWorkaround.getRangeList(this, start, end);
24550
24551 List<Entry> sublist(int start, [int end]) {
24552 if (end == null) end = length;
24553 return Lists.getRange(this, start, end, <Entry>[]);
24554 }
24555
24556 Map<int, Entry> asMap() =>
24557 IterableMixinWorkaround.asMapList(this);
24558
24559 String toString() {
24560 StringBuffer buffer = new StringBuffer('[');
24561 buffer.writeAll(this, ', ');
24562 buffer.write(']');
24563 return buffer.toString();
24564 }
24565
24566 // -- end List<Entry> mixins.
24567
24568 @DomName('EntryArray.item')
24569 @DocsEditable
24570 Entry item(int index) native;
24571 }
24572 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24573 // for details. All rights reserved. Use of this source code is governed by a
24574 // BSD-style license that can be found in the LICENSE file.
24575
24576
24577 @DocsEditable
24578 @DomName('EntryArraySync')
24579 class _EntryArraySync implements JavaScriptIndexingBehavior, List<_EntrySync> na tive "EntryArraySync" {
24580
24581 @DomName('EntryArraySync.length')
24582 @DocsEditable
24583 int get length => JS("int", "#.length", this);
24584
24585 _EntrySync operator[](int index) => JS("_EntrySync", "#[#]", this, index);
24586
24587 void operator[]=(int index, _EntrySync value) {
24588 throw new UnsupportedError("Cannot assign element of immutable List.");
24589 }
24590 // -- start List<_EntrySync> mixins.
24591 // _EntrySync is the element type.
24592
24593 // From Iterable<_EntrySync>:
24594
24595 Iterator<_EntrySync> get iterator {
24596 // Note: NodeLists are not fixed size. And most probably length shouldn't
24597 // be cached in both iterator _and_ forEach method. For now caching it
24598 // for consistency.
24599 return new FixedSizeListIterator<_EntrySync>(this);
24600 }
24601
24602 _EntrySync reduce(_EntrySync combine(_EntrySync value, _EntrySync element)) {
24603 return IterableMixinWorkaround.reduce(this, combine);
24604 }
24605
24606 dynamic fold(dynamic initialValue,
24607 dynamic combine(dynamic previousValue, _EntrySync element)) {
24608 return IterableMixinWorkaround.fold(this, initialValue, combine);
24609 }
24610
24611 bool contains(_EntrySync element) => IterableMixinWorkaround.contains(this, el ement);
24612
24613 void forEach(void f(_EntrySync element)) => IterableMixinWorkaround.forEach(th is, f);
24614
24615 String join([String separator = ""]) =>
24616 IterableMixinWorkaround.joinList(this, separator);
24617
24618 Iterable map(f(_EntrySync element)) =>
24619 IterableMixinWorkaround.mapList(this, f);
24620
24621 Iterable<_EntrySync> where(bool f(_EntrySync element)) =>
24622 IterableMixinWorkaround.where(this, f);
24623
24624 Iterable expand(Iterable f(_EntrySync element)) =>
24625 IterableMixinWorkaround.expand(this, f);
24626
24627 bool every(bool f(_EntrySync element)) => IterableMixinWorkaround.every(this, f);
24628
24629 bool any(bool f(_EntrySync element)) => IterableMixinWorkaround.any(this, f);
24630
24631 List<_EntrySync> toList({ bool growable: true }) =>
24632 new List<_EntrySync>.from(this, growable: growable);
24633
24634 Set<_EntrySync> toSet() => new Set<_EntrySync>.from(this);
24635
24636 bool get isEmpty => this.length == 0;
24637
24638 Iterable<_EntrySync> take(int n) => IterableMixinWorkaround.takeList(this, n);
24639
24640 Iterable<_EntrySync> takeWhile(bool test(_EntrySync value)) {
24641 return IterableMixinWorkaround.takeWhile(this, test);
24642 }
24643
24644 Iterable<_EntrySync> skip(int n) => IterableMixinWorkaround.skipList(this, n);
24645
24646 Iterable<_EntrySync> skipWhile(bool test(_EntrySync value)) {
24647 return IterableMixinWorkaround.skipWhile(this, test);
24648 }
24649
24650 _EntrySync firstWhere(bool test(_EntrySync value), { _EntrySync orElse() }) {
24651 return IterableMixinWorkaround.firstWhere(this, test, orElse);
24652 }
24653
24654 _EntrySync lastWhere(bool test(_EntrySync value), {_EntrySync orElse()}) {
24655 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
24656 }
24657
24658 _EntrySync singleWhere(bool test(_EntrySync value)) {
24659 return IterableMixinWorkaround.singleWhere(this, test);
24660 }
24661
24662 _EntrySync elementAt(int index) {
24663 return this[index];
24664 }
24665
24666 // From Collection<_EntrySync>:
24667
24668 void add(_EntrySync value) {
24669 throw new UnsupportedError("Cannot add to immutable List.");
24670 }
24671
24672 void addAll(Iterable<_EntrySync> iterable) {
24673 throw new UnsupportedError("Cannot add to immutable List.");
24674 }
24675
24676 // From List<_EntrySync>:
24677 void set length(int value) {
24678 throw new UnsupportedError("Cannot resize immutable List.");
24679 }
24680
24681 void clear() {
24682 throw new UnsupportedError("Cannot clear immutable List.");
24683 }
24684
24685 Iterable<_EntrySync> get reversed {
24686 return IterableMixinWorkaround.reversedList(this);
24687 }
24688
24689 void sort([int compare(_EntrySync a, _EntrySync b)]) {
24690 throw new UnsupportedError("Cannot sort immutable List.");
24691 }
24692
24693 int indexOf(_EntrySync element, [int start = 0]) =>
24694 Lists.indexOf(this, element, start, this.length);
24695
24696 int lastIndexOf(_EntrySync element, [int start]) {
24697 if (start == null) start = length - 1;
24698 return Lists.lastIndexOf(this, element, start);
24699 }
24700
24701 _EntrySync get first {
24702 if (this.length > 0) return this[0];
24703 throw new StateError("No elements");
24704 }
24705
24706 _EntrySync get last {
24707 if (this.length > 0) return this[this.length - 1];
24708 throw new StateError("No elements");
24709 }
24710
24711 _EntrySync get single {
24712 if (length == 1) return this[0];
24713 if (length == 0) throw new StateError("No elements");
24714 throw new StateError("More than one element");
24715 }
24716
24717 void insert(int index, _EntrySync element) {
24718 throw new UnsupportedError("Cannot add to immutable List.");
24719 }
24720
24721 void insertAll(int index, Iterable<_EntrySync> iterable) {
24722 throw new UnsupportedError("Cannot add to immutable List.");
24723 }
24724
24725 void setAll(int index, Iterable<_EntrySync> iterable) {
24726 throw new UnsupportedError("Cannot modify an immutable List.");
24727 }
24728
24729 _EntrySync removeAt(int pos) {
24730 throw new UnsupportedError("Cannot remove from immutable List.");
24731 }
24732
24733 _EntrySync removeLast() {
24734 throw new UnsupportedError("Cannot remove from immutable List.");
24735 }
24736
24737 bool remove(Object object) {
24738 throw new UnsupportedError("Cannot remove from immutable List.");
24739 }
24740
24741 void removeWhere(bool test(_EntrySync element)) {
24742 throw new UnsupportedError("Cannot remove from immutable List.");
24743 }
24744
24745 void retainWhere(bool test(_EntrySync element)) {
24746 throw new UnsupportedError("Cannot remove from immutable List.");
24747 }
24748
24749 void setRange(int start, int end, Iterable<_EntrySync> iterable, [int skipCoun t=0]) {
24750 throw new UnsupportedError("Cannot setRange on immutable List.");
24751 }
24752
24753 void removeRange(int start, int end) {
24754 throw new UnsupportedError("Cannot removeRange on immutable List.");
24755 }
24756
24757 void replaceRange(int start, int end, Iterable<_EntrySync> iterable) {
24758 throw new UnsupportedError("Cannot modify an immutable List.");
24759 }
24760
24761 void fillRange(int start, int end, [_EntrySync fillValue]) {
24762 throw new UnsupportedError("Cannot modify an immutable List.");
24763 }
24764
24765 Iterable<_EntrySync> getRange(int start, int end) =>
24766 IterableMixinWorkaround.getRangeList(this, start, end);
24767
24768 List<_EntrySync> sublist(int start, [int end]) {
24769 if (end == null) end = length;
24770 return Lists.getRange(this, start, end, <_EntrySync>[]);
24771 }
24772
24773 Map<int, _EntrySync> asMap() =>
24774 IterableMixinWorkaround.asMapList(this);
24775
24776 String toString() {
24777 StringBuffer buffer = new StringBuffer('[');
24778 buffer.writeAll(this, ', ');
24779 buffer.write(']');
24780 return buffer.toString();
24781 }
24782
24783 // -- end List<_EntrySync> mixins.
24784
24785 @DomName('EntryArraySync.item')
24786 @DocsEditable
24787 _EntrySync item(int index) native;
24788 }
24789 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24790 // for details. All rights reserved. Use of this source code is governed by a
24791 // BSD-style license that can be found in the LICENSE file.
24792
24793
24794 @DocsEditable
24795 @DomName('EntrySync')
24796 abstract class _EntrySync native "EntrySync" {
24797 }
24798 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24799 // for details. All rights reserved. Use of this source code is governed by a
24800 // BSD-style license that can be found in the LICENSE file.
24801
24802
24803 @DocsEditable
24804 @DomName('FileEntrySync')
24805 abstract class _FileEntrySync extends _EntrySync native "FileEntrySync" {
24806 }
24807 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24808 // for details. All rights reserved. Use of this source code is governed by a
24809 // BSD-style license that can be found in the LICENSE file.
24810
24811
24812 @DocsEditable
24813 @DomName('FileReaderSync')
24814 abstract class _FileReaderSync native "FileReaderSync" {
24815
24816 @DomName('FileReaderSync.FileReaderSync')
24817 @DocsEditable
24818 factory _FileReaderSync() {
24819 return _FileReaderSync._create_1();
24820 }
24821 static _FileReaderSync _create_1() => JS('_FileReaderSync', 'new FileReaderSyn c()');
24822 }
24823 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24824 // for details. All rights reserved. Use of this source code is governed by a
24825 // BSD-style license that can be found in the LICENSE file.
24826
24827
24828 @DocsEditable
24829 @DomName('FileWriterSync')
24830 abstract class _FileWriterSync native "FileWriterSync" {
24831 }
24832 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24833 // for details. All rights reserved. Use of this source code is governed by a
24834 // BSD-style license that can be found in the LICENSE file.
24835
24836
24837 @DocsEditable
24838 @DomName('GamepadList')
24839 class _GamepadList implements JavaScriptIndexingBehavior, List<Gamepad> native " GamepadList" {
24840
24841 @DomName('GamepadList.length')
24842 @DocsEditable
24843 int get length => JS("int", "#.length", this);
24844
24845 Gamepad operator[](int index) => JS("Gamepad", "#[#]", this, index);
24846
24847 void operator[]=(int index, Gamepad value) {
24848 throw new UnsupportedError("Cannot assign element of immutable List.");
24849 }
24850 // -- start List<Gamepad> mixins.
24851 // Gamepad is the element type.
24852
24853 // From Iterable<Gamepad>:
24854
24855 Iterator<Gamepad> get iterator {
24856 // Note: NodeLists are not fixed size. And most probably length shouldn't
24857 // be cached in both iterator _and_ forEach method. For now caching it
24858 // for consistency.
24859 return new FixedSizeListIterator<Gamepad>(this);
24860 }
24861
24862 Gamepad reduce(Gamepad combine(Gamepad value, Gamepad element)) {
24863 return IterableMixinWorkaround.reduce(this, combine);
24864 }
24865
24866 dynamic fold(dynamic initialValue,
24867 dynamic combine(dynamic previousValue, Gamepad element)) {
24868 return IterableMixinWorkaround.fold(this, initialValue, combine);
24869 }
24870
24871 bool contains(Gamepad element) => IterableMixinWorkaround.contains(this, eleme nt);
24872
24873 void forEach(void f(Gamepad element)) => IterableMixinWorkaround.forEach(this, f);
24874
24875 String join([String separator = ""]) =>
24876 IterableMixinWorkaround.joinList(this, separator);
24877
24878 Iterable map(f(Gamepad element)) =>
24879 IterableMixinWorkaround.mapList(this, f);
24880
24881 Iterable<Gamepad> where(bool f(Gamepad element)) =>
24882 IterableMixinWorkaround.where(this, f);
24883
24884 Iterable expand(Iterable f(Gamepad element)) =>
24885 IterableMixinWorkaround.expand(this, f);
24886
24887 bool every(bool f(Gamepad element)) => IterableMixinWorkaround.every(this, f);
24888
24889 bool any(bool f(Gamepad element)) => IterableMixinWorkaround.any(this, f);
24890
24891 List<Gamepad> toList({ bool growable: true }) =>
24892 new List<Gamepad>.from(this, growable: growable);
24893
24894 Set<Gamepad> toSet() => new Set<Gamepad>.from(this);
24895
24896 bool get isEmpty => this.length == 0;
24897
24898 Iterable<Gamepad> take(int n) => IterableMixinWorkaround.takeList(this, n);
24899
24900 Iterable<Gamepad> takeWhile(bool test(Gamepad value)) {
24901 return IterableMixinWorkaround.takeWhile(this, test);
24902 }
24903
24904 Iterable<Gamepad> skip(int n) => IterableMixinWorkaround.skipList(this, n);
24905
24906 Iterable<Gamepad> skipWhile(bool test(Gamepad value)) {
24907 return IterableMixinWorkaround.skipWhile(this, test);
24908 }
24909
24910 Gamepad firstWhere(bool test(Gamepad value), { Gamepad orElse() }) {
24911 return IterableMixinWorkaround.firstWhere(this, test, orElse);
24912 }
24913
24914 Gamepad lastWhere(bool test(Gamepad value), {Gamepad orElse()}) {
24915 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
24916 }
24917
24918 Gamepad singleWhere(bool test(Gamepad value)) {
24919 return IterableMixinWorkaround.singleWhere(this, test);
24920 }
24921
24922 Gamepad elementAt(int index) {
24923 return this[index];
24924 }
24925
24926 // From Collection<Gamepad>:
24927
24928 void add(Gamepad value) {
24929 throw new UnsupportedError("Cannot add to immutable List.");
24930 }
24931
24932 void addAll(Iterable<Gamepad> iterable) {
24933 throw new UnsupportedError("Cannot add to immutable List.");
24934 }
24935
24936 // From List<Gamepad>:
24937 void set length(int value) {
24938 throw new UnsupportedError("Cannot resize immutable List.");
24939 }
24940
24941 void clear() {
24942 throw new UnsupportedError("Cannot clear immutable List.");
24943 }
24944
24945 Iterable<Gamepad> get reversed {
24946 return IterableMixinWorkaround.reversedList(this);
24947 }
24948
24949 void sort([int compare(Gamepad a, Gamepad b)]) {
24950 throw new UnsupportedError("Cannot sort immutable List.");
24951 }
24952
24953 int indexOf(Gamepad element, [int start = 0]) =>
24954 Lists.indexOf(this, element, start, this.length);
24955
24956 int lastIndexOf(Gamepad element, [int start]) {
24957 if (start == null) start = length - 1;
24958 return Lists.lastIndexOf(this, element, start);
24959 }
24960
24961 Gamepad get first {
24962 if (this.length > 0) return this[0];
24963 throw new StateError("No elements");
24964 }
24965
24966 Gamepad get last {
24967 if (this.length > 0) return this[this.length - 1];
24968 throw new StateError("No elements");
24969 }
24970
24971 Gamepad get single {
24972 if (length == 1) return this[0];
24973 if (length == 0) throw new StateError("No elements");
24974 throw new StateError("More than one element");
24975 }
24976
24977 void insert(int index, Gamepad element) {
24978 throw new UnsupportedError("Cannot add to immutable List.");
24979 }
24980
24981 void insertAll(int index, Iterable<Gamepad> iterable) {
24982 throw new UnsupportedError("Cannot add to immutable List.");
24983 }
24984
24985 void setAll(int index, Iterable<Gamepad> iterable) {
24986 throw new UnsupportedError("Cannot modify an immutable List.");
24987 }
24988
24989 Gamepad removeAt(int pos) {
24990 throw new UnsupportedError("Cannot remove from immutable List.");
24991 }
24992
24993 Gamepad removeLast() {
24994 throw new UnsupportedError("Cannot remove from immutable List.");
24995 }
24996
24997 bool remove(Object object) {
24998 throw new UnsupportedError("Cannot remove from immutable List.");
24999 }
25000
25001 void removeWhere(bool test(Gamepad element)) {
25002 throw new UnsupportedError("Cannot remove from immutable List.");
25003 }
25004
25005 void retainWhere(bool test(Gamepad element)) {
25006 throw new UnsupportedError("Cannot remove from immutable List.");
25007 }
25008
25009 void setRange(int start, int end, Iterable<Gamepad> iterable, [int skipCount=0 ]) {
25010 throw new UnsupportedError("Cannot setRange on immutable List.");
25011 }
25012
25013 void removeRange(int start, int end) {
25014 throw new UnsupportedError("Cannot removeRange on immutable List.");
25015 }
25016
25017 void replaceRange(int start, int end, Iterable<Gamepad> iterable) {
25018 throw new UnsupportedError("Cannot modify an immutable List.");
25019 }
25020
25021 void fillRange(int start, int end, [Gamepad fillValue]) {
25022 throw new UnsupportedError("Cannot modify an immutable List.");
25023 }
25024
25025 Iterable<Gamepad> getRange(int start, int end) =>
25026 IterableMixinWorkaround.getRangeList(this, start, end);
25027
25028 List<Gamepad> sublist(int start, [int end]) {
25029 if (end == null) end = length;
25030 return Lists.getRange(this, start, end, <Gamepad>[]);
25031 }
25032
25033 Map<int, Gamepad> asMap() =>
25034 IterableMixinWorkaround.asMapList(this);
25035
25036 String toString() {
25037 StringBuffer buffer = new StringBuffer('[');
25038 buffer.writeAll(this, ', ');
25039 buffer.write(']');
25040 return buffer.toString();
25041 }
25042
25043 // -- end List<Gamepad> mixins.
25044
25045 @DomName('GamepadList.item')
25046 @DocsEditable
25047 Gamepad item(int index) native;
25048 }
25049 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25050 // for details. All rights reserved. Use of this source code is governed by a
25051 // BSD-style license that can be found in the LICENSE file. 21019 // BSD-style license that can be found in the LICENSE file.
25052 21020
25053 21021
25054 @DocsEditable 21022 @DocsEditable
25055 @DomName('HTMLAppletElement') 21023 @DomName('XPathEvaluator')
25056 abstract class _HTMLAppletElement extends Element native "HTMLAppletElement" { 21024 class XPathEvaluator native "XPathEvaluator" {
21025
21026 @DomName('XPathEvaluator.XPathEvaluator')
21027 @DocsEditable
21028 factory XPathEvaluator() {
21029 return XPathEvaluator._create_1();
21030 }
21031 static XPathEvaluator _create_1() => JS('XPathEvaluator', 'new XPathEvaluator( )');
21032
21033 @DomName('XPathEvaluator.createExpression')
21034 @DocsEditable
21035 XPathExpression createExpression(String expression, XPathNSResolver resolver) native;
21036
21037 @DomName('XPathEvaluator.createNSResolver')
21038 @DocsEditable
21039 XPathNSResolver createNSResolver(Node nodeResolver) native;
21040
21041 @DomName('XPathEvaluator.evaluate')
21042 @DocsEditable
21043 XPathResult evaluate(String expression, Node contextNode, XPathNSResolver reso lver, int type, XPathResult inResult) native;
25057 } 21044 }
25058 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21045 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25059 // for details. All rights reserved. Use of this source code is governed by a 21046 // for details. All rights reserved. Use of this source code is governed by a
25060 // BSD-style license that can be found in the LICENSE file.
25061
25062
25063 @DocsEditable
25064 @DomName('HTMLBaseFontElement')
25065 abstract class _HTMLBaseFontElement extends Element native "HTMLBaseFontElement" {
25066 }
25067 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25068 // for details. All rights reserved. Use of this source code is governed by a
25069 // BSD-style license that can be found in the LICENSE file. 21047 // BSD-style license that can be found in the LICENSE file.
25070 21048
25071 21049
25072 @DocsEditable 21050 @DocsEditable
25073 @DomName('HTMLDirectoryElement') 21051 @DomName('XPathException')
25074 abstract class _HTMLDirectoryElement extends Element native "HTMLDirectoryElemen t" { 21052 class XPathException native "XPathException" {
21053
21054 static const int INVALID_EXPRESSION_ERR = 51;
21055
21056 static const int TYPE_ERR = 52;
21057
21058 @DomName('XPathException.code')
21059 @DocsEditable
21060 final int code;
21061
21062 @DomName('XPathException.message')
21063 @DocsEditable
21064 final String message;
21065
21066 @DomName('XPathException.name')
21067 @DocsEditable
21068 final String name;
21069
21070 @DomName('XPathException.toString')
21071 @DocsEditable
21072 String toString() native;
25075 } 21073 }
25076 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21074 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25077 // for details. All rights reserved. Use of this source code is governed by a 21075 // for details. All rights reserved. Use of this source code is governed by a
25078 // BSD-style license that can be found in the LICENSE file.
25079
25080
25081 @DocsEditable
25082 @DomName('HTMLFontElement')
25083 abstract class _HTMLFontElement extends Element native "HTMLFontElement" {
25084 }
25085 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25086 // for details. All rights reserved. Use of this source code is governed by a
25087 // BSD-style license that can be found in the LICENSE file. 21076 // BSD-style license that can be found in the LICENSE file.
25088 21077
25089 21078
25090 @DocsEditable 21079 @DocsEditable
25091 @DomName('HTMLFrameElement') 21080 @DomName('XPathExpression')
25092 abstract class _HTMLFrameElement extends Element native "HTMLFrameElement" { 21081 class XPathExpression native "XPathExpression" {
21082
21083 @DomName('XPathExpression.evaluate')
21084 @DocsEditable
21085 XPathResult evaluate(Node contextNode, int type, XPathResult inResult) native;
25093 } 21086 }
25094 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21087 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25095 // for details. All rights reserved. Use of this source code is governed by a 21088 // for details. All rights reserved. Use of this source code is governed by a
25096 // BSD-style license that can be found in the LICENSE file. 21089 // BSD-style license that can be found in the LICENSE file.
25097 21090
25098 21091
25099 @DocsEditable 21092 @DocsEditable
25100 @DomName('HTMLFrameSetElement') 21093 @DomName('XPathNSResolver')
25101 abstract class _HTMLFrameSetElement extends Element native "HTMLFrameSetElement" { 21094 class XPathNSResolver native "XPathNSResolver" {
21095
21096 @JSName('lookupNamespaceURI')
21097 @DomName('XPathNSResolver.lookupNamespaceURI')
21098 @DocsEditable
21099 String lookupNamespaceUri(String prefix) native;
25102 } 21100 }
25103 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21101 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25104 // for details. All rights reserved. Use of this source code is governed by a 21102 // for details. All rights reserved. Use of this source code is governed by a
25105 // BSD-style license that can be found in the LICENSE file. 21103 // BSD-style license that can be found in the LICENSE file.
25106 21104
25107 21105
25108 @DocsEditable 21106 @DocsEditable
25109 @DomName('HTMLMarqueeElement') 21107 @DomName('XPathResult')
25110 abstract class _HTMLMarqueeElement extends Element native "HTMLMarqueeElement" { 21108 class XPathResult native "XPathResult" {
25111 } 21109
25112 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21110 static const int ANY_TYPE = 0;
25113 // for details. All rights reserved. Use of this source code is governed by a 21111
25114 // BSD-style license that can be found in the LICENSE file. 21112 static const int ANY_UNORDERED_NODE_TYPE = 8;
25115 21113
25116 21114 static const int BOOLEAN_TYPE = 3;
25117 @DocsEditable 21115
25118 @DomName('NamedNodeMap') 21116 static const int FIRST_ORDERED_NODE_TYPE = 9;
25119 class _NamedNodeMap implements JavaScriptIndexingBehavior, List<Node> native "Na medNodeMap" { 21117
25120 21118 static const int NUMBER_TYPE = 1;
25121 @DomName('NamedNodeMap.length') 21119
25122 @DocsEditable 21120 static const int ORDERED_NODE_ITERATOR_TYPE = 5;
25123 int get length => JS("int", "#.length", this); 21121
25124 21122 static const int ORDERED_NODE_SNAPSHOT_TYPE = 7;
25125 Node operator[](int index) => JS("Node", "#[#]", this, index); 21123
25126 21124 static const int STRING_TYPE = 2;
25127 void operator[]=(int index, Node value) { 21125
25128 throw new UnsupportedError("Cannot assign element of immutable List."); 21126 static const int UNORDERED_NODE_ITERATOR_TYPE = 4;
25129 } 21127
25130 // -- start List<Node> mixins. 21128 static const int UNORDERED_NODE_SNAPSHOT_TYPE = 6;
25131 // Node is the element type. 21129
25132 21130 @DomName('XPathResult.booleanValue')
25133 // From Iterable<Node>: 21131 @DocsEditable
25134 21132 final bool booleanValue;
25135 Iterator<Node> get iterator { 21133
25136 // Note: NodeLists are not fixed size. And most probably length shouldn't 21134 @DomName('XPathResult.invalidIteratorState')
25137 // be cached in both iterator _and_ forEach method. For now caching it 21135 @DocsEditable
25138 // for consistency. 21136 final bool invalidIteratorState;
25139 return new FixedSizeListIterator<Node>(this); 21137
25140 } 21138 @DomName('XPathResult.numberValue')
25141 21139 @DocsEditable
25142 Node reduce(Node combine(Node value, Node element)) { 21140 final num numberValue;
25143 return IterableMixinWorkaround.reduce(this, combine); 21141
25144 } 21142 @DomName('XPathResult.resultType')
25145 21143 @DocsEditable
25146 dynamic fold(dynamic initialValue, 21144 final int resultType;
25147 dynamic combine(dynamic previousValue, Node element)) { 21145
25148 return IterableMixinWorkaround.fold(this, initialValue, combine); 21146 @DomName('XPathResult.singleNodeValue')
25149 } 21147 @DocsEditable
25150 21148 final Node singleNodeValue;
25151 bool contains(Node element) => IterableMixinWorkaround.contains(this, element) ; 21149
25152 21150 @DomName('XPathResult.snapshotLength')
25153 void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f) ; 21151 @DocsEditable
25154 21152 final int snapshotLength;
25155 String join([String separator = ""]) => 21153
25156 IterableMixinWorkaround.joinList(this, separator); 21154 @DomName('XPathResult.stringValue')
25157 21155 @DocsEditable
25158 Iterable map(f(Node element)) => 21156 final String stringValue;
25159 IterableMixinWorkaround.mapList(this, f); 21157
25160 21158 @DomName('XPathResult.iterateNext')
25161 Iterable<Node> where(bool f(Node element)) => 21159 @DocsEditable
25162 IterableMixinWorkaround.where(this, f); 21160 Node iterateNext() native;
25163 21161
25164 Iterable expand(Iterable f(Node element)) => 21162 @DomName('XPathResult.snapshotItem')
25165 IterableMixinWorkaround.expand(this, f); 21163 @DocsEditable
25166 21164 Node snapshotItem(int index) native;
25167 bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f); 21165 }
25168 21166 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25169 bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f); 21167 // for details. All rights reserved. Use of this source code is governed by a
25170 21168 // BSD-style license that can be found in the LICENSE file.
25171 List<Node> toList({ bool growable: true }) => 21169
25172 new List<Node>.from(this, growable: growable); 21170
25173 21171 @DocsEditable
25174 Set<Node> toSet() => new Set<Node>.from(this); 21172 @DomName('XMLSerializer')
25175 21173 class XmlSerializer native "XMLSerializer" {
25176 bool get isEmpty => this.length == 0; 21174
25177 21175 @DomName('XMLSerializer.XMLSerializer')
25178 Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n); 21176 @DocsEditable
25179 21177 factory XmlSerializer() {
25180 Iterable<Node> takeWhile(bool test(Node value)) { 21178 return XmlSerializer._create_1();
25181 return IterableMixinWorkaround.takeWhile(this, test); 21179 }
25182 } 21180 static XmlSerializer _create_1() => JS('XmlSerializer', 'new XMLSerializer()') ;
25183 21181
25184 Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n); 21182 @DomName('XMLSerializer.serializeToString')
25185 21183 @DocsEditable
25186 Iterable<Node> skipWhile(bool test(Node value)) { 21184 String serializeToString(Node node) native;
25187 return IterableMixinWorkaround.skipWhile(this, test); 21185 }
25188 } 21186 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25189 21187 // for details. All rights reserved. Use of this source code is governed by a
25190 Node firstWhere(bool test(Node value), { Node orElse() }) { 21188 // BSD-style license that can be found in the LICENSE file.
25191 return IterableMixinWorkaround.firstWhere(this, test, orElse); 21189
25192 } 21190
25193 21191 @DocsEditable
25194 Node lastWhere(bool test(Node value), {Node orElse()}) { 21192 @DomName('XSLTProcessor')
25195 return IterableMixinWorkaround.lastWhereList(this, test, orElse); 21193 @SupportedBrowser(SupportedBrowser.CHROME)
25196 } 21194 @SupportedBrowser(SupportedBrowser.FIREFOX)
25197 21195 @SupportedBrowser(SupportedBrowser.SAFARI)
25198 Node singleWhere(bool test(Node value)) { 21196 class XsltProcessor native "XSLTProcessor" {
25199 return IterableMixinWorkaround.singleWhere(this, test); 21197
25200 } 21198 @DomName('XSLTProcessor.XSLTProcessor')
25201 21199 @DocsEditable
25202 Node elementAt(int index) { 21200 factory XsltProcessor() {
25203 return this[index]; 21201 return XsltProcessor._create_1();
25204 } 21202 }
25205 21203 static XsltProcessor _create_1() => JS('XsltProcessor', 'new XSLTProcessor()') ;
25206 // From Collection<Node>: 21204
25207 21205 /// Checks if this type is supported on the current platform.
25208 void add(Node value) { 21206 static bool get supported => JS('bool', '!!(window.XSLTProcessor)');
25209 throw new UnsupportedError("Cannot add to immutable List."); 21207
25210 } 21208 @DomName('XSLTProcessor.clearParameters')
25211 21209 @DocsEditable
25212 void addAll(Iterable<Node> iterable) { 21210 void clearParameters() native;
25213 throw new UnsupportedError("Cannot add to immutable List."); 21211
25214 } 21212 @DomName('XSLTProcessor.getParameter')
25215 21213 @DocsEditable
25216 // From List<Node>: 21214 String getParameter(String namespaceURI, String localName) native;
25217 void set length(int value) { 21215
25218 throw new UnsupportedError("Cannot resize immutable List."); 21216 @DomName('XSLTProcessor.importStylesheet')
25219 } 21217 @DocsEditable
25220 21218 void importStylesheet(Node stylesheet) native;
25221 void clear() { 21219
25222 throw new UnsupportedError("Cannot clear immutable List."); 21220 @DomName('XSLTProcessor.removeParameter')
25223 } 21221 @DocsEditable
25224 21222 void removeParameter(String namespaceURI, String localName) native;
25225 Iterable<Node> get reversed { 21223
25226 return IterableMixinWorkaround.reversedList(this); 21224 @DomName('XSLTProcessor.reset')
25227 } 21225 @DocsEditable
25228 21226 void reset() native;
25229 void sort([int compare(Node a, Node b)]) { 21227
25230 throw new UnsupportedError("Cannot sort immutable List."); 21228 @DomName('XSLTProcessor.setParameter')
25231 } 21229 @DocsEditable
25232 21230 void setParameter(String namespaceURI, String localName, String value) native;
25233 int indexOf(Node element, [int start = 0]) => 21231
25234 Lists.indexOf(this, element, start, this.length); 21232 @DomName('XSLTProcessor.transformToDocument')
25235 21233 @DocsEditable
25236 int lastIndexOf(Node element, [int start]) { 21234 Document transformToDocument(Node source) native;
25237 if (start == null) start = length - 1; 21235
25238 return Lists.lastIndexOf(this, element, start); 21236 @DomName('XSLTProcessor.transformToFragment')
25239 } 21237 @DocsEditable
25240 21238 DocumentFragment transformToFragment(Node source, Document docVal) native;
25241 Node get first { 21239 }
25242 if (this.length > 0) return this[0]; 21240 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25243 throw new StateError("No elements"); 21241 // for details. All rights reserved. Use of this source code is governed by a
25244 } 21242 // BSD-style license that can be found in the LICENSE file.
25245 21243
25246 Node get last { 21244
25247 if (this.length > 0) return this[this.length - 1]; 21245 @DocsEditable
25248 throw new StateError("No elements"); 21246 @DomName('CSSPrimitiveValue')
25249 } 21247 abstract class _CSSPrimitiveValue extends _CSSValue native "CSSPrimitiveValue" {
25250 21248 }
25251 Node get single { 21249 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25252 if (length == 1) return this[0]; 21250 // for details. All rights reserved. Use of this source code is governed by a
25253 if (length == 0) throw new StateError("No elements"); 21251 // BSD-style license that can be found in the LICENSE file.
25254 throw new StateError("More than one element"); 21252
25255 } 21253
25256 21254 @DocsEditable
25257 void insert(int index, Node element) { 21255 @DomName('CSSValue')
25258 throw new UnsupportedError("Cannot add to immutable List."); 21256 abstract class _CSSValue native "CSSValue" {
25259 } 21257 }
25260 21258 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
25261 void insertAll(int index, Iterable<Node> iterable) { 21259 // for details. All rights reserved. Use of this source code is governed by a
25262 throw new UnsupportedError("Cannot add to immutable List."); 21260 // BSD-style license that can be found in the LICENSE file.
25263 } 21261
25264 21262
25265 void setAll(int index, Iterable<Node> iterable) { 21263 @DocsEditable
25266 throw new UnsupportedError("Cannot modify an immutable List."); 21264 @DomName('ClientRect')
25267 } 21265 class _ClientRect implements Rect native "ClientRect" {
25268 21266
25269 Node removeAt(int pos) { 21267 // NOTE! All code below should be common with Rect.
25270 throw new UnsupportedError("Cannot remove from immutable List."); 21268 // TODO(blois): implement with mixins when available.
25271 }
25272
25273 Node removeLast() {
25274 throw new UnsupportedError("Cannot remove from immutable List.");
25275 }
25276
25277 bool remove(Object object) {
25278 throw new UnsupportedError("Cannot remove from immutable List.");
25279 }
25280
25281 void removeWhere(bool test(Node element)) {
25282 throw new UnsupportedError("Cannot remove from immutable List.");
25283 }
25284
25285 void retainWhere(bool test(Node element)) {
25286 throw new UnsupportedError("Cannot remove from immutable List.");
25287 }
25288
25289 void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
25290 throw new UnsupportedError("Cannot setRange on immutable List.");
25291 }
25292
25293 void removeRange(int start, int end) {
25294 throw new UnsupportedError("Cannot removeRange on immutable List.");
25295 }
25296
25297 void replaceRange(int start, int end, Iterable<Node> iterable) {
25298 throw new UnsupportedError("Cannot modify an immutable List.");
25299 }
25300
25301 void fillRange(int start, int end, [Node fillValue]) {
25302 throw new UnsupportedError("Cannot modify an immutable List.");
25303 }
25304
25305 Iterable<Node> getRange(int start, int end) =>
25306 IterableMixinWorkaround.getRangeList(this, start, end);
25307
25308 List<Node> sublist(int start, [int end]) {
25309 if (end == null) end = length;
25310 return Lists.getRange(this, start, end, <Node>[]);
25311 }
25312
25313 Map<int, Node> asMap() =>
25314 IterableMixinWorkaround.asMapList(this);
25315 21269
25316 String toString() { 21270 String toString() {
25317 StringBuffer buffer = new StringBuffer('['); 21271 return '($left, $top, $width, $height)';
25318 buffer.writeAll(this, ', '); 21272 }
25319 buffer.write(']'); 21273
25320 return buffer.toString(); 21274 bool operator ==(other) {
25321 } 21275 if (other is !Rect) return false;
25322 21276 return left == other.left && top == other.top && width == other.width &&
25323 // -- end List<Node> mixins. 21277 height == other.height;
25324 21278 }
25325 @DomName('NamedNodeMap.getNamedItem') 21279
25326 @DocsEditable 21280 /**
25327 Node getNamedItem(String name) native; 21281 * Computes the intersection of this rectangle and the rectangle parameter.
25328 21282 * Returns null if there is no intersection.
25329 @DomName('NamedNodeMap.getNamedItemNS') 21283 */
25330 @DocsEditable 21284 Rect intersection(Rect rect) {
25331 Node getNamedItemNS(String namespaceURI, String localName) native; 21285 var x0 = max(left, rect.left);
25332 21286 var x1 = min(left + width, rect.left + rect.width);
25333 @DomName('NamedNodeMap.item') 21287
25334 @DocsEditable 21288 if (x0 <= x1) {
25335 Node item(int index) native; 21289 var y0 = max(top, rect.top);
25336 21290 var y1 = min(top + height, rect.top + rect.height);
25337 @DomName('NamedNodeMap.removeNamedItem') 21291
25338 @DocsEditable 21292 if (y0 <= y1) {
25339 Node removeNamedItem(String name) native; 21293 return new Rect(x0, y0, x1 - x0, y1 - y0);
25340 21294 }
25341 @DomName('NamedNodeMap.removeNamedItemNS') 21295 }
25342 @DocsEditable 21296 return null;
25343 Node removeNamedItemNS(String namespaceURI, String localName) native; 21297 }
25344 21298
25345 @DomName('NamedNodeMap.setNamedItem') 21299
25346 @DocsEditable 21300 /**
25347 Node setNamedItem(Node node) native; 21301 * Returns whether a rectangle intersects this rectangle.
25348 21302 */
25349 @DomName('NamedNodeMap.setNamedItemNS') 21303 bool intersects(Rect other) {
25350 @DocsEditable 21304 return (left <= other.left + other.width && other.left <= left + width &&
25351 Node setNamedItemNS(Node node) native; 21305 top <= other.top + other.height && other.top <= top + height);
25352 } 21306 }
25353 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21307
25354 // for details. All rights reserved. Use of this source code is governed by a 21308 /**
25355 // BSD-style license that can be found in the LICENSE file. 21309 * Returns a new rectangle which completely contains this rectangle and the
25356 21310 * input rectangle.
25357 21311 */
25358 @DocsEditable 21312 Rect union(Rect rect) {
25359 @DomName('PagePopupController') 21313 var right = max(this.left + this.width, rect.left + rect.width);
25360 abstract class _PagePopupController native "PagePopupController" { 21314 var bottom = max(this.top + this.height, rect.top + rect.height);
25361 } 21315
25362 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21316 var left = min(this.left, rect.left);
25363 // for details. All rights reserved. Use of this source code is governed by a 21317 var top = min(this.top, rect.top);
21318
21319 return new Rect(left, top, right - left, bottom - top);
21320 }
21321
21322 /**
21323 * Tests whether this rectangle entirely contains another rectangle.
21324 */
21325 bool containsRect(Rect another) {
21326 return left <= another.left &&
21327 left + width >= another.left + another.width &&
21328 top <= another.top &&
21329 top + height >= another.top + another.height;
21330 }
21331
21332 /**
21333 * Tests whether this rectangle entirely contains a point.
21334 */
21335 bool containsPoint(Point another) {
21336 return another.x >= left &&
21337 another.x <= left + width &&
21338 another.y >= top &&
21339 another.y <= top + height;
21340 }
21341
21342 Rect ceil() => new Rect(left.ceil(), top.ceil(), width.ceil(), height.ceil());
21343 Rect floor() => new Rect(left.floor(), top.floor(), width.floor(),
21344 height.floor());
21345 Rect round() => new Rect(left.round(), top.round(), width.round(),
21346 height.round());
21347
21348 /**
21349 * Truncates coordinates to integers and returns the result as a new
21350 * rectangle.
21351 */
21352 Rect toInt() => new Rect(left.toInt(), top.toInt(), width.toInt(),
21353 height.toInt());
21354
21355 Point get topLeft => new Point(this.left, this.top);
21356 Point get bottomRight => new Point(this.left + this.width,
21357 this.top + this.height);
21358
21359 @DomName('ClientRect.bottom')
21360 @DocsEditable
21361 final num bottom;
21362
21363 @DomName('ClientRect.height')
21364 @DocsEditable
21365 final num height;
21366
21367 @DomName('ClientRect.left')
21368 @DocsEditable
21369 final num left;
21370
21371 @DomName('ClientRect.right')
21372 @DocsEditable
21373 final num right;
21374
21375 @DomName('ClientRect.top')
21376 @DocsEditable
21377 final num top;
21378
21379 @DomName('ClientRect.width')
21380 @DocsEditable
21381 final num width;
21382 }
21383 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21384 // for details. All rights reserved. Use of this source code is governed by a
25364 // BSD-style license that can be found in the LICENSE file. 21385 // BSD-style license that can be found in the LICENSE file.
25365 21386
25366 21387
25367 @DocsEditable 21388 @DocsEditable
25368 @DomName('RGBColor') 21389 @DomName('ClientRectList')
25369 abstract class _RGBColor native "RGBColor" { 21390 class _ClientRectList extends Object with ListMixin<Rect>, ImmutableListMixin<Re ct> implements JavaScriptIndexingBehavior, List<Rect> native "ClientRectList" {
25370 } 21391
25371 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 21392 @DomName('ClientRectList.length')
25372 // for details. All rights reserved. Use of this source code is governed by a 21393 @DocsEditable
25373 // BSD-style license that can be found in the LICENSE file. 21394 int get length => JS("int", "#.length", this);
21395
21396 Rect operator[](int index) => JS("Rect", "#[#]", this, index);
21397
21398 void operator[]=(int index, Rect value) {
21399 throw new UnsupportedError("Cannot assign element of immutable List.");
21400 }
21401 // -- start List<Rect> mixins.
21402 // Rect is the element type.
25374 21403
25375 21404
25376 // Omit RadioNodeList for dart2js. The Dart Form and FieldSet APIs don't 21405 void set length(int value) {
25377 // currently expose an API the returns RadioNodeList. The only use of a 21406 throw new UnsupportedError("Cannot resize immutable List.");
25378 // RadioNodeList is to get the selected value and it will be cleaner to 21407 }
25379 // introduce a different API for that purpose.
25380 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25381 // for details. All rights reserved. Use of this source code is governed by a
25382 // BSD-style license that can be found in the LICENSE file.
25383 21408
21409 // -- end List<Rect> mixins.
25384 21410
25385 @DocsEditable 21411 @DomName('ClientRectList.item')
25386 @DomName('Rect') 21412 @DocsEditable
25387 abstract class _Rect native "Rect" { 21413 Rect item(int index) native;
25388 } 21414 }
25389 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21415 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25390 // for details. All rights reserved. Use of this source code is governed by a 21416 // for details. All rights reserved. Use of this source code is governed by a
25391 // BSD-style license that can be found in the LICENSE file.
25392
25393
25394 @DocsEditable
25395 @DomName('SharedWorker')
25396 abstract class _SharedWorker extends AbstractWorker native "SharedWorker" {
25397
25398 @DomName('SharedWorker.SharedWorker')
25399 @DocsEditable
25400 factory _SharedWorker(String scriptURL, [String name]) {
25401 if (?name) {
25402 return _SharedWorker._create_1(scriptURL, name);
25403 }
25404 return _SharedWorker._create_2(scriptURL);
25405 }
25406 static _SharedWorker _create_1(scriptURL, name) => JS('_SharedWorker', 'new Sh aredWorker(#,#)', scriptURL, name);
25407 static _SharedWorker _create_2(scriptURL) => JS('_SharedWorker', 'new SharedWo rker(#)', scriptURL);
25408 }
25409 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25410 // for details. All rights reserved. Use of this source code is governed by a
25411 // BSD-style license that can be found in the LICENSE file. 21417 // BSD-style license that can be found in the LICENSE file.
25412 21418
25413 21419
25414 @DocsEditable 21420 @DocsEditable
25415 @DomName('SharedWorkerContext') 21421 @DomName('Counter')
25416 abstract class _SharedWorkerContext extends _WorkerContext native "SharedWorkerC ontext" { 21422 abstract class _Counter native "Counter" {
25417 } 21423 }
25418 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21424 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25419 // for details. All rights reserved. Use of this source code is governed by a 21425 // for details. All rights reserved. Use of this source code is governed by a
25420 // BSD-style license that can be found in the LICENSE file. 21426 // BSD-style license that can be found in the LICENSE file.
25421 21427
25422 21428
25423 @DocsEditable 21429 @DocsEditable
25424 @DomName('SpeechInputResultList') 21430 @DomName('CSSRuleList')
25425 class _SpeechInputResultList implements JavaScriptIndexingBehavior, List<SpeechI nputResult> native "SpeechInputResultList" { 21431 class _CssRuleList extends Object with ListMixin<CssRule>, ImmutableListMixin<Cs sRule> implements JavaScriptIndexingBehavior, List<CssRule> native "CSSRuleList" {
25426 21432
25427 @DomName('SpeechInputResultList.length') 21433 @DomName('CSSRuleList.length')
25428 @DocsEditable 21434 @DocsEditable
25429 int get length => JS("int", "#.length", this); 21435 int get length => JS("int", "#.length", this);
25430 21436
25431 SpeechInputResult operator[](int index) => JS("SpeechInputResult", "#[#]", thi s, index); 21437 CssRule operator[](int index) => JS("CssRule", "#[#]", this, index);
25432 21438
25433 void operator[]=(int index, SpeechInputResult value) { 21439 void operator[]=(int index, CssRule value) {
25434 throw new UnsupportedError("Cannot assign element of immutable List."); 21440 throw new UnsupportedError("Cannot assign element of immutable List.");
25435 } 21441 }
25436 // -- start List<SpeechInputResult> mixins. 21442 // -- start List<CssRule> mixins.
25437 // SpeechInputResult is the element type. 21443 // CssRule is the element type.
25438 21444
25439 // From Iterable<SpeechInputResult>:
25440 21445
25441 Iterator<SpeechInputResult> get iterator {
25442 // Note: NodeLists are not fixed size. And most probably length shouldn't
25443 // be cached in both iterator _and_ forEach method. For now caching it
25444 // for consistency.
25445 return new FixedSizeListIterator<SpeechInputResult>(this);
25446 }
25447
25448 SpeechInputResult reduce(SpeechInputResult combine(SpeechInputResult value, Sp eechInputResult element)) {
25449 return IterableMixinWorkaround.reduce(this, combine);
25450 }
25451
25452 dynamic fold(dynamic initialValue,
25453 dynamic combine(dynamic previousValue, SpeechInputResult element) ) {
25454 return IterableMixinWorkaround.fold(this, initialValue, combine);
25455 }
25456
25457 bool contains(SpeechInputResult element) => IterableMixinWorkaround.contains(t his, element);
25458
25459 void forEach(void f(SpeechInputResult element)) => IterableMixinWorkaround.for Each(this, f);
25460
25461 String join([String separator = ""]) =>
25462 IterableMixinWorkaround.joinList(this, separator);
25463
25464 Iterable map(f(SpeechInputResult element)) =>
25465 IterableMixinWorkaround.mapList(this, f);
25466
25467 Iterable<SpeechInputResult> where(bool f(SpeechInputResult element)) =>
25468 IterableMixinWorkaround.where(this, f);
25469
25470 Iterable expand(Iterable f(SpeechInputResult element)) =>
25471 IterableMixinWorkaround.expand(this, f);
25472
25473 bool every(bool f(SpeechInputResult element)) => IterableMixinWorkaround.every (this, f);
25474
25475 bool any(bool f(SpeechInputResult element)) => IterableMixinWorkaround.any(thi s, f);
25476
25477 List<SpeechInputResult> toList({ bool growable: true }) =>
25478 new List<SpeechInputResult>.from(this, growable: growable);
25479
25480 Set<SpeechInputResult> toSet() => new Set<SpeechInputResult>.from(this);
25481
25482 bool get isEmpty => this.length == 0;
25483
25484 Iterable<SpeechInputResult> take(int n) => IterableMixinWorkaround.takeList(th is, n);
25485
25486 Iterable<SpeechInputResult> takeWhile(bool test(SpeechInputResult value)) {
25487 return IterableMixinWorkaround.takeWhile(this, test);
25488 }
25489
25490 Iterable<SpeechInputResult> skip(int n) => IterableMixinWorkaround.skipList(th is, n);
25491
25492 Iterable<SpeechInputResult> skipWhile(bool test(SpeechInputResult value)) {
25493 return IterableMixinWorkaround.skipWhile(this, test);
25494 }
25495
25496 SpeechInputResult firstWhere(bool test(SpeechInputResult value), { SpeechInput Result orElse() }) {
25497 return IterableMixinWorkaround.firstWhere(this, test, orElse);
25498 }
25499
25500 SpeechInputResult lastWhere(bool test(SpeechInputResult value), {SpeechInputRe sult orElse()}) {
25501 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
25502 }
25503
25504 SpeechInputResult singleWhere(bool test(SpeechInputResult value)) {
25505 return IterableMixinWorkaround.singleWhere(this, test);
25506 }
25507
25508 SpeechInputResult elementAt(int index) {
25509 return this[index];
25510 }
25511
25512 // From Collection<SpeechInputResult>:
25513
25514 void add(SpeechInputResult value) {
25515 throw new UnsupportedError("Cannot add to immutable List.");
25516 }
25517
25518 void addAll(Iterable<SpeechInputResult> iterable) {
25519 throw new UnsupportedError("Cannot add to immutable List.");
25520 }
25521
25522 // From List<SpeechInputResult>:
25523 void set length(int value) { 21446 void set length(int value) {
25524 throw new UnsupportedError("Cannot resize immutable List."); 21447 throw new UnsupportedError("Cannot resize immutable List.");
25525 } 21448 }
25526 21449
25527 void clear() { 21450 // -- end List<CssRule> mixins.
25528 throw new UnsupportedError("Cannot clear immutable List.");
25529 }
25530 21451
25531 Iterable<SpeechInputResult> get reversed { 21452 @DomName('CSSRuleList.item')
25532 return IterableMixinWorkaround.reversedList(this);
25533 }
25534
25535 void sort([int compare(SpeechInputResult a, SpeechInputResult b)]) {
25536 throw new UnsupportedError("Cannot sort immutable List.");
25537 }
25538
25539 int indexOf(SpeechInputResult element, [int start = 0]) =>
25540 Lists.indexOf(this, element, start, this.length);
25541
25542 int lastIndexOf(SpeechInputResult element, [int start]) {
25543 if (start == null) start = length - 1;
25544 return Lists.lastIndexOf(this, element, start);
25545 }
25546
25547 SpeechInputResult get first {
25548 if (this.length > 0) return this[0];
25549 throw new StateError("No elements");
25550 }
25551
25552 SpeechInputResult get last {
25553 if (this.length > 0) return this[this.length - 1];
25554 throw new StateError("No elements");
25555 }
25556
25557 SpeechInputResult get single {
25558 if (length == 1) return this[0];
25559 if (length == 0) throw new StateError("No elements");
25560 throw new StateError("More than one element");
25561 }
25562
25563 void insert(int index, SpeechInputResult element) {
25564 throw new UnsupportedError("Cannot add to immutable List.");
25565 }
25566
25567 void insertAll(int index, Iterable<SpeechInputResult> iterable) {
25568 throw new UnsupportedError("Cannot add to immutable List.");
25569 }
25570
25571 void setAll(int index, Iterable<SpeechInputResult> iterable) {
25572 throw new UnsupportedError("Cannot modify an immutable List.");
25573 }
25574
25575 SpeechInputResult removeAt(int pos) {
25576 throw new UnsupportedError("Cannot remove from immutable List.");
25577 }
25578
25579 SpeechInputResult removeLast() {
25580 throw new UnsupportedError("Cannot remove from immutable List.");
25581 }
25582
25583 bool remove(Object object) {
25584 throw new UnsupportedError("Cannot remove from immutable List.");
25585 }
25586
25587 void removeWhere(bool test(SpeechInputResult element)) {
25588 throw new UnsupportedError("Cannot remove from immutable List.");
25589 }
25590
25591 void retainWhere(bool test(SpeechInputResult element)) {
25592 throw new UnsupportedError("Cannot remove from immutable List.");
25593 }
25594
25595 void setRange(int start, int end, Iterable<SpeechInputResult> iterable, [int s kipCount=0]) {
25596 throw new UnsupportedError("Cannot setRange on immutable List.");
25597 }
25598
25599 void removeRange(int start, int end) {
25600 throw new UnsupportedError("Cannot removeRange on immutable List.");
25601 }
25602
25603 void replaceRange(int start, int end, Iterable<SpeechInputResult> iterable) {
25604 throw new UnsupportedError("Cannot modify an immutable List.");
25605 }
25606
25607 void fillRange(int start, int end, [SpeechInputResult fillValue]) {
25608 throw new UnsupportedError("Cannot modify an immutable List.");
25609 }
25610
25611 Iterable<SpeechInputResult> getRange(int start, int end) =>
25612 IterableMixinWorkaround.getRangeList(this, start, end);
25613
25614 List<SpeechInputResult> sublist(int start, [int end]) {
25615 if (end == null) end = length;
25616 return Lists.getRange(this, start, end, <SpeechInputResult>[]);
25617 }
25618
25619 Map<int, SpeechInputResult> asMap() =>
25620 IterableMixinWorkaround.asMapList(this);
25621
25622 String toString() {
25623 StringBuffer buffer = new StringBuffer('[');
25624 buffer.writeAll(this, ', ');
25625 buffer.write(']');
25626 return buffer.toString();
25627 }
25628
25629 // -- end List<SpeechInputResult> mixins.
25630
25631 @DomName('SpeechInputResultList.item')
25632 @DocsEditable 21453 @DocsEditable
25633 SpeechInputResult item(int index) native; 21454 CssRule item(int index) native;
25634 } 21455 }
25635 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21456 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25636 // for details. All rights reserved. Use of this source code is governed by a 21457 // for details. All rights reserved. Use of this source code is governed by a
21458 // BSD-style license that can be found in the LICENSE file.
21459
21460
21461 @DocsEditable
21462 @DomName('CSSValueList')
21463 class _CssValueList extends _CSSValue with ListMixin<_CSSValue>, ImmutableListMi xin<_CSSValue> implements JavaScriptIndexingBehavior, List<_CSSValue> native "CS SValueList" {
21464
21465 @DomName('CSSValueList.length')
21466 @DocsEditable
21467 int get length => JS("int", "#.length", this);
21468
21469 _CSSValue operator[](int index) => JS("_CSSValue", "#[#]", this, index);
21470
21471 void operator[]=(int index, _CSSValue value) {
21472 throw new UnsupportedError("Cannot assign element of immutable List.");
21473 }
21474 // -- start List<_CSSValue> mixins.
21475 // _CSSValue is the element type.
21476
21477
21478 void set length(int value) {
21479 throw new UnsupportedError("Cannot resize immutable List.");
21480 }
21481
21482 // -- end List<_CSSValue> mixins.
21483
21484 @DomName('CSSValueList.item')
21485 @DocsEditable
21486 _CSSValue item(int index) native;
21487 }
21488 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21489 // for details. All rights reserved. Use of this source code is governed by a
21490 // BSD-style license that can be found in the LICENSE file.
21491
21492
21493 @DocsEditable
21494 @DomName('DOMFileSystemSync')
21495 @SupportedBrowser(SupportedBrowser.CHROME)
21496 @Experimental
21497 abstract class _DOMFileSystemSync native "DOMFileSystemSync" {
21498 }
21499 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21500 // for details. All rights reserved. Use of this source code is governed by a
21501 // BSD-style license that can be found in the LICENSE file.
21502
21503
21504 @DocsEditable
21505 @DomName('DatabaseSync')
21506 @SupportedBrowser(SupportedBrowser.CHROME)
21507 @SupportedBrowser(SupportedBrowser.SAFARI)
21508 @Experimental
21509 abstract class _DatabaseSync native "DatabaseSync" {
21510 }
21511 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21512 // for details. All rights reserved. Use of this source code is governed by a
21513 // BSD-style license that can be found in the LICENSE file.
21514
21515
21516 @DocsEditable
21517 @DomName('DedicatedWorkerContext')
21518 abstract class _DedicatedWorkerContext extends _WorkerContext native "DedicatedW orkerContext" {
21519 }
21520 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21521 // for details. All rights reserved. Use of this source code is governed by a
21522 // BSD-style license that can be found in the LICENSE file.
21523
21524
21525 @DocsEditable
21526 @DomName('DirectoryEntrySync')
21527 abstract class _DirectoryEntrySync extends _EntrySync native "DirectoryEntrySync " {
21528 }
21529 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21530 // for details. All rights reserved. Use of this source code is governed by a
21531 // BSD-style license that can be found in the LICENSE file.
21532
21533
21534 @DocsEditable
21535 @DomName('DirectoryReaderSync')
21536 abstract class _DirectoryReaderSync native "DirectoryReaderSync" {
21537 }
21538 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21539 // for details. All rights reserved. Use of this source code is governed by a
21540 // BSD-style license that can be found in the LICENSE file.
21541
21542
21543 @DocsEditable
21544 @DomName('WebKitPoint')
21545 @SupportedBrowser(SupportedBrowser.CHROME)
21546 @SupportedBrowser(SupportedBrowser.SAFARI)
21547 @Experimental
21548 @SupportedBrowser(SupportedBrowser.CHROME)
21549 @SupportedBrowser(SupportedBrowser.SAFARI)
21550 @Experimental
21551 class _DomPoint native "WebKitPoint" {
21552
21553 @DomName('DOMPoint.DOMPoint')
21554 @DocsEditable
21555 factory _DomPoint(num x, num y) {
21556 return _DomPoint._create_1(x, y);
21557 }
21558 static _DomPoint _create_1(x, y) => JS('_DomPoint', 'new WebKitPoint(#,#)', x, y);
21559
21560 /// Checks if this type is supported on the current platform.
21561 static bool get supported => JS('bool', '!!(window.WebKitPoint)');
21562
21563 @DomName('DOMPoint.x')
21564 @DocsEditable
21565 num x;
21566
21567 @DomName('DOMPoint.y')
21568 @DocsEditable
21569 num y;
21570 }
21571 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21572 // for details. All rights reserved. Use of this source code is governed by a
21573 // BSD-style license that can be found in the LICENSE file.
21574
21575
21576 @DocsEditable
21577 @DomName('EntityReference')
21578 abstract class _EntityReference extends Node native "EntityReference" {
21579 }
21580 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21581 // for details. All rights reserved. Use of this source code is governed by a
25637 // BSD-style license that can be found in the LICENSE file. 21582 // BSD-style license that can be found in the LICENSE file.
25638 21583
25639 21584
25640 @DocsEditable 21585 @DocsEditable
25641 @DomName('SpeechRecognitionResultList') 21586 @DomName('EntryArray')
25642 class _SpeechRecognitionResultList implements JavaScriptIndexingBehavior, List<S peechRecognitionResult> native "SpeechRecognitionResultList" { 21587 class _EntryArray extends Object with ListMixin<Entry>, ImmutableListMixin<Entry > implements JavaScriptIndexingBehavior, List<Entry> native "EntryArray" {
25643 21588
25644 @DomName('SpeechRecognitionResultList.length') 21589 @DomName('EntryArray.length')
25645 @DocsEditable 21590 @DocsEditable
25646 int get length => JS("int", "#.length", this); 21591 int get length => JS("int", "#.length", this);
25647 21592
25648 SpeechRecognitionResult operator[](int index) => JS("SpeechRecognitionResult", "#[#]", this, index); 21593 Entry operator[](int index) => JS("Entry", "#[#]", this, index);
25649 21594
25650 void operator[]=(int index, SpeechRecognitionResult value) { 21595 void operator[]=(int index, Entry value) {
25651 throw new UnsupportedError("Cannot assign element of immutable List."); 21596 throw new UnsupportedError("Cannot assign element of immutable List.");
25652 } 21597 }
25653 // -- start List<SpeechRecognitionResult> mixins. 21598 // -- start List<Entry> mixins.
25654 // SpeechRecognitionResult is the element type. 21599 // Entry is the element type.
25655 21600
25656 // From Iterable<SpeechRecognitionResult>: 21601
25657
25658 Iterator<SpeechRecognitionResult> get iterator {
25659 // Note: NodeLists are not fixed size. And most probably length shouldn't
25660 // be cached in both iterator _and_ forEach method. For now caching it
25661 // for consistency.
25662 return new FixedSizeListIterator<SpeechRecognitionResult>(this);
25663 }
25664
25665 SpeechRecognitionResult reduce(SpeechRecognitionResult combine(SpeechRecogniti onResult value, SpeechRecognitionResult element)) {
25666 return IterableMixinWorkaround.reduce(this, combine);
25667 }
25668
25669 dynamic fold(dynamic initialValue,
25670 dynamic combine(dynamic previousValue, SpeechRecognitionResult el ement)) {
25671 return IterableMixinWorkaround.fold(this, initialValue, combine);
25672 }
25673
25674 bool contains(SpeechRecognitionResult element) => IterableMixinWorkaround.cont ains(this, element);
25675
25676 void forEach(void f(SpeechRecognitionResult element)) => IterableMixinWorkarou nd.forEach(this, f);
25677
25678 String join([String separator = ""]) =>
25679 IterableMixinWorkaround.joinList(this, separator);
25680
25681 Iterable map(f(SpeechRecognitionResult element)) =>
25682 IterableMixinWorkaround.mapList(this, f);
25683
25684 Iterable<SpeechRecognitionResult> where(bool f(SpeechRecognitionResult element )) =>
25685 IterableMixinWorkaround.where(this, f);
25686
25687 Iterable expand(Iterable f(SpeechRecognitionResult element)) =>
25688 IterableMixinWorkaround.expand(this, f);
25689
25690 bool every(bool f(SpeechRecognitionResult element)) => IterableMixinWorkaround .every(this, f);
25691
25692 bool any(bool f(SpeechRecognitionResult element)) => IterableMixinWorkaround.a ny(this, f);
25693
25694 List<SpeechRecognitionResult> toList({ bool growable: true }) =>
25695 new List<SpeechRecognitionResult>.from(this, growable: growable);
25696
25697 Set<SpeechRecognitionResult> toSet() => new Set<SpeechRecognitionResult>.from( this);
25698
25699 bool get isEmpty => this.length == 0;
25700
25701 Iterable<SpeechRecognitionResult> take(int n) => IterableMixinWorkaround.takeL ist(this, n);
25702
25703 Iterable<SpeechRecognitionResult> takeWhile(bool test(SpeechRecognitionResult value)) {
25704 return IterableMixinWorkaround.takeWhile(this, test);
25705 }
25706
25707 Iterable<SpeechRecognitionResult> skip(int n) => IterableMixinWorkaround.skipL ist(this, n);
25708
25709 Iterable<SpeechRecognitionResult> skipWhile(bool test(SpeechRecognitionResult value)) {
25710 return IterableMixinWorkaround.skipWhile(this, test);
25711 }
25712
25713 SpeechRecognitionResult firstWhere(bool test(SpeechRecognitionResult value), { SpeechRecognitionResult orElse() }) {
25714 return IterableMixinWorkaround.firstWhere(this, test, orElse);
25715 }
25716
25717 SpeechRecognitionResult lastWhere(bool test(SpeechRecognitionResult value), {S peechRecognitionResult orElse()}) {
25718 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
25719 }
25720
25721 SpeechRecognitionResult singleWhere(bool test(SpeechRecognitionResult value)) {
25722 return IterableMixinWorkaround.singleWhere(this, test);
25723 }
25724
25725 SpeechRecognitionResult elementAt(int index) {
25726 return this[index];
25727 }
25728
25729 // From Collection<SpeechRecognitionResult>:
25730
25731 void add(SpeechRecognitionResult value) {
25732 throw new UnsupportedError("Cannot add to immutable List.");
25733 }
25734
25735 void addAll(Iterable<SpeechRecognitionResult> iterable) {
25736 throw new UnsupportedError("Cannot add to immutable List.");
25737 }
25738
25739 // From List<SpeechRecognitionResult>:
25740 void set length(int value) { 21602 void set length(int value) {
25741 throw new UnsupportedError("Cannot resize immutable List."); 21603 throw new UnsupportedError("Cannot resize immutable List.");
25742 } 21604 }
25743 21605
25744 void clear() { 21606 // -- end List<Entry> mixins.
25745 throw new UnsupportedError("Cannot clear immutable List."); 21607
25746 } 21608 @DomName('EntryArray.item')
25747 21609 @DocsEditable
25748 Iterable<SpeechRecognitionResult> get reversed { 21610 Entry item(int index) native;
25749 return IterableMixinWorkaround.reversedList(this); 21611 }
25750 } 21612 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25751 21613 // for details. All rights reserved. Use of this source code is governed by a
25752 void sort([int compare(SpeechRecognitionResult a, SpeechRecognitionResult b)]) { 21614 // BSD-style license that can be found in the LICENSE file.
25753 throw new UnsupportedError("Cannot sort immutable List."); 21615
25754 } 21616
25755 21617 @DocsEditable
25756 int indexOf(SpeechRecognitionResult element, [int start = 0]) => 21618 @DomName('EntryArraySync')
25757 Lists.indexOf(this, element, start, this.length); 21619 class _EntryArraySync extends Object with ListMixin<_EntrySync>, ImmutableListMi xin<_EntrySync> implements JavaScriptIndexingBehavior, List<_EntrySync> native " EntryArraySync" {
25758 21620
25759 int lastIndexOf(SpeechRecognitionResult element, [int start]) { 21621 @DomName('EntryArraySync.length')
25760 if (start == null) start = length - 1; 21622 @DocsEditable
25761 return Lists.lastIndexOf(this, element, start); 21623 int get length => JS("int", "#.length", this);
25762 } 21624
25763 21625 _EntrySync operator[](int index) => JS("_EntrySync", "#[#]", this, index);
25764 SpeechRecognitionResult get first { 21626
25765 if (this.length > 0) return this[0]; 21627 void operator[]=(int index, _EntrySync value) {
25766 throw new StateError("No elements"); 21628 throw new UnsupportedError("Cannot assign element of immutable List.");
25767 } 21629 }
25768 21630 // -- start List<_EntrySync> mixins.
25769 SpeechRecognitionResult get last { 21631 // _EntrySync is the element type.
25770 if (this.length > 0) return this[this.length - 1]; 21632
25771 throw new StateError("No elements"); 21633
25772 } 21634 void set length(int value) {
25773 21635 throw new UnsupportedError("Cannot resize immutable List.");
25774 SpeechRecognitionResult get single { 21636 }
25775 if (length == 1) return this[0]; 21637
25776 if (length == 0) throw new StateError("No elements"); 21638 // -- end List<_EntrySync> mixins.
25777 throw new StateError("More than one element"); 21639
25778 } 21640 @DomName('EntryArraySync.item')
25779 21641 @DocsEditable
25780 void insert(int index, SpeechRecognitionResult element) { 21642 _EntrySync item(int index) native;
25781 throw new UnsupportedError("Cannot add to immutable List."); 21643 }
25782 } 21644 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25783 21645 // for details. All rights reserved. Use of this source code is governed by a
25784 void insertAll(int index, Iterable<SpeechRecognitionResult> iterable) { 21646 // BSD-style license that can be found in the LICENSE file.
25785 throw new UnsupportedError("Cannot add to immutable List."); 21647
25786 } 21648
25787 21649 @DocsEditable
25788 void setAll(int index, Iterable<SpeechRecognitionResult> iterable) { 21650 @DomName('EntrySync')
25789 throw new UnsupportedError("Cannot modify an immutable List."); 21651 abstract class _EntrySync native "EntrySync" {
25790 } 21652 }
25791 21653 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25792 SpeechRecognitionResult removeAt(int pos) { 21654 // for details. All rights reserved. Use of this source code is governed by a
25793 throw new UnsupportedError("Cannot remove from immutable List."); 21655 // BSD-style license that can be found in the LICENSE file.
25794 } 21656
25795 21657
25796 SpeechRecognitionResult removeLast() { 21658 @DocsEditable
25797 throw new UnsupportedError("Cannot remove from immutable List."); 21659 @DomName('FileEntrySync')
25798 } 21660 abstract class _FileEntrySync extends _EntrySync native "FileEntrySync" {
25799 21661 }
25800 bool remove(Object object) { 21662 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25801 throw new UnsupportedError("Cannot remove from immutable List."); 21663 // for details. All rights reserved. Use of this source code is governed by a
25802 } 21664 // BSD-style license that can be found in the LICENSE file.
25803 21665
25804 void removeWhere(bool test(SpeechRecognitionResult element)) { 21666
25805 throw new UnsupportedError("Cannot remove from immutable List."); 21667 @DocsEditable
25806 } 21668 @DomName('FileReaderSync')
25807 21669 abstract class _FileReaderSync native "FileReaderSync" {
25808 void retainWhere(bool test(SpeechRecognitionResult element)) { 21670
25809 throw new UnsupportedError("Cannot remove from immutable List."); 21671 @DomName('FileReaderSync.FileReaderSync')
25810 } 21672 @DocsEditable
25811 21673 factory _FileReaderSync() {
25812 void setRange(int start, int end, Iterable<SpeechRecognitionResult> iterable, [int skipCount=0]) { 21674 return _FileReaderSync._create_1();
25813 throw new UnsupportedError("Cannot setRange on immutable List."); 21675 }
25814 } 21676 static _FileReaderSync _create_1() => JS('_FileReaderSync', 'new FileReaderSyn c()');
25815 21677 }
25816 void removeRange(int start, int end) { 21678 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25817 throw new UnsupportedError("Cannot removeRange on immutable List."); 21679 // for details. All rights reserved. Use of this source code is governed by a
25818 } 21680 // BSD-style license that can be found in the LICENSE file.
25819 21681
25820 void replaceRange(int start, int end, Iterable<SpeechRecognitionResult> iterab le) { 21682
25821 throw new UnsupportedError("Cannot modify an immutable List."); 21683 @DocsEditable
25822 } 21684 @DomName('FileWriterSync')
25823 21685 abstract class _FileWriterSync native "FileWriterSync" {
25824 void fillRange(int start, int end, [SpeechRecognitionResult fillValue]) { 21686 }
25825 throw new UnsupportedError("Cannot modify an immutable List."); 21687 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25826 } 21688 // for details. All rights reserved. Use of this source code is governed by a
25827 21689 // BSD-style license that can be found in the LICENSE file.
25828 Iterable<SpeechRecognitionResult> getRange(int start, int end) => 21690
25829 IterableMixinWorkaround.getRangeList(this, start, end); 21691
25830 21692 @DocsEditable
25831 List<SpeechRecognitionResult> sublist(int start, [int end]) { 21693 @DomName('GamepadList')
25832 if (end == null) end = length; 21694 class _GamepadList extends Object with ListMixin<Gamepad>, ImmutableListMixin<Ga mepad> implements JavaScriptIndexingBehavior, List<Gamepad> native "GamepadList" {
25833 return Lists.getRange(this, start, end, <SpeechRecognitionResult>[]); 21695
25834 } 21696 @DomName('GamepadList.length')
25835 21697 @DocsEditable
25836 Map<int, SpeechRecognitionResult> asMap() => 21698 int get length => JS("int", "#.length", this);
25837 IterableMixinWorkaround.asMapList(this); 21699
25838 21700 Gamepad operator[](int index) => JS("Gamepad", "#[#]", this, index);
25839 String toString() { 21701
25840 StringBuffer buffer = new StringBuffer('['); 21702 void operator[]=(int index, Gamepad value) {
25841 buffer.writeAll(this, ', '); 21703 throw new UnsupportedError("Cannot assign element of immutable List.");
25842 buffer.write(']'); 21704 }
25843 return buffer.toString(); 21705 // -- start List<Gamepad> mixins.
25844 } 21706 // Gamepad is the element type.
25845 21707
25846 // -- end List<SpeechRecognitionResult> mixins. 21708
25847 21709 void set length(int value) {
25848 @DomName('SpeechRecognitionResultList.item') 21710 throw new UnsupportedError("Cannot resize immutable List.");
25849 @DocsEditable 21711 }
25850 SpeechRecognitionResult item(int index) native; 21712
25851 } 21713 // -- end List<Gamepad> mixins.
25852 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21714
25853 // for details. All rights reserved. Use of this source code is governed by a 21715 @DomName('GamepadList.item')
21716 @DocsEditable
21717 Gamepad item(int index) native;
21718 }
21719 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21720 // for details. All rights reserved. Use of this source code is governed by a
21721 // BSD-style license that can be found in the LICENSE file.
21722
21723
21724 @DocsEditable
21725 @DomName('HTMLAppletElement')
21726 abstract class _HTMLAppletElement extends Element native "HTMLAppletElement" {
21727 }
21728 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21729 // for details. All rights reserved. Use of this source code is governed by a
21730 // BSD-style license that can be found in the LICENSE file.
21731
21732
21733 @DocsEditable
21734 @DomName('HTMLBaseFontElement')
21735 abstract class _HTMLBaseFontElement extends Element native "HTMLBaseFontElement" {
21736 }
21737 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21738 // for details. All rights reserved. Use of this source code is governed by a
21739 // BSD-style license that can be found in the LICENSE file.
21740
21741
21742 @DocsEditable
21743 @DomName('HTMLDirectoryElement')
21744 abstract class _HTMLDirectoryElement extends Element native "HTMLDirectoryElemen t" {
21745 }
21746 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21747 // for details. All rights reserved. Use of this source code is governed by a
21748 // BSD-style license that can be found in the LICENSE file.
21749
21750
21751 @DocsEditable
21752 @DomName('HTMLFontElement')
21753 abstract class _HTMLFontElement extends Element native "HTMLFontElement" {
21754 }
21755 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21756 // for details. All rights reserved. Use of this source code is governed by a
21757 // BSD-style license that can be found in the LICENSE file.
21758
21759
21760 @DocsEditable
21761 @DomName('HTMLFrameElement')
21762 abstract class _HTMLFrameElement extends Element native "HTMLFrameElement" {
21763 }
21764 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21765 // for details. All rights reserved. Use of this source code is governed by a
21766 // BSD-style license that can be found in the LICENSE file.
21767
21768
21769 @DocsEditable
21770 @DomName('HTMLFrameSetElement')
21771 abstract class _HTMLFrameSetElement extends Element native "HTMLFrameSetElement" {
21772 }
21773 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21774 // for details. All rights reserved. Use of this source code is governed by a
21775 // BSD-style license that can be found in the LICENSE file.
21776
21777
21778 @DocsEditable
21779 @DomName('HTMLMarqueeElement')
21780 abstract class _HTMLMarqueeElement extends Element native "HTMLMarqueeElement" {
21781 }
21782 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21783 // for details. All rights reserved. Use of this source code is governed by a
25854 // BSD-style license that can be found in the LICENSE file. 21784 // BSD-style license that can be found in the LICENSE file.
25855 21785
25856 21786
25857 @DocsEditable 21787 @DocsEditable
21788 @DomName('NamedNodeMap')
21789 class _NamedNodeMap extends Object with ListMixin<Node>, ImmutableListMixin<Node > implements JavaScriptIndexingBehavior, List<Node> native "NamedNodeMap" {
21790
21791 @DomName('NamedNodeMap.length')
21792 @DocsEditable
21793 int get length => JS("int", "#.length", this);
21794
21795 Node operator[](int index) => JS("Node", "#[#]", this, index);
21796
21797 void operator[]=(int index, Node value) {
21798 throw new UnsupportedError("Cannot assign element of immutable List.");
21799 }
21800 // -- start List<Node> mixins.
21801 // Node is the element type.
21802
21803
21804 void set length(int value) {
21805 throw new UnsupportedError("Cannot resize immutable List.");
21806 }
21807
21808 // -- end List<Node> mixins.
21809
21810 @DomName('NamedNodeMap.getNamedItem')
21811 @DocsEditable
21812 Node getNamedItem(String name) native;
21813
21814 @DomName('NamedNodeMap.getNamedItemNS')
21815 @DocsEditable
21816 Node getNamedItemNS(String namespaceURI, String localName) native;
21817
21818 @DomName('NamedNodeMap.item')
21819 @DocsEditable
21820 Node item(int index) native;
21821
21822 @DomName('NamedNodeMap.removeNamedItem')
21823 @DocsEditable
21824 Node removeNamedItem(String name) native;
21825
21826 @DomName('NamedNodeMap.removeNamedItemNS')
21827 @DocsEditable
21828 Node removeNamedItemNS(String namespaceURI, String localName) native;
21829
21830 @DomName('NamedNodeMap.setNamedItem')
21831 @DocsEditable
21832 Node setNamedItem(Node node) native;
21833
21834 @DomName('NamedNodeMap.setNamedItemNS')
21835 @DocsEditable
21836 Node setNamedItemNS(Node node) native;
21837 }
21838 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21839 // for details. All rights reserved. Use of this source code is governed by a
21840 // BSD-style license that can be found in the LICENSE file.
21841
21842
21843 @DocsEditable
21844 @DomName('PagePopupController')
21845 abstract class _PagePopupController native "PagePopupController" {
21846 }
21847 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21848 // for details. All rights reserved. Use of this source code is governed by a
21849 // BSD-style license that can be found in the LICENSE file.
21850
21851
21852 @DocsEditable
21853 @DomName('RGBColor')
21854 abstract class _RGBColor native "RGBColor" {
21855 }
21856 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
21857 // for details. All rights reserved. Use of this source code is governed by a
21858 // BSD-style license that can be found in the LICENSE file.
21859
21860
21861 // Omit RadioNodeList for dart2js. The Dart Form and FieldSet APIs don't
21862 // currently expose an API the returns RadioNodeList. The only use of a
21863 // RadioNodeList is to get the selected value and it will be cleaner to
21864 // introduce a different API for that purpose.
21865 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21866 // for details. All rights reserved. Use of this source code is governed by a
21867 // BSD-style license that can be found in the LICENSE file.
21868
21869
21870 @DocsEditable
21871 @DomName('Rect')
21872 abstract class _Rect native "Rect" {
21873 }
21874 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21875 // for details. All rights reserved. Use of this source code is governed by a
21876 // BSD-style license that can be found in the LICENSE file.
21877
21878
21879 @DocsEditable
21880 @DomName('SharedWorker')
21881 abstract class _SharedWorker extends AbstractWorker native "SharedWorker" {
21882
21883 @DomName('SharedWorker.SharedWorker')
21884 @DocsEditable
21885 factory _SharedWorker(String scriptURL, [String name]) {
21886 if (?name) {
21887 return _SharedWorker._create_1(scriptURL, name);
21888 }
21889 return _SharedWorker._create_2(scriptURL);
21890 }
21891 static _SharedWorker _create_1(scriptURL, name) => JS('_SharedWorker', 'new Sh aredWorker(#,#)', scriptURL, name);
21892 static _SharedWorker _create_2(scriptURL) => JS('_SharedWorker', 'new SharedWo rker(#)', scriptURL);
21893 }
21894 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21895 // for details. All rights reserved. Use of this source code is governed by a
21896 // BSD-style license that can be found in the LICENSE file.
21897
21898
21899 @DocsEditable
21900 @DomName('SharedWorkerContext')
21901 abstract class _SharedWorkerContext extends _WorkerContext native "SharedWorkerC ontext" {
21902 }
21903 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21904 // for details. All rights reserved. Use of this source code is governed by a
21905 // BSD-style license that can be found in the LICENSE file.
21906
21907
21908 @DocsEditable
21909 @DomName('SpeechInputResultList')
21910 class _SpeechInputResultList extends Object with ListMixin<SpeechInputResult>, I mmutableListMixin<SpeechInputResult> implements JavaScriptIndexingBehavior, List <SpeechInputResult> native "SpeechInputResultList" {
21911
21912 @DomName('SpeechInputResultList.length')
21913 @DocsEditable
21914 int get length => JS("int", "#.length", this);
21915
21916 SpeechInputResult operator[](int index) => JS("SpeechInputResult", "#[#]", thi s, index);
21917
21918 void operator[]=(int index, SpeechInputResult value) {
21919 throw new UnsupportedError("Cannot assign element of immutable List.");
21920 }
21921 // -- start List<SpeechInputResult> mixins.
21922 // SpeechInputResult is the element type.
21923
21924
21925 void set length(int value) {
21926 throw new UnsupportedError("Cannot resize immutable List.");
21927 }
21928
21929 // -- end List<SpeechInputResult> mixins.
21930
21931 @DomName('SpeechInputResultList.item')
21932 @DocsEditable
21933 SpeechInputResult item(int index) native;
21934 }
21935 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21936 // for details. All rights reserved. Use of this source code is governed by a
21937 // BSD-style license that can be found in the LICENSE file.
21938
21939
21940 @DocsEditable
21941 @DomName('SpeechRecognitionResultList')
21942 class _SpeechRecognitionResultList extends Object with ListMixin<SpeechRecogniti onResult>, ImmutableListMixin<SpeechRecognitionResult> implements JavaScriptInde xingBehavior, List<SpeechRecognitionResult> native "SpeechRecognitionResultList" {
21943
21944 @DomName('SpeechRecognitionResultList.length')
21945 @DocsEditable
21946 int get length => JS("int", "#.length", this);
21947
21948 SpeechRecognitionResult operator[](int index) => JS("SpeechRecognitionResult", "#[#]", this, index);
21949
21950 void operator[]=(int index, SpeechRecognitionResult value) {
21951 throw new UnsupportedError("Cannot assign element of immutable List.");
21952 }
21953 // -- start List<SpeechRecognitionResult> mixins.
21954 // SpeechRecognitionResult is the element type.
21955
21956
21957 void set length(int value) {
21958 throw new UnsupportedError("Cannot resize immutable List.");
21959 }
21960
21961 // -- end List<SpeechRecognitionResult> mixins.
21962
21963 @DomName('SpeechRecognitionResultList.item')
21964 @DocsEditable
21965 SpeechRecognitionResult item(int index) native;
21966 }
21967 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21968 // for details. All rights reserved. Use of this source code is governed by a
21969 // BSD-style license that can be found in the LICENSE file.
21970
21971
21972 @DocsEditable
25858 @DomName('StyleSheetList') 21973 @DomName('StyleSheetList')
25859 class _StyleSheetList implements JavaScriptIndexingBehavior, List<StyleSheet> na tive "StyleSheetList" { 21974 class _StyleSheetList extends Object with ListMixin<StyleSheet>, ImmutableListMi xin<StyleSheet> implements JavaScriptIndexingBehavior, List<StyleSheet> native " StyleSheetList" {
25860 21975
25861 @DomName('StyleSheetList.length') 21976 @DomName('StyleSheetList.length')
25862 @DocsEditable 21977 @DocsEditable
25863 int get length => JS("int", "#.length", this); 21978 int get length => JS("int", "#.length", this);
25864 21979
25865 StyleSheet operator[](int index) => JS("StyleSheet", "#[#]", this, index); 21980 StyleSheet operator[](int index) => JS("StyleSheet", "#[#]", this, index);
25866 21981
25867 void operator[]=(int index, StyleSheet value) { 21982 void operator[]=(int index, StyleSheet value) {
25868 throw new UnsupportedError("Cannot assign element of immutable List."); 21983 throw new UnsupportedError("Cannot assign element of immutable List.");
25869 } 21984 }
25870 // -- start List<StyleSheet> mixins. 21985 // -- start List<StyleSheet> mixins.
25871 // StyleSheet is the element type. 21986 // StyleSheet is the element type.
25872 21987
25873 // From Iterable<StyleSheet>: 21988
25874 21989 void set length(int value) {
25875 Iterator<StyleSheet> get iterator { 21990 throw new UnsupportedError("Cannot resize immutable List.");
25876 // Note: NodeLists are not fixed size. And most probably length shouldn't
25877 // be cached in both iterator _and_ forEach method. For now caching it
25878 // for consistency.
25879 return new FixedSizeListIterator<StyleSheet>(this);
25880 }
25881
25882 StyleSheet reduce(StyleSheet combine(StyleSheet value, StyleSheet element)) {
25883 return IterableMixinWorkaround.reduce(this, combine);
25884 }
25885
25886 dynamic fold(dynamic initialValue,
25887 dynamic combine(dynamic previousValue, StyleSheet element)) {
25888 return IterableMixinWorkaround.fold(this, initialValue, combine);
25889 }
25890
25891 bool contains(StyleSheet element) => IterableMixinWorkaround.contains(this, el ement);
25892
25893 void forEach(void f(StyleSheet element)) => IterableMixinWorkaround.forEach(th is, f);
25894
25895 String join([String separator = ""]) =>
25896 IterableMixinWorkaround.joinList(this, separator);
25897
25898 Iterable map(f(StyleSheet element)) =>
25899 IterableMixinWorkaround.mapList(this, f);
25900
25901 Iterable<StyleSheet> where(bool f(StyleSheet element)) =>
25902 IterableMixinWorkaround.where(this, f);
25903
25904 Iterable expand(Iterable f(StyleSheet element)) =>
25905 IterableMixinWorkaround.expand(this, f);
25906
25907 bool every(bool f(StyleSheet element)) => IterableMixinWorkaround.every(this, f);
25908
25909 bool any(bool f(StyleSheet element)) => IterableMixinWorkaround.any(this, f);
25910
25911 List<StyleSheet> toList({ bool growable: true }) =>
25912 new List<StyleSheet>.from(this, growable: growable);
25913
25914 Set<StyleSheet> toSet() => new Set<StyleSheet>.from(this);
25915
25916 bool get isEmpty => this.length == 0;
25917
25918 Iterable<StyleSheet> take(int n) => IterableMixinWorkaround.takeList(this, n);
25919
25920 Iterable<StyleSheet> takeWhile(bool test(StyleSheet value)) {
25921 return IterableMixinWorkaround.takeWhile(this, test);
25922 }
25923
25924 Iterable<StyleSheet> skip(int n) => IterableMixinWorkaround.skipList(this, n);
25925
25926 Iterable<StyleSheet> skipWhile(bool test(StyleSheet value)) {
25927 return IterableMixinWorkaround.skipWhile(this, test);
25928 }
25929
25930 StyleSheet firstWhere(bool test(StyleSheet value), { StyleSheet orElse() }) {
25931 return IterableMixinWorkaround.firstWhere(this, test, orElse);
25932 }
25933
25934 StyleSheet lastWhere(bool test(StyleSheet value), {StyleSheet orElse()}) {
25935 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
25936 }
25937
25938 StyleSheet singleWhere(bool test(StyleSheet value)) {
25939 return IterableMixinWorkaround.singleWhere(this, test);
25940 }
25941
25942 StyleSheet elementAt(int index) {
25943 return this[index];
25944 }
25945
25946 // From Collection<StyleSheet>:
25947
25948 void add(StyleSheet value) {
25949 throw new UnsupportedError("Cannot add to immutable List.");
25950 }
25951
25952 void addAll(Iterable<StyleSheet> iterable) {
25953 throw new UnsupportedError("Cannot add to immutable List.");
25954 }
25955
25956 // From List<StyleSheet>:
25957 void set length(int value) {
25958 throw new UnsupportedError("Cannot resize immutable List.");
25959 }
25960
25961 void clear() {
25962 throw new UnsupportedError("Cannot clear immutable List.");
25963 }
25964
25965 Iterable<StyleSheet> get reversed {
25966 return IterableMixinWorkaround.reversedList(this);
25967 }
25968
25969 void sort([int compare(StyleSheet a, StyleSheet b)]) {
25970 throw new UnsupportedError("Cannot sort immutable List.");
25971 }
25972
25973 int indexOf(StyleSheet element, [int start = 0]) =>
25974 Lists.indexOf(this, element, start, this.length);
25975
25976 int lastIndexOf(StyleSheet element, [int start]) {
25977 if (start == null) start = length - 1;
25978 return Lists.lastIndexOf(this, element, start);
25979 }
25980
25981 StyleSheet get first {
25982 if (this.length > 0) return this[0];
25983 throw new StateError("No elements");
25984 }
25985
25986 StyleSheet get last {
25987 if (this.length > 0) return this[this.length - 1];
25988 throw new StateError("No elements");
25989 }
25990
25991 StyleSheet get single {
25992 if (length == 1) return this[0];
25993 if (length == 0) throw new StateError("No elements");
25994 throw new StateError("More than one element");
25995 }
25996
25997 void insert(int index, StyleSheet element) {
25998 throw new UnsupportedError("Cannot add to immutable List.");
25999 }
26000
26001 void insertAll(int index, Iterable<StyleSheet> iterable) {
26002 throw new UnsupportedError("Cannot add to immutable List.");
26003 }
26004
26005 void setAll(int index, Iterable<StyleSheet> iterable) {
26006 throw new UnsupportedError("Cannot modify an immutable List.");
26007 }
26008
26009 StyleSheet removeAt(int pos) {
26010 throw new UnsupportedError("Cannot remove from immutable List.");
26011 }
26012
26013 StyleSheet removeLast() {
26014 throw new UnsupportedError("Cannot remove from immutable List.");
26015 }
26016
26017 bool remove(Object object) {
26018 throw new UnsupportedError("Cannot remove from immutable List.");
26019 }
26020
26021 void removeWhere(bool test(StyleSheet element)) {
26022 throw new UnsupportedError("Cannot remove from immutable List.");
26023 }
26024
26025 void retainWhere(bool test(StyleSheet element)) {
26026 throw new UnsupportedError("Cannot remove from immutable List.");
26027 }
26028
26029 void setRange(int start, int end, Iterable<StyleSheet> iterable, [int skipCoun t=0]) {
26030 throw new UnsupportedError("Cannot setRange on immutable List.");
26031 }
26032
26033 void removeRange(int start, int end) {
26034 throw new UnsupportedError("Cannot removeRange on immutable List.");
26035 }
26036
26037 void replaceRange(int start, int end, Iterable<StyleSheet> iterable) {
26038 throw new UnsupportedError("Cannot modify an immutable List.");
26039 }
26040
26041 void fillRange(int start, int end, [StyleSheet fillValue]) {
26042 throw new UnsupportedError("Cannot modify an immutable List.");
26043 }
26044
26045 Iterable<StyleSheet> getRange(int start, int end) =>
26046 IterableMixinWorkaround.getRangeList(this, start, end);
26047
26048 List<StyleSheet> sublist(int start, [int end]) {
26049 if (end == null) end = length;
26050 return Lists.getRange(this, start, end, <StyleSheet>[]);
26051 }
26052
26053 Map<int, StyleSheet> asMap() =>
26054 IterableMixinWorkaround.asMapList(this);
26055
26056 String toString() {
26057 StringBuffer buffer = new StringBuffer('[');
26058 buffer.writeAll(this, ', ');
26059 buffer.write(']');
26060 return buffer.toString();
26061 } 21991 }
26062 21992
26063 // -- end List<StyleSheet> mixins. 21993 // -- end List<StyleSheet> mixins.
26064 21994
26065 @DomName('StyleSheetList.item') 21995 @DomName('StyleSheetList.item')
26066 @DocsEditable 21996 @DocsEditable
26067 StyleSheet item(int index) native; 21997 StyleSheet item(int index) native;
26068 } 21998 }
26069 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21999 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
26070 // for details. All rights reserved. Use of this source code is governed by a 22000 // for details. All rights reserved. Use of this source code is governed by a
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
26849 22779
26850 String getEventType(EventTarget target) { 22780 String getEventType(EventTarget target) {
26851 return _eventTypeGetter(target); 22781 return _eventTypeGetter(target);
26852 } 22782 }
26853 } 22783 }
26854 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 22784 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
26855 // for details. All rights reserved. Use of this source code is governed by a 22785 // for details. All rights reserved. Use of this source code is governed by a
26856 // BSD-style license that can be found in the LICENSE file. 22786 // BSD-style license that can be found in the LICENSE file.
26857 22787
26858 22788
22789 abstract class ImmutableListMixin<E> implements List<E> {
22790 // From Iterable<$E>:
22791 Iterator<E> get iterator {
22792 // Note: NodeLists are not fixed size. And most probably length shouldn't
22793 // be cached in both iterator _and_ forEach method. For now caching it
22794 // for consistency.
22795 return new FixedSizeListIterator<E>(this);
22796 }
22797
22798 // From Collection<E>:
22799 void add(E value) {
22800 throw new UnsupportedError("Cannot add to immutable List.");
22801 }
22802
22803 void addAll(Iterable<E> iterable) {
22804 throw new UnsupportedError("Cannot add to immutable List.");
22805 }
22806
22807 // From List<E>:
22808 void sort([int compare(E a, E b)]) {
22809 throw new UnsupportedError("Cannot sort immutable List.");
22810 }
22811
22812 void insert(int index, E element) {
22813 throw new UnsupportedError("Cannot add to immutable List.");
22814 }
22815
22816 void insertAll(int index, Iterable<E> iterable) {
22817 throw new UnsupportedError("Cannot add to immutable List.");
22818 }
22819
22820 void setAll(int index, Iterable<E> iterable) {
22821 throw new UnsupportedError("Cannot modify an immutable List.");
22822 }
22823
22824 E removeAt(int pos) {
22825 throw new UnsupportedError("Cannot remove from immutable List.");
22826 }
22827
22828 E removeLast() {
22829 throw new UnsupportedError("Cannot remove from immutable List.");
22830 }
22831
22832 void remove(Object object) {
22833 throw new UnsupportedError("Cannot remove from immutable List.");
22834 }
22835
22836 void removeWhere(bool test(E element)) {
22837 throw new UnsupportedError("Cannot remove from immutable List.");
22838 }
22839
22840 void retainWhere(bool test(E element)) {
22841 throw new UnsupportedError("Cannot remove from immutable List.");
22842 }
22843
22844 void setRange(int start, int end, Iterable<E> iterable, [int skipCount]) {
22845 throw new UnsupportedError("Cannot setRange on immutable List.");
22846 }
22847
22848 void removeRange(int start, int end) {
22849 throw new UnsupportedError("Cannot removeRange on immutable List.");
22850 }
22851
22852 void replaceRange(int start, int end, Iterable<E> iterable) {
22853 throw new UnsupportedError("Cannot modify an immutable List.");
22854 }
22855
22856 void fillRange(int start, int end, [E fillValue]) {
22857 throw new UnsupportedError("Cannot modify an immutable List.");
22858 }
22859 }
22860 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22861 // for details. All rights reserved. Use of this source code is governed by a
22862 // BSD-style license that can be found in the LICENSE file.
22863
22864
26859 /** 22865 /**
26860 * Internal class that does the actual calculations to determine keyCode and 22866 * Internal class that does the actual calculations to determine keyCode and
26861 * charCode for keydown, keypress, and keyup events for all browsers. 22867 * charCode for keydown, keypress, and keyup events for all browsers.
26862 */ 22868 */
26863 class _KeyboardEventHandler extends EventStreamProvider<KeyEvent> { 22869 class _KeyboardEventHandler extends EventStreamProvider<KeyEvent> {
26864 // This code inspired by Closure's KeyHandling library. 22870 // This code inspired by Closure's KeyHandling library.
26865 // http://closure-library.googlecode.com/svn/docs/closure_goog_events_keyhandl er.js.source.html 22871 // http://closure-library.googlecode.com/svn/docs/closure_goog_events_keyhandl er.js.source.html
26866 22872
26867 /** 22873 /**
26868 * The set of keys that have been pressed down without seeing their 22874 * The set of keys that have been pressed down without seeing their
(...skipping 2693 matching lines...) Expand 10 before | Expand all | Expand 10 after
29562 _position = nextPosition; 25568 _position = nextPosition;
29563 return true; 25569 return true;
29564 } 25570 }
29565 _current = null; 25571 _current = null;
29566 _position = _array.length; 25572 _position = _array.length;
29567 return false; 25573 return false;
29568 } 25574 }
29569 25575
29570 T get current => _current; 25576 T get current => _current;
29571 } 25577 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698