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

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, 8 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') | tools/dom/scripts/systemhtml.py » ('J')
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 6742 matching lines...) Expand 10 before | Expand all | Expand 10 after
6753 @DocsEditable 6753 @DocsEditable
6754 final String type; 6754 final String type;
6755 } 6755 }
6756 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6756 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
6757 // for details. All rights reserved. Use of this source code is governed by a 6757 // for details. All rights reserved. Use of this source code is governed by a
6758 // BSD-style license that can be found in the LICENSE file. 6758 // BSD-style license that can be found in the LICENSE file.
6759 6759
6760 6760
6761 @DocsEditable 6761 @DocsEditable
6762 @DomName('MimeTypeArray') 6762 @DomName('MimeTypeArray')
6763 class DomMimeTypeArray implements JavaScriptIndexingBehavior, List<DomMimeType> native "MimeTypeArray" { 6763 class DomMimeTypeArray extends Object with ImmutableListMixin<DomMimeType>, List Mixin<DomMimeType> implements JavaScriptIndexingBehavior, List<DomMimeType> nati ve "MimeTypeArray" {
6764 6764
6765 @DomName('DOMMimeTypeArray.length') 6765 @DomName('DOMMimeTypeArray.length')
6766 @DocsEditable 6766 @DocsEditable
6767 int get length => JS("int", "#.length", this); 6767 int get length => JS("int", "#.length", this);
6768 6768
6769 DomMimeType operator[](int index) => JS("DomMimeType", "#[#]", this, index); 6769 DomMimeType operator[](int index) => JS("DomMimeType", "#[#]", this, index);
6770 6770
6771 void operator[]=(int index, DomMimeType value) { 6771 void operator[]=(int index, DomMimeType value) {
6772 throw new UnsupportedError("Cannot assign element of immutable List."); 6772 throw new UnsupportedError("Cannot assign element of immutable List.");
6773 } 6773 }
6774 // -- start List<DomMimeType> mixins. 6774 // -- start List<DomMimeType> mixins.
6775 // DomMimeType is the element type. 6775 // DomMimeType is the element type.
6776 6776
6777 // From Iterable<DomMimeType>:
6778 6777
6779 Iterator<DomMimeType> get iterator {
6780 // Note: NodeLists are not fixed size. And most probably length shouldn't
6781 // be cached in both iterator _and_ forEach method. For now caching it
6782 // for consistency.
6783 return new FixedSizeListIterator<DomMimeType>(this);
6784 }
6785
6786 DomMimeType reduce(DomMimeType combine(DomMimeType value, DomMimeType element) ) {
6787 return IterableMixinWorkaround.reduce(this, combine);
6788 }
6789
6790 dynamic fold(dynamic initialValue,
6791 dynamic combine(dynamic previousValue, DomMimeType element)) {
6792 return IterableMixinWorkaround.fold(this, initialValue, combine);
6793 }
6794
6795 bool contains(DomMimeType element) => IterableMixinWorkaround.contains(this, e lement);
6796
6797 void forEach(void f(DomMimeType element)) => IterableMixinWorkaround.forEach(t his, f);
6798
6799 String join([String separator = ""]) =>
6800 IterableMixinWorkaround.joinList(this, separator);
6801
6802 Iterable map(f(DomMimeType element)) =>
6803 IterableMixinWorkaround.mapList(this, f);
6804
6805 Iterable<DomMimeType> where(bool f(DomMimeType element)) =>
6806 IterableMixinWorkaround.where(this, f);
6807
6808 Iterable expand(Iterable f(DomMimeType element)) =>
6809 IterableMixinWorkaround.expand(this, f);
6810
6811 bool every(bool f(DomMimeType element)) => IterableMixinWorkaround.every(this, f);
6812
6813 bool any(bool f(DomMimeType element)) => IterableMixinWorkaround.any(this, f);
6814
6815 List<DomMimeType> toList({ bool growable: true }) =>
6816 new List<DomMimeType>.from(this, growable: growable);
6817
6818 Set<DomMimeType> toSet() => new Set<DomMimeType>.from(this);
6819
6820 bool get isEmpty => this.length == 0;
6821
6822 Iterable<DomMimeType> take(int n) => IterableMixinWorkaround.takeList(this, n) ;
6823
6824 Iterable<DomMimeType> takeWhile(bool test(DomMimeType value)) {
6825 return IterableMixinWorkaround.takeWhile(this, test);
6826 }
6827
6828 Iterable<DomMimeType> skip(int n) => IterableMixinWorkaround.skipList(this, n) ;
6829
6830 Iterable<DomMimeType> skipWhile(bool test(DomMimeType value)) {
6831 return IterableMixinWorkaround.skipWhile(this, test);
6832 }
6833
6834 DomMimeType firstWhere(bool test(DomMimeType value), { DomMimeType orElse() }) {
6835 return IterableMixinWorkaround.firstWhere(this, test, orElse);
6836 }
6837
6838 DomMimeType lastWhere(bool test(DomMimeType value), {DomMimeType orElse()}) {
6839 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
6840 }
6841
6842 DomMimeType singleWhere(bool test(DomMimeType value)) {
6843 return IterableMixinWorkaround.singleWhere(this, test);
6844 }
6845
6846 DomMimeType elementAt(int index) {
6847 return this[index];
6848 }
6849
6850 // From Collection<DomMimeType>:
6851
6852 void add(DomMimeType value) {
6853 throw new UnsupportedError("Cannot add to immutable List.");
6854 }
6855
6856 void addAll(Iterable<DomMimeType> iterable) {
6857 throw new UnsupportedError("Cannot add to immutable List.");
6858 }
6859
6860 // From List<DomMimeType>:
6861 void set length(int value) { 6778 void set length(int value) {
6862 throw new UnsupportedError("Cannot resize immutable List."); 6779 throw new UnsupportedError("Cannot resize immutable List.");
6863 } 6780 }
6864 6781
6865 void clear() {
6866 throw new UnsupportedError("Cannot clear immutable List.");
6867 }
6868
6869 Iterable<DomMimeType> get reversed {
6870 return IterableMixinWorkaround.reversedList(this);
6871 }
6872
6873 void sort([int compare(DomMimeType a, DomMimeType b)]) {
6874 throw new UnsupportedError("Cannot sort immutable List.");
6875 }
6876
6877 int indexOf(DomMimeType element, [int start = 0]) =>
6878 Lists.indexOf(this, element, start, this.length);
6879
6880 int lastIndexOf(DomMimeType element, [int start]) {
6881 if (start == null) start = length - 1;
6882 return Lists.lastIndexOf(this, element, start);
6883 }
6884
6885 DomMimeType get first {
6886 if (this.length > 0) return this[0];
6887 throw new StateError("No elements");
6888 }
6889
6890 DomMimeType get last {
6891 if (this.length > 0) return this[this.length - 1];
6892 throw new StateError("No elements");
6893 }
6894
6895 DomMimeType get single {
6896 if (length == 1) return this[0];
6897 if (length == 0) throw new StateError("No elements");
6898 throw new StateError("More than one element");
6899 }
6900
6901 void insert(int index, DomMimeType element) {
6902 throw new UnsupportedError("Cannot add to immutable List.");
6903 }
6904
6905 void insertAll(int index, Iterable<DomMimeType> iterable) {
6906 throw new UnsupportedError("Cannot add to immutable List.");
6907 }
6908
6909 void setAll(int index, Iterable<DomMimeType> iterable) {
6910 throw new UnsupportedError("Cannot modify an immutable List.");
6911 }
6912
6913 DomMimeType removeAt(int pos) {
6914 throw new UnsupportedError("Cannot remove from immutable List.");
6915 }
6916
6917 DomMimeType removeLast() {
6918 throw new UnsupportedError("Cannot remove from immutable List.");
6919 }
6920
6921 bool remove(Object object) {
6922 throw new UnsupportedError("Cannot remove from immutable List.");
6923 }
6924
6925 void removeWhere(bool test(DomMimeType element)) {
6926 throw new UnsupportedError("Cannot remove from immutable List.");
6927 }
6928
6929 void retainWhere(bool test(DomMimeType element)) {
6930 throw new UnsupportedError("Cannot remove from immutable List.");
6931 }
6932
6933 void setRange(int start, int end, Iterable<DomMimeType> iterable, [int skipCou nt=0]) {
6934 throw new UnsupportedError("Cannot setRange on immutable List.");
6935 }
6936
6937 void removeRange(int start, int end) {
6938 throw new UnsupportedError("Cannot removeRange on immutable List.");
6939 }
6940
6941 void replaceRange(int start, int end, Iterable<DomMimeType> iterable) {
6942 throw new UnsupportedError("Cannot modify an immutable List.");
6943 }
6944
6945 void fillRange(int start, int end, [DomMimeType fillValue]) {
6946 throw new UnsupportedError("Cannot modify an immutable List.");
6947 }
6948
6949 Iterable<DomMimeType> getRange(int start, int end) =>
6950 IterableMixinWorkaround.getRangeList(this, start, end);
6951
6952 List<DomMimeType> sublist(int start, [int end]) {
6953 if (end == null) end = length;
6954 return Lists.getRange(this, start, end, <DomMimeType>[]);
6955 }
6956
6957 Map<int, DomMimeType> asMap() =>
6958 IterableMixinWorkaround.asMapList(this);
6959
6960 String toString() {
6961 StringBuffer buffer = new StringBuffer('[');
6962 buffer.writeAll(this, ', ');
6963 buffer.write(']');
6964 return buffer.toString();
6965 }
6966
6967 // -- end List<DomMimeType> mixins. 6782 // -- end List<DomMimeType> mixins.
6968 6783
6969 @DomName('DOMMimeTypeArray.item') 6784 @DomName('DOMMimeTypeArray.item')
6970 @DocsEditable 6785 @DocsEditable
6971 DomMimeType item(int index) native; 6786 DomMimeType item(int index) native;
6972 6787
6973 @DomName('DOMMimeTypeArray.namedItem') 6788 @DomName('DOMMimeTypeArray.namedItem')
6974 @DocsEditable 6789 @DocsEditable
6975 DomMimeType namedItem(String name) native; 6790 DomMimeType namedItem(String name) native;
6976 } 6791 }
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
7107 @DocsEditable 6922 @DocsEditable
7108 DomMimeType namedItem(String name) native; 6923 DomMimeType namedItem(String name) native;
7109 } 6924 }
7110 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 6925 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
7111 // for details. All rights reserved. Use of this source code is governed by a 6926 // for details. All rights reserved. Use of this source code is governed by a
7112 // BSD-style license that can be found in the LICENSE file. 6927 // BSD-style license that can be found in the LICENSE file.
7113 6928
7114 6929
7115 @DocsEditable 6930 @DocsEditable
7116 @DomName('PluginArray') 6931 @DomName('PluginArray')
7117 class DomPluginArray implements JavaScriptIndexingBehavior, List<DomPlugin> nati ve "PluginArray" { 6932 class DomPluginArray extends Object with ListMixin<DomPlugin>, ImmutableListMixi n<DomPlugin> implements JavaScriptIndexingBehavior, List<DomPlugin> native "Plug inArray" {
7118 6933
7119 @DomName('DOMPluginArray.length') 6934 @DomName('DOMPluginArray.length')
7120 @DocsEditable 6935 @DocsEditable
7121 int get length => JS("int", "#.length", this); 6936 int get length => JS("int", "#.length", this);
7122 6937
7123 DomPlugin operator[](int index) => JS("DomPlugin", "#[#]", this, index); 6938 DomPlugin operator[](int index) => JS("DomPlugin", "#[#]", this, index);
7124 6939
7125 void operator[]=(int index, DomPlugin value) { 6940 void operator[]=(int index, DomPlugin value) {
7126 throw new UnsupportedError("Cannot assign element of immutable List."); 6941 throw new UnsupportedError("Cannot assign element of immutable List.");
7127 } 6942 }
7128 // -- start List<DomPlugin> mixins. 6943 // -- start List<DomPlugin> mixins.
7129 // DomPlugin is the element type. 6944 // DomPlugin is the element type.
7130 6945
7131 // From Iterable<DomPlugin>:
7132 6946
7133 Iterator<DomPlugin> get iterator {
7134 // Note: NodeLists are not fixed size. And most probably length shouldn't
7135 // be cached in both iterator _and_ forEach method. For now caching it
7136 // for consistency.
7137 return new FixedSizeListIterator<DomPlugin>(this);
7138 }
7139
7140 DomPlugin reduce(DomPlugin combine(DomPlugin value, DomPlugin element)) {
7141 return IterableMixinWorkaround.reduce(this, combine);
7142 }
7143
7144 dynamic fold(dynamic initialValue,
7145 dynamic combine(dynamic previousValue, DomPlugin element)) {
7146 return IterableMixinWorkaround.fold(this, initialValue, combine);
7147 }
7148
7149 bool contains(DomPlugin element) => IterableMixinWorkaround.contains(this, ele ment);
7150
7151 void forEach(void f(DomPlugin element)) => IterableMixinWorkaround.forEach(thi s, f);
7152
7153 String join([String separator = ""]) =>
7154 IterableMixinWorkaround.joinList(this, separator);
7155
7156 Iterable map(f(DomPlugin element)) =>
7157 IterableMixinWorkaround.mapList(this, f);
7158
7159 Iterable<DomPlugin> where(bool f(DomPlugin element)) =>
7160 IterableMixinWorkaround.where(this, f);
7161
7162 Iterable expand(Iterable f(DomPlugin element)) =>
7163 IterableMixinWorkaround.expand(this, f);
7164
7165 bool every(bool f(DomPlugin element)) => IterableMixinWorkaround.every(this, f );
7166
7167 bool any(bool f(DomPlugin element)) => IterableMixinWorkaround.any(this, f);
7168
7169 List<DomPlugin> toList({ bool growable: true }) =>
7170 new List<DomPlugin>.from(this, growable: growable);
7171
7172 Set<DomPlugin> toSet() => new Set<DomPlugin>.from(this);
7173
7174 bool get isEmpty => this.length == 0;
7175
7176 Iterable<DomPlugin> take(int n) => IterableMixinWorkaround.takeList(this, n);
7177
7178 Iterable<DomPlugin> takeWhile(bool test(DomPlugin value)) {
7179 return IterableMixinWorkaround.takeWhile(this, test);
7180 }
7181
7182 Iterable<DomPlugin> skip(int n) => IterableMixinWorkaround.skipList(this, n);
7183
7184 Iterable<DomPlugin> skipWhile(bool test(DomPlugin value)) {
7185 return IterableMixinWorkaround.skipWhile(this, test);
7186 }
7187
7188 DomPlugin firstWhere(bool test(DomPlugin value), { DomPlugin orElse() }) {
7189 return IterableMixinWorkaround.firstWhere(this, test, orElse);
7190 }
7191
7192 DomPlugin lastWhere(bool test(DomPlugin value), {DomPlugin orElse()}) {
7193 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
7194 }
7195
7196 DomPlugin singleWhere(bool test(DomPlugin value)) {
7197 return IterableMixinWorkaround.singleWhere(this, test);
7198 }
7199
7200 DomPlugin elementAt(int index) {
7201 return this[index];
7202 }
7203
7204 // From Collection<DomPlugin>:
7205
7206 void add(DomPlugin value) {
7207 throw new UnsupportedError("Cannot add to immutable List.");
7208 }
7209
7210 void addAll(Iterable<DomPlugin> iterable) {
7211 throw new UnsupportedError("Cannot add to immutable List.");
7212 }
7213
7214 // From List<DomPlugin>:
7215 void set length(int value) { 6947 void set length(int value) {
7216 throw new UnsupportedError("Cannot resize immutable List."); 6948 throw new UnsupportedError("Cannot resize immutable List.");
7217 } 6949 }
7218 6950
7219 void clear() {
7220 throw new UnsupportedError("Cannot clear immutable List.");
7221 }
7222
7223 Iterable<DomPlugin> get reversed {
7224 return IterableMixinWorkaround.reversedList(this);
7225 }
7226
7227 void sort([int compare(DomPlugin a, DomPlugin b)]) {
7228 throw new UnsupportedError("Cannot sort immutable List.");
7229 }
7230
7231 int indexOf(DomPlugin element, [int start = 0]) =>
7232 Lists.indexOf(this, element, start, this.length);
7233
7234 int lastIndexOf(DomPlugin element, [int start]) {
7235 if (start == null) start = length - 1;
7236 return Lists.lastIndexOf(this, element, start);
7237 }
7238
7239 DomPlugin get first {
7240 if (this.length > 0) return this[0];
7241 throw new StateError("No elements");
7242 }
7243
7244 DomPlugin get last {
7245 if (this.length > 0) return this[this.length - 1];
7246 throw new StateError("No elements");
7247 }
7248
7249 DomPlugin get single {
7250 if (length == 1) return this[0];
7251 if (length == 0) throw new StateError("No elements");
7252 throw new StateError("More than one element");
7253 }
7254
7255 void insert(int index, DomPlugin element) {
7256 throw new UnsupportedError("Cannot add to immutable List.");
7257 }
7258
7259 void insertAll(int index, Iterable<DomPlugin> iterable) {
7260 throw new UnsupportedError("Cannot add to immutable List.");
7261 }
7262
7263 void setAll(int index, Iterable<DomPlugin> iterable) {
7264 throw new UnsupportedError("Cannot modify an immutable List.");
7265 }
7266
7267 DomPlugin removeAt(int pos) {
7268 throw new UnsupportedError("Cannot remove from immutable List.");
7269 }
7270
7271 DomPlugin removeLast() {
7272 throw new UnsupportedError("Cannot remove from immutable List.");
7273 }
7274
7275 bool remove(Object object) {
7276 throw new UnsupportedError("Cannot remove from immutable List.");
7277 }
7278
7279 void removeWhere(bool test(DomPlugin element)) {
7280 throw new UnsupportedError("Cannot remove from immutable List.");
7281 }
7282
7283 void retainWhere(bool test(DomPlugin element)) {
7284 throw new UnsupportedError("Cannot remove from immutable List.");
7285 }
7286
7287 void setRange(int start, int end, Iterable<DomPlugin> iterable, [int skipCount =0]) {
7288 throw new UnsupportedError("Cannot setRange on immutable List.");
7289 }
7290
7291 void removeRange(int start, int end) {
7292 throw new UnsupportedError("Cannot removeRange on immutable List.");
7293 }
7294
7295 void replaceRange(int start, int end, Iterable<DomPlugin> iterable) {
7296 throw new UnsupportedError("Cannot modify an immutable List.");
7297 }
7298
7299 void fillRange(int start, int end, [DomPlugin fillValue]) {
7300 throw new UnsupportedError("Cannot modify an immutable List.");
7301 }
7302
7303 Iterable<DomPlugin> getRange(int start, int end) =>
7304 IterableMixinWorkaround.getRangeList(this, start, end);
7305
7306 List<DomPlugin> sublist(int start, [int end]) {
7307 if (end == null) end = length;
7308 return Lists.getRange(this, start, end, <DomPlugin>[]);
7309 }
7310
7311 Map<int, DomPlugin> asMap() =>
7312 IterableMixinWorkaround.asMapList(this);
7313
7314 String toString() {
7315 StringBuffer buffer = new StringBuffer('[');
7316 buffer.writeAll(this, ', ');
7317 buffer.write(']');
7318 return buffer.toString();
7319 }
7320
7321 // -- end List<DomPlugin> mixins. 6951 // -- end List<DomPlugin> mixins.
7322 6952
7323 @DomName('DOMPluginArray.item') 6953 @DomName('DOMPluginArray.item')
7324 @DocsEditable 6954 @DocsEditable
7325 DomPlugin item(int index) native; 6955 DomPlugin item(int index) native;
7326 6956
7327 @DomName('DOMPluginArray.namedItem') 6957 @DomName('DOMPluginArray.namedItem')
7328 @DocsEditable 6958 @DocsEditable
7329 DomPlugin namedItem(String name) native; 6959 DomPlugin namedItem(String name) native;
7330 6960
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
7529 @DocsEditable 7159 @DocsEditable
7530 String value; 7160 String value;
7531 } 7161 }
7532 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 7162 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
7533 // for details. All rights reserved. Use of this source code is governed by a 7163 // for details. All rights reserved. Use of this source code is governed by a
7534 // BSD-style license that can be found in the LICENSE file. 7164 // BSD-style license that can be found in the LICENSE file.
7535 7165
7536 7166
7537 @DocsEditable 7167 @DocsEditable
7538 @DomName('DOMStringList') 7168 @DomName('DOMStringList')
7539 class DomStringList implements JavaScriptIndexingBehavior, List<String> native " DOMStringList" { 7169 class DomStringList extends Object with ImmutableListMixin<String>, ListMixin<St ring> implements JavaScriptIndexingBehavior, List<String> native "DOMStringList" {
7540 7170
7541 @DomName('DOMStringList.length') 7171 @DomName('DOMStringList.length')
7542 @DocsEditable 7172 @DocsEditable
7543 int get length => JS("int", "#.length", this); 7173 int get length => JS("int", "#.length", this);
7544 7174
7545 String operator[](int index) => JS("String", "#[#]", this, index); 7175 String operator[](int index) => JS("String", "#[#]", this, index);
7546 7176
7547 void operator[]=(int index, String value) { 7177 void operator[]=(int index, String value) {
7548 throw new UnsupportedError("Cannot assign element of immutable List."); 7178 throw new UnsupportedError("Cannot assign element of immutable List.");
7549 } 7179 }
7550 // -- start List<String> mixins. 7180 // -- start List<String> mixins.
7551 // String is the element type. 7181 // String is the element type.
7552 7182
7553 // From Iterable<String>:
7554 7183
7555 Iterator<String> get iterator {
7556 // Note: NodeLists are not fixed size. And most probably length shouldn't
7557 // be cached in both iterator _and_ forEach method. For now caching it
7558 // for consistency.
7559 return new FixedSizeListIterator<String>(this);
7560 }
7561
7562 String reduce(String combine(String value, String element)) {
7563 return IterableMixinWorkaround.reduce(this, combine);
7564 }
7565
7566 dynamic fold(dynamic initialValue,
7567 dynamic combine(dynamic previousValue, String element)) {
7568 return IterableMixinWorkaround.fold(this, initialValue, combine);
7569 }
7570
7571 // contains() defined by IDL.
7572
7573 void forEach(void f(String element)) => IterableMixinWorkaround.forEach(this, f);
7574
7575 String join([String separator = ""]) =>
7576 IterableMixinWorkaround.joinList(this, separator);
7577
7578 Iterable map(f(String element)) =>
7579 IterableMixinWorkaround.mapList(this, f);
7580
7581 Iterable<String> where(bool f(String element)) =>
7582 IterableMixinWorkaround.where(this, f);
7583
7584 Iterable expand(Iterable f(String element)) =>
7585 IterableMixinWorkaround.expand(this, f);
7586
7587 bool every(bool f(String element)) => IterableMixinWorkaround.every(this, f);
7588
7589 bool any(bool f(String element)) => IterableMixinWorkaround.any(this, f);
7590
7591 List<String> toList({ bool growable: true }) =>
7592 new List<String>.from(this, growable: growable);
7593
7594 Set<String> toSet() => new Set<String>.from(this);
7595
7596 bool get isEmpty => this.length == 0;
7597
7598 Iterable<String> take(int n) => IterableMixinWorkaround.takeList(this, n);
7599
7600 Iterable<String> takeWhile(bool test(String value)) {
7601 return IterableMixinWorkaround.takeWhile(this, test);
7602 }
7603
7604 Iterable<String> skip(int n) => IterableMixinWorkaround.skipList(this, n);
7605
7606 Iterable<String> skipWhile(bool test(String value)) {
7607 return IterableMixinWorkaround.skipWhile(this, test);
7608 }
7609
7610 String firstWhere(bool test(String value), { String orElse() }) {
7611 return IterableMixinWorkaround.firstWhere(this, test, orElse);
7612 }
7613
7614 String lastWhere(bool test(String value), {String orElse()}) {
7615 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
7616 }
7617
7618 String singleWhere(bool test(String value)) {
7619 return IterableMixinWorkaround.singleWhere(this, test);
7620 }
7621
7622 String elementAt(int index) {
7623 return this[index];
7624 }
7625
7626 // From Collection<String>:
7627
7628 void add(String value) {
7629 throw new UnsupportedError("Cannot add to immutable List.");
7630 }
7631
7632 void addAll(Iterable<String> iterable) {
7633 throw new UnsupportedError("Cannot add to immutable List.");
7634 }
7635
7636 // From List<String>:
7637 void set length(int value) { 7184 void set length(int value) {
7638 throw new UnsupportedError("Cannot resize immutable List."); 7185 throw new UnsupportedError("Cannot resize immutable List.");
7639 } 7186 }
7640 7187
7641 void clear() {
7642 throw new UnsupportedError("Cannot clear immutable List.");
7643 }
7644
7645 Iterable<String> get reversed {
7646 return IterableMixinWorkaround.reversedList(this);
7647 }
7648
7649 void sort([int compare(String a, String b)]) {
7650 throw new UnsupportedError("Cannot sort immutable List.");
7651 }
7652
7653 int indexOf(String element, [int start = 0]) =>
7654 Lists.indexOf(this, element, start, this.length);
7655
7656 int lastIndexOf(String element, [int start]) {
7657 if (start == null) start = length - 1;
7658 return Lists.lastIndexOf(this, element, start);
7659 }
7660
7661 String get first {
7662 if (this.length > 0) return this[0];
7663 throw new StateError("No elements");
7664 }
7665
7666 String get last {
7667 if (this.length > 0) return this[this.length - 1];
7668 throw new StateError("No elements");
7669 }
7670
7671 String get single {
7672 if (length == 1) return this[0];
7673 if (length == 0) throw new StateError("No elements");
7674 throw new StateError("More than one element");
7675 }
7676
7677 void insert(int index, String element) {
7678 throw new UnsupportedError("Cannot add to immutable List.");
7679 }
7680
7681 void insertAll(int index, Iterable<String> iterable) {
7682 throw new UnsupportedError("Cannot add to immutable List.");
7683 }
7684
7685 void setAll(int index, Iterable<String> iterable) {
7686 throw new UnsupportedError("Cannot modify an immutable List.");
7687 }
7688
7689 String removeAt(int pos) {
7690 throw new UnsupportedError("Cannot remove from immutable List.");
7691 }
7692
7693 String removeLast() {
7694 throw new UnsupportedError("Cannot remove from immutable List.");
7695 }
7696
7697 bool remove(Object object) {
7698 throw new UnsupportedError("Cannot remove from immutable List.");
7699 }
7700
7701 void removeWhere(bool test(String element)) {
7702 throw new UnsupportedError("Cannot remove from immutable List.");
7703 }
7704
7705 void retainWhere(bool test(String element)) {
7706 throw new UnsupportedError("Cannot remove from immutable List.");
7707 }
7708
7709 void setRange(int start, int end, Iterable<String> iterable, [int skipCount=0] ) {
7710 throw new UnsupportedError("Cannot setRange on immutable List.");
7711 }
7712
7713 void removeRange(int start, int end) {
7714 throw new UnsupportedError("Cannot removeRange on immutable List.");
7715 }
7716
7717 void replaceRange(int start, int end, Iterable<String> iterable) {
7718 throw new UnsupportedError("Cannot modify an immutable List.");
7719 }
7720
7721 void fillRange(int start, int end, [String fillValue]) {
7722 throw new UnsupportedError("Cannot modify an immutable List.");
7723 }
7724
7725 Iterable<String> getRange(int start, int end) =>
7726 IterableMixinWorkaround.getRangeList(this, start, end);
7727
7728 List<String> sublist(int start, [int end]) {
7729 if (end == null) end = length;
7730 return Lists.getRange(this, start, end, <String>[]);
7731 }
7732
7733 Map<int, String> asMap() =>
7734 IterableMixinWorkaround.asMapList(this);
7735
7736 String toString() {
7737 StringBuffer buffer = new StringBuffer('[');
7738 buffer.writeAll(this, ', ');
7739 buffer.write(']');
7740 return buffer.toString();
7741 }
7742
7743 // -- end List<String> mixins. 7188 // -- end List<String> mixins.
7744 7189
7745 @DomName('DOMStringList.contains') 7190 @DomName('DOMStringList.contains')
7746 @DocsEditable 7191 @DocsEditable
7747 bool contains(String string) native; 7192 bool contains(String string) native;
7748 7193
7749 @DomName('DOMStringList.item') 7194 @DomName('DOMStringList.item')
7750 @DocsEditable 7195 @DocsEditable
7751 String item(int index) native; 7196 String item(int index) native;
7752 } 7197 }
(...skipping 2538 matching lines...) Expand 10 before | Expand all | Expand 10 after
10291 @DocsEditable 9736 @DocsEditable
10292 String toString() native; 9737 String toString() native;
10293 } 9738 }
10294 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9739 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10295 // for details. All rights reserved. Use of this source code is governed by a 9740 // for details. All rights reserved. Use of this source code is governed by a
10296 // BSD-style license that can be found in the LICENSE file. 9741 // BSD-style license that can be found in the LICENSE file.
10297 9742
10298 9743
10299 @DocsEditable 9744 @DocsEditable
10300 @DomName('FileList') 9745 @DomName('FileList')
10301 class FileList implements JavaScriptIndexingBehavior, List<File> native "FileLis t" { 9746 class FileList extends Object with ListMixin<File>, ImmutableListMixin<File> imp lements JavaScriptIndexingBehavior, List<File> native "FileList" {
10302 9747
10303 @DomName('FileList.length') 9748 @DomName('FileList.length')
10304 @DocsEditable 9749 @DocsEditable
10305 int get length => JS("int", "#.length", this); 9750 int get length => JS("int", "#.length", this);
10306 9751
10307 File operator[](int index) => JS("File", "#[#]", this, index); 9752 File operator[](int index) => JS("File", "#[#]", this, index);
10308 9753
10309 void operator[]=(int index, File value) { 9754 void operator[]=(int index, File value) {
10310 throw new UnsupportedError("Cannot assign element of immutable List."); 9755 throw new UnsupportedError("Cannot assign element of immutable List.");
10311 } 9756 }
10312 // -- start List<File> mixins. 9757 // -- start List<File> mixins.
10313 // File is the element type. 9758 // File is the element type.
10314 9759
10315 // From Iterable<File>:
10316 9760
10317 Iterator<File> get iterator {
10318 // Note: NodeLists are not fixed size. And most probably length shouldn't
10319 // be cached in both iterator _and_ forEach method. For now caching it
10320 // for consistency.
10321 return new FixedSizeListIterator<File>(this);
10322 }
10323
10324 File reduce(File combine(File value, File element)) {
10325 return IterableMixinWorkaround.reduce(this, combine);
10326 }
10327
10328 dynamic fold(dynamic initialValue,
10329 dynamic combine(dynamic previousValue, File element)) {
10330 return IterableMixinWorkaround.fold(this, initialValue, combine);
10331 }
10332
10333 bool contains(File element) => IterableMixinWorkaround.contains(this, element) ;
10334
10335 void forEach(void f(File element)) => IterableMixinWorkaround.forEach(this, f) ;
10336
10337 String join([String separator = ""]) =>
10338 IterableMixinWorkaround.joinList(this, separator);
10339
10340 Iterable map(f(File element)) =>
10341 IterableMixinWorkaround.mapList(this, f);
10342
10343 Iterable<File> where(bool f(File element)) =>
10344 IterableMixinWorkaround.where(this, f);
10345
10346 Iterable expand(Iterable f(File element)) =>
10347 IterableMixinWorkaround.expand(this, f);
10348
10349 bool every(bool f(File element)) => IterableMixinWorkaround.every(this, f);
10350
10351 bool any(bool f(File element)) => IterableMixinWorkaround.any(this, f);
10352
10353 List<File> toList({ bool growable: true }) =>
10354 new List<File>.from(this, growable: growable);
10355
10356 Set<File> toSet() => new Set<File>.from(this);
10357
10358 bool get isEmpty => this.length == 0;
10359
10360 Iterable<File> take(int n) => IterableMixinWorkaround.takeList(this, n);
10361
10362 Iterable<File> takeWhile(bool test(File value)) {
10363 return IterableMixinWorkaround.takeWhile(this, test);
10364 }
10365
10366 Iterable<File> skip(int n) => IterableMixinWorkaround.skipList(this, n);
10367
10368 Iterable<File> skipWhile(bool test(File value)) {
10369 return IterableMixinWorkaround.skipWhile(this, test);
10370 }
10371
10372 File firstWhere(bool test(File value), { File orElse() }) {
10373 return IterableMixinWorkaround.firstWhere(this, test, orElse);
10374 }
10375
10376 File lastWhere(bool test(File value), {File orElse()}) {
10377 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
10378 }
10379
10380 File singleWhere(bool test(File value)) {
10381 return IterableMixinWorkaround.singleWhere(this, test);
10382 }
10383
10384 File elementAt(int index) {
10385 return this[index];
10386 }
10387
10388 // From Collection<File>:
10389
10390 void add(File value) {
10391 throw new UnsupportedError("Cannot add to immutable List.");
10392 }
10393
10394 void addAll(Iterable<File> iterable) {
10395 throw new UnsupportedError("Cannot add to immutable List.");
10396 }
10397
10398 // From List<File>:
10399 void set length(int value) { 9761 void set length(int value) {
10400 throw new UnsupportedError("Cannot resize immutable List."); 9762 throw new UnsupportedError("Cannot resize immutable List.");
10401 } 9763 }
10402 9764
10403 void clear() {
10404 throw new UnsupportedError("Cannot clear immutable List.");
10405 }
10406
10407 Iterable<File> get reversed {
10408 return IterableMixinWorkaround.reversedList(this);
10409 }
10410
10411 void sort([int compare(File a, File b)]) {
10412 throw new UnsupportedError("Cannot sort immutable List.");
10413 }
10414
10415 int indexOf(File element, [int start = 0]) =>
10416 Lists.indexOf(this, element, start, this.length);
10417
10418 int lastIndexOf(File element, [int start]) {
10419 if (start == null) start = length - 1;
10420 return Lists.lastIndexOf(this, element, start);
10421 }
10422
10423 File get first {
10424 if (this.length > 0) return this[0];
10425 throw new StateError("No elements");
10426 }
10427
10428 File get last {
10429 if (this.length > 0) return this[this.length - 1];
10430 throw new StateError("No elements");
10431 }
10432
10433 File get single {
10434 if (length == 1) return this[0];
10435 if (length == 0) throw new StateError("No elements");
10436 throw new StateError("More than one element");
10437 }
10438
10439 void insert(int index, File element) {
10440 throw new UnsupportedError("Cannot add to immutable List.");
10441 }
10442
10443 void insertAll(int index, Iterable<File> iterable) {
10444 throw new UnsupportedError("Cannot add to immutable List.");
10445 }
10446
10447 void setAll(int index, Iterable<File> iterable) {
10448 throw new UnsupportedError("Cannot modify an immutable List.");
10449 }
10450
10451 File removeAt(int pos) {
10452 throw new UnsupportedError("Cannot remove from immutable List.");
10453 }
10454
10455 File removeLast() {
10456 throw new UnsupportedError("Cannot remove from immutable List.");
10457 }
10458
10459 bool remove(Object object) {
10460 throw new UnsupportedError("Cannot remove from immutable List.");
10461 }
10462
10463 void removeWhere(bool test(File element)) {
10464 throw new UnsupportedError("Cannot remove from immutable List.");
10465 }
10466
10467 void retainWhere(bool test(File element)) {
10468 throw new UnsupportedError("Cannot remove from immutable List.");
10469 }
10470
10471 void setRange(int start, int end, Iterable<File> iterable, [int skipCount=0]) {
10472 throw new UnsupportedError("Cannot setRange on immutable List.");
10473 }
10474
10475 void removeRange(int start, int end) {
10476 throw new UnsupportedError("Cannot removeRange on immutable List.");
10477 }
10478
10479 void replaceRange(int start, int end, Iterable<File> iterable) {
10480 throw new UnsupportedError("Cannot modify an immutable List.");
10481 }
10482
10483 void fillRange(int start, int end, [File fillValue]) {
10484 throw new UnsupportedError("Cannot modify an immutable List.");
10485 }
10486
10487 Iterable<File> getRange(int start, int end) =>
10488 IterableMixinWorkaround.getRangeList(this, start, end);
10489
10490 List<File> sublist(int start, [int end]) {
10491 if (end == null) end = length;
10492 return Lists.getRange(this, start, end, <File>[]);
10493 }
10494
10495 Map<int, File> asMap() =>
10496 IterableMixinWorkaround.asMapList(this);
10497
10498 String toString() {
10499 StringBuffer buffer = new StringBuffer('[');
10500 buffer.writeAll(this, ', ');
10501 buffer.write(']');
10502 return buffer.toString();
10503 }
10504
10505 // -- end List<File> mixins. 9765 // -- end List<File> mixins.
10506 9766
10507 @DomName('FileList.item') 9767 @DomName('FileList.item')
10508 @DocsEditable 9768 @DocsEditable
10509 File item(int index) native; 9769 File item(int index) native;
10510 } 9770 }
10511 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9771 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10512 // for details. All rights reserved. Use of this source code is governed by a 9772 // for details. All rights reserved. Use of this source code is governed by a
10513 // BSD-style license that can be found in the LICENSE file. 9773 // BSD-style license that can be found in the LICENSE file.
10514 9774
(...skipping 758 matching lines...) Expand 10 before | Expand all | Expand 10 after
11273 @SupportedBrowser(SupportedBrowser.SAFARI) 10533 @SupportedBrowser(SupportedBrowser.SAFARI)
11274 void replaceState(Object data, String title, [String url]) native; 10534 void replaceState(Object data, String title, [String url]) native;
11275 } 10535 }
11276 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10536 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
11277 // for details. All rights reserved. Use of this source code is governed by a 10537 // for details. All rights reserved. Use of this source code is governed by a
11278 // BSD-style license that can be found in the LICENSE file. 10538 // BSD-style license that can be found in the LICENSE file.
11279 10539
11280 10540
11281 @DocsEditable 10541 @DocsEditable
11282 @DomName('HTMLAllCollection') 10542 @DomName('HTMLAllCollection')
11283 class HtmlAllCollection implements JavaScriptIndexingBehavior, List<Node> native "HTMLAllCollection" { 10543 class HtmlAllCollection extends Object with ImmutableListMixin<Node>, ListMixin< Node> implements JavaScriptIndexingBehavior, List<Node> native "HTMLAllCollectio n" {
11284 10544
11285 @DomName('HTMLAllCollection.length') 10545 @DomName('HTMLAllCollection.length')
11286 @DocsEditable 10546 @DocsEditable
11287 int get length => JS("int", "#.length", this); 10547 int get length => JS("int", "#.length", this);
11288 10548
11289 Node operator[](int index) => JS("Node", "#[#]", this, index); 10549 Node operator[](int index) => JS("Node", "#[#]", this, index);
11290 10550
11291 void operator[]=(int index, Node value) { 10551 void operator[]=(int index, Node value) {
11292 throw new UnsupportedError("Cannot assign element of immutable List."); 10552 throw new UnsupportedError("Cannot assign element of immutable List.");
11293 } 10553 }
11294 // -- start List<Node> mixins. 10554 // -- start List<Node> mixins.
11295 // Node is the element type. 10555 // Node is the element type.
11296 10556
11297 // From Iterable<Node>:
11298 10557
11299 Iterator<Node> get iterator {
11300 // Note: NodeLists are not fixed size. And most probably length shouldn't
11301 // be cached in both iterator _and_ forEach method. For now caching it
11302 // for consistency.
11303 return new FixedSizeListIterator<Node>(this);
11304 }
11305
11306 Node reduce(Node combine(Node value, Node element)) {
11307 return IterableMixinWorkaround.reduce(this, combine);
11308 }
11309
11310 dynamic fold(dynamic initialValue,
11311 dynamic combine(dynamic previousValue, Node element)) {
11312 return IterableMixinWorkaround.fold(this, initialValue, combine);
11313 }
11314
11315 bool contains(Node element) => IterableMixinWorkaround.contains(this, element) ;
11316
11317 void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f) ;
11318
11319 String join([String separator = ""]) =>
11320 IterableMixinWorkaround.joinList(this, separator);
11321
11322 Iterable map(f(Node element)) =>
11323 IterableMixinWorkaround.mapList(this, f);
11324
11325 Iterable<Node> where(bool f(Node element)) =>
11326 IterableMixinWorkaround.where(this, f);
11327
11328 Iterable expand(Iterable f(Node element)) =>
11329 IterableMixinWorkaround.expand(this, f);
11330
11331 bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
11332
11333 bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
11334
11335 List<Node> toList({ bool growable: true }) =>
11336 new List<Node>.from(this, growable: growable);
11337
11338 Set<Node> toSet() => new Set<Node>.from(this);
11339
11340 bool get isEmpty => this.length == 0;
11341
11342 Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
11343
11344 Iterable<Node> takeWhile(bool test(Node value)) {
11345 return IterableMixinWorkaround.takeWhile(this, test);
11346 }
11347
11348 Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
11349
11350 Iterable<Node> skipWhile(bool test(Node value)) {
11351 return IterableMixinWorkaround.skipWhile(this, test);
11352 }
11353
11354 Node firstWhere(bool test(Node value), { Node orElse() }) {
11355 return IterableMixinWorkaround.firstWhere(this, test, orElse);
11356 }
11357
11358 Node lastWhere(bool test(Node value), {Node orElse()}) {
11359 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
11360 }
11361
11362 Node singleWhere(bool test(Node value)) {
11363 return IterableMixinWorkaround.singleWhere(this, test);
11364 }
11365
11366 Node elementAt(int index) {
11367 return this[index];
11368 }
11369
11370 // From Collection<Node>:
11371
11372 void add(Node value) {
11373 throw new UnsupportedError("Cannot add to immutable List.");
11374 }
11375
11376 void addAll(Iterable<Node> iterable) {
11377 throw new UnsupportedError("Cannot add to immutable List.");
11378 }
11379
11380 // From List<Node>:
11381 void set length(int value) { 10558 void set length(int value) {
11382 throw new UnsupportedError("Cannot resize immutable List."); 10559 throw new UnsupportedError("Cannot resize immutable List.");
11383 } 10560 }
11384 10561
11385 void clear() {
11386 throw new UnsupportedError("Cannot clear immutable List.");
11387 }
11388
11389 Iterable<Node> get reversed {
11390 return IterableMixinWorkaround.reversedList(this);
11391 }
11392
11393 void sort([int compare(Node a, Node b)]) {
11394 throw new UnsupportedError("Cannot sort immutable List.");
11395 }
11396
11397 int indexOf(Node element, [int start = 0]) =>
11398 Lists.indexOf(this, element, start, this.length);
11399
11400 int lastIndexOf(Node element, [int start]) {
11401 if (start == null) start = length - 1;
11402 return Lists.lastIndexOf(this, element, start);
11403 }
11404
11405 Node get first {
11406 if (this.length > 0) return this[0];
11407 throw new StateError("No elements");
11408 }
11409
11410 Node get last {
11411 if (this.length > 0) return this[this.length - 1];
11412 throw new StateError("No elements");
11413 }
11414
11415 Node get single {
11416 if (length == 1) return this[0];
11417 if (length == 0) throw new StateError("No elements");
11418 throw new StateError("More than one element");
11419 }
11420
11421 void insert(int index, Node element) {
11422 throw new UnsupportedError("Cannot add to immutable List.");
11423 }
11424
11425 void insertAll(int index, Iterable<Node> iterable) {
11426 throw new UnsupportedError("Cannot add to immutable List.");
11427 }
11428
11429 void setAll(int index, Iterable<Node> iterable) {
11430 throw new UnsupportedError("Cannot modify an immutable List.");
11431 }
11432
11433 Node removeAt(int pos) {
11434 throw new UnsupportedError("Cannot remove from immutable List.");
11435 }
11436
11437 Node removeLast() {
11438 throw new UnsupportedError("Cannot remove from immutable List.");
11439 }
11440
11441 bool remove(Object object) {
11442 throw new UnsupportedError("Cannot remove from immutable List.");
11443 }
11444
11445 void removeWhere(bool test(Node element)) {
11446 throw new UnsupportedError("Cannot remove from immutable List.");
11447 }
11448
11449 void retainWhere(bool test(Node element)) {
11450 throw new UnsupportedError("Cannot remove from immutable List.");
11451 }
11452
11453 void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
11454 throw new UnsupportedError("Cannot setRange on immutable List.");
11455 }
11456
11457 void removeRange(int start, int end) {
11458 throw new UnsupportedError("Cannot removeRange on immutable List.");
11459 }
11460
11461 void replaceRange(int start, int end, Iterable<Node> iterable) {
11462 throw new UnsupportedError("Cannot modify an immutable List.");
11463 }
11464
11465 void fillRange(int start, int end, [Node fillValue]) {
11466 throw new UnsupportedError("Cannot modify an immutable List.");
11467 }
11468
11469 Iterable<Node> getRange(int start, int end) =>
11470 IterableMixinWorkaround.getRangeList(this, start, end);
11471
11472 List<Node> sublist(int start, [int end]) {
11473 if (end == null) end = length;
11474 return Lists.getRange(this, start, end, <Node>[]);
11475 }
11476
11477 Map<int, Node> asMap() =>
11478 IterableMixinWorkaround.asMapList(this);
11479
11480 String toString() {
11481 StringBuffer buffer = new StringBuffer('[');
11482 buffer.writeAll(this, ', ');
11483 buffer.write(']');
11484 return buffer.toString();
11485 }
11486
11487 // -- end List<Node> mixins. 10562 // -- end List<Node> mixins.
11488 10563
11489 @DomName('HTMLAllCollection.item') 10564 @DomName('HTMLAllCollection.item')
11490 @DocsEditable 10565 @DocsEditable
11491 Node item(int index) native; 10566 Node item(int index) native;
11492 10567
11493 @DomName('HTMLAllCollection.namedItem') 10568 @DomName('HTMLAllCollection.namedItem')
11494 @DocsEditable 10569 @DocsEditable
11495 Node namedItem(String name) native; 10570 Node namedItem(String name) native;
11496 10571
11497 @DomName('HTMLAllCollection.tags') 10572 @DomName('HTMLAllCollection.tags')
11498 @DocsEditable 10573 @DocsEditable
11499 @Returns('NodeList') 10574 @Returns('NodeList')
11500 @Creates('NodeList') 10575 @Creates('NodeList')
11501 List<Node> tags(String name) native; 10576 List<Node> tags(String name) native;
11502 } 10577 }
11503 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10578 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
11504 // for details. All rights reserved. Use of this source code is governed by a 10579 // for details. All rights reserved. Use of this source code is governed by a
11505 // BSD-style license that can be found in the LICENSE file. 10580 // BSD-style license that can be found in the LICENSE file.
11506 10581
11507 10582
11508 @DocsEditable 10583 @DocsEditable
11509 @DomName('HTMLCollection') 10584 @DomName('HTMLCollection')
11510 class HtmlCollection implements JavaScriptIndexingBehavior, List<Node> native "H TMLCollection" { 10585 class HtmlCollection extends Object with ImmutableListMixin<Node>, ListMixin<Nod e> implements JavaScriptIndexingBehavior, List<Node> native "HTMLCollection" {
11511 10586
11512 @DomName('HTMLCollection.length') 10587 @DomName('HTMLCollection.length')
11513 @DocsEditable 10588 @DocsEditable
11514 int get length => JS("int", "#.length", this); 10589 int get length => JS("int", "#.length", this);
11515 10590
11516 Node operator[](int index) => JS("Node", "#[#]", this, index); 10591 Node operator[](int index) => JS("Node", "#[#]", this, index);
11517 10592
11518 void operator[]=(int index, Node value) { 10593 void operator[]=(int index, Node value) {
11519 throw new UnsupportedError("Cannot assign element of immutable List."); 10594 throw new UnsupportedError("Cannot assign element of immutable List.");
11520 } 10595 }
11521 // -- start List<Node> mixins. 10596 // -- start List<Node> mixins.
11522 // Node is the element type. 10597 // Node is the element type.
11523 10598
11524 // From Iterable<Node>:
11525 10599
11526 Iterator<Node> get iterator {
11527 // Note: NodeLists are not fixed size. And most probably length shouldn't
11528 // be cached in both iterator _and_ forEach method. For now caching it
11529 // for consistency.
11530 return new FixedSizeListIterator<Node>(this);
11531 }
11532
11533 Node reduce(Node combine(Node value, Node element)) {
11534 return IterableMixinWorkaround.reduce(this, combine);
11535 }
11536
11537 dynamic fold(dynamic initialValue,
11538 dynamic combine(dynamic previousValue, Node element)) {
11539 return IterableMixinWorkaround.fold(this, initialValue, combine);
11540 }
11541
11542 bool contains(Node element) => IterableMixinWorkaround.contains(this, element) ;
11543
11544 void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f) ;
11545
11546 String join([String separator = ""]) =>
11547 IterableMixinWorkaround.joinList(this, separator);
11548
11549 Iterable map(f(Node element)) =>
11550 IterableMixinWorkaround.mapList(this, f);
11551
11552 Iterable<Node> where(bool f(Node element)) =>
11553 IterableMixinWorkaround.where(this, f);
11554
11555 Iterable expand(Iterable f(Node element)) =>
11556 IterableMixinWorkaround.expand(this, f);
11557
11558 bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
11559
11560 bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
11561
11562 List<Node> toList({ bool growable: true }) =>
11563 new List<Node>.from(this, growable: growable);
11564
11565 Set<Node> toSet() => new Set<Node>.from(this);
11566
11567 bool get isEmpty => this.length == 0;
11568
11569 Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
11570
11571 Iterable<Node> takeWhile(bool test(Node value)) {
11572 return IterableMixinWorkaround.takeWhile(this, test);
11573 }
11574
11575 Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
11576
11577 Iterable<Node> skipWhile(bool test(Node value)) {
11578 return IterableMixinWorkaround.skipWhile(this, test);
11579 }
11580
11581 Node firstWhere(bool test(Node value), { Node orElse() }) {
11582 return IterableMixinWorkaround.firstWhere(this, test, orElse);
11583 }
11584
11585 Node lastWhere(bool test(Node value), {Node orElse()}) {
11586 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
11587 }
11588
11589 Node singleWhere(bool test(Node value)) {
11590 return IterableMixinWorkaround.singleWhere(this, test);
11591 }
11592
11593 Node elementAt(int index) {
11594 return this[index];
11595 }
11596
11597 // From Collection<Node>:
11598
11599 void add(Node value) {
11600 throw new UnsupportedError("Cannot add to immutable List.");
11601 }
11602
11603 void addAll(Iterable<Node> iterable) {
11604 throw new UnsupportedError("Cannot add to immutable List.");
11605 }
11606
11607 // From List<Node>:
11608 void set length(int value) { 10600 void set length(int value) {
11609 throw new UnsupportedError("Cannot resize immutable List."); 10601 throw new UnsupportedError("Cannot resize immutable List.");
11610 } 10602 }
11611 10603
11612 void clear() {
11613 throw new UnsupportedError("Cannot clear immutable List.");
11614 }
11615
11616 Iterable<Node> get reversed {
11617 return IterableMixinWorkaround.reversedList(this);
11618 }
11619
11620 void sort([int compare(Node a, Node b)]) {
11621 throw new UnsupportedError("Cannot sort immutable List.");
11622 }
11623
11624 int indexOf(Node element, [int start = 0]) =>
11625 Lists.indexOf(this, element, start, this.length);
11626
11627 int lastIndexOf(Node element, [int start]) {
11628 if (start == null) start = length - 1;
11629 return Lists.lastIndexOf(this, element, start);
11630 }
11631
11632 Node get first {
11633 if (this.length > 0) return this[0];
11634 throw new StateError("No elements");
11635 }
11636
11637 Node get last {
11638 if (this.length > 0) return this[this.length - 1];
11639 throw new StateError("No elements");
11640 }
11641
11642 Node get single {
11643 if (length == 1) return this[0];
11644 if (length == 0) throw new StateError("No elements");
11645 throw new StateError("More than one element");
11646 }
11647
11648 void insert(int index, Node element) {
11649 throw new UnsupportedError("Cannot add to immutable List.");
11650 }
11651
11652 void insertAll(int index, Iterable<Node> iterable) {
11653 throw new UnsupportedError("Cannot add to immutable List.");
11654 }
11655
11656 void setAll(int index, Iterable<Node> iterable) {
11657 throw new UnsupportedError("Cannot modify an immutable List.");
11658 }
11659
11660 Node removeAt(int pos) {
11661 throw new UnsupportedError("Cannot remove from immutable List.");
11662 }
11663
11664 Node removeLast() {
11665 throw new UnsupportedError("Cannot remove from immutable List.");
11666 }
11667
11668 bool remove(Object object) {
11669 throw new UnsupportedError("Cannot remove from immutable List.");
11670 }
11671
11672 void removeWhere(bool test(Node element)) {
11673 throw new UnsupportedError("Cannot remove from immutable List.");
11674 }
11675
11676 void retainWhere(bool test(Node element)) {
11677 throw new UnsupportedError("Cannot remove from immutable List.");
11678 }
11679
11680 void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
11681 throw new UnsupportedError("Cannot setRange on immutable List.");
11682 }
11683
11684 void removeRange(int start, int end) {
11685 throw new UnsupportedError("Cannot removeRange on immutable List.");
11686 }
11687
11688 void replaceRange(int start, int end, Iterable<Node> iterable) {
11689 throw new UnsupportedError("Cannot modify an immutable List.");
11690 }
11691
11692 void fillRange(int start, int end, [Node fillValue]) {
11693 throw new UnsupportedError("Cannot modify an immutable List.");
11694 }
11695
11696 Iterable<Node> getRange(int start, int end) =>
11697 IterableMixinWorkaround.getRangeList(this, start, end);
11698
11699 List<Node> sublist(int start, [int end]) {
11700 if (end == null) end = length;
11701 return Lists.getRange(this, start, end, <Node>[]);
11702 }
11703
11704 Map<int, Node> asMap() =>
11705 IterableMixinWorkaround.asMapList(this);
11706
11707 String toString() {
11708 StringBuffer buffer = new StringBuffer('[');
11709 buffer.writeAll(this, ', ');
11710 buffer.write(']');
11711 return buffer.toString();
11712 }
11713
11714 // -- end List<Node> mixins. 10604 // -- end List<Node> mixins.
11715 10605
11716 @DomName('HTMLCollection.item') 10606 @DomName('HTMLCollection.item')
11717 @DocsEditable 10607 @DocsEditable
11718 Node item(int index) native; 10608 Node item(int index) native;
11719 10609
11720 @DomName('HTMLCollection.namedItem') 10610 @DomName('HTMLCollection.namedItem')
11721 @DocsEditable 10611 @DocsEditable
11722 Node namedItem(String name) native; 10612 Node namedItem(String name) native;
11723 } 10613 }
(...skipping 4641 matching lines...) Expand 10 before | Expand all | Expand 10 after
16365 @DocsEditable 15255 @DocsEditable
16366 Node previousNode() native; 15256 Node previousNode() native;
16367 } 15257 }
16368 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 15258 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
16369 // for details. All rights reserved. Use of this source code is governed by a 15259 // for details. All rights reserved. Use of this source code is governed by a
16370 // BSD-style license that can be found in the LICENSE file. 15260 // BSD-style license that can be found in the LICENSE file.
16371 15261
16372 15262
16373 @DocsEditable 15263 @DocsEditable
16374 @DomName('NodeList') 15264 @DomName('NodeList')
16375 class NodeList implements JavaScriptIndexingBehavior, List<Node> native "NodeLis t,RadioNodeList" { 15265 class NodeList extends Object with ImmutableListMixin<Node>, ListMixin<Node> imp lements JavaScriptIndexingBehavior, List<Node> native "NodeList,RadioNodeList" {
16376 15266
16377 @DomName('NodeList.length') 15267 @DomName('NodeList.length')
16378 @DocsEditable 15268 @DocsEditable
16379 int get length => JS("int", "#.length", this); 15269 int get length => JS("int", "#.length", this);
16380 15270
16381 Node operator[](int index) => JS("Node", "#[#]", this, index); 15271 Node operator[](int index) => JS("Node", "#[#]", this, index);
16382 15272
16383 void operator[]=(int index, Node value) { 15273 void operator[]=(int index, Node value) {
16384 throw new UnsupportedError("Cannot assign element of immutable List."); 15274 throw new UnsupportedError("Cannot assign element of immutable List.");
16385 } 15275 }
16386 // -- start List<Node> mixins. 15276 // -- start List<Node> mixins.
16387 // Node is the element type. 15277 // Node is the element type.
16388 15278
16389 // From Iterable<Node>:
16390 15279
16391 Iterator<Node> get iterator {
16392 // Note: NodeLists are not fixed size. And most probably length shouldn't
16393 // be cached in both iterator _and_ forEach method. For now caching it
16394 // for consistency.
16395 return new FixedSizeListIterator<Node>(this);
16396 }
16397
16398 Node reduce(Node combine(Node value, Node element)) {
16399 return IterableMixinWorkaround.reduce(this, combine);
16400 }
16401
16402 dynamic fold(dynamic initialValue,
16403 dynamic combine(dynamic previousValue, Node element)) {
16404 return IterableMixinWorkaround.fold(this, initialValue, combine);
16405 }
16406
16407 bool contains(Node element) => IterableMixinWorkaround.contains(this, element) ;
16408
16409 void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f) ;
16410
16411 String join([String separator = ""]) =>
16412 IterableMixinWorkaround.joinList(this, separator);
16413
16414 Iterable map(f(Node element)) =>
16415 IterableMixinWorkaround.mapList(this, f);
16416
16417 Iterable<Node> where(bool f(Node element)) =>
16418 IterableMixinWorkaround.where(this, f);
16419
16420 Iterable expand(Iterable f(Node element)) =>
16421 IterableMixinWorkaround.expand(this, f);
16422
16423 bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f);
16424
16425 bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f);
16426
16427 List<Node> toList({ bool growable: true }) =>
16428 new List<Node>.from(this, growable: growable);
16429
16430 Set<Node> toSet() => new Set<Node>.from(this);
16431
16432 bool get isEmpty => this.length == 0;
16433
16434 Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n);
16435
16436 Iterable<Node> takeWhile(bool test(Node value)) {
16437 return IterableMixinWorkaround.takeWhile(this, test);
16438 }
16439
16440 Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n);
16441
16442 Iterable<Node> skipWhile(bool test(Node value)) {
16443 return IterableMixinWorkaround.skipWhile(this, test);
16444 }
16445
16446 Node firstWhere(bool test(Node value), { Node orElse() }) {
16447 return IterableMixinWorkaround.firstWhere(this, test, orElse);
16448 }
16449
16450 Node lastWhere(bool test(Node value), {Node orElse()}) {
16451 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
16452 }
16453
16454 Node singleWhere(bool test(Node value)) {
16455 return IterableMixinWorkaround.singleWhere(this, test);
16456 }
16457
16458 Node elementAt(int index) {
16459 return this[index];
16460 }
16461
16462 // From Collection<Node>:
16463
16464 void add(Node value) {
16465 throw new UnsupportedError("Cannot add to immutable List.");
16466 }
16467
16468 void addAll(Iterable<Node> iterable) {
16469 throw new UnsupportedError("Cannot add to immutable List.");
16470 }
16471
16472 // From List<Node>:
16473 void set length(int value) { 15280 void set length(int value) {
16474 throw new UnsupportedError("Cannot resize immutable List."); 15281 throw new UnsupportedError("Cannot resize immutable List.");
16475 } 15282 }
16476 15283
16477 void clear() {
16478 throw new UnsupportedError("Cannot clear immutable List.");
16479 }
16480
16481 Iterable<Node> get reversed {
16482 return IterableMixinWorkaround.reversedList(this);
16483 }
16484
16485 void sort([int compare(Node a, Node b)]) {
16486 throw new UnsupportedError("Cannot sort immutable List.");
16487 }
16488
16489 int indexOf(Node element, [int start = 0]) =>
16490 Lists.indexOf(this, element, start, this.length);
16491
16492 int lastIndexOf(Node element, [int start]) {
16493 if (start == null) start = length - 1;
16494 return Lists.lastIndexOf(this, element, start);
16495 }
16496
16497 Node get first {
16498 if (this.length > 0) return this[0];
16499 throw new StateError("No elements");
16500 }
16501
16502 Node get last {
16503 if (this.length > 0) return this[this.length - 1];
16504 throw new StateError("No elements");
16505 }
16506
16507 Node get single {
16508 if (length == 1) return this[0];
16509 if (length == 0) throw new StateError("No elements");
16510 throw new StateError("More than one element");
16511 }
16512
16513 void insert(int index, Node element) {
16514 throw new UnsupportedError("Cannot add to immutable List.");
16515 }
16516
16517 void insertAll(int index, Iterable<Node> iterable) {
16518 throw new UnsupportedError("Cannot add to immutable List.");
16519 }
16520
16521 void setAll(int index, Iterable<Node> iterable) {
16522 throw new UnsupportedError("Cannot modify an immutable List.");
16523 }
16524
16525 Node removeAt(int pos) {
16526 throw new UnsupportedError("Cannot remove from immutable List.");
16527 }
16528
16529 Node removeLast() {
16530 throw new UnsupportedError("Cannot remove from immutable List.");
16531 }
16532
16533 bool remove(Object object) {
16534 throw new UnsupportedError("Cannot remove from immutable List.");
16535 }
16536
16537 void removeWhere(bool test(Node element)) {
16538 throw new UnsupportedError("Cannot remove from immutable List.");
16539 }
16540
16541 void retainWhere(bool test(Node element)) {
16542 throw new UnsupportedError("Cannot remove from immutable List.");
16543 }
16544
16545 void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
16546 throw new UnsupportedError("Cannot setRange on immutable List.");
16547 }
16548
16549 void removeRange(int start, int end) {
16550 throw new UnsupportedError("Cannot removeRange on immutable List.");
16551 }
16552
16553 void replaceRange(int start, int end, Iterable<Node> iterable) {
16554 throw new UnsupportedError("Cannot modify an immutable List.");
16555 }
16556
16557 void fillRange(int start, int end, [Node fillValue]) {
16558 throw new UnsupportedError("Cannot modify an immutable List.");
16559 }
16560
16561 Iterable<Node> getRange(int start, int end) =>
16562 IterableMixinWorkaround.getRangeList(this, start, end);
16563
16564 List<Node> sublist(int start, [int end]) {
16565 if (end == null) end = length;
16566 return Lists.getRange(this, start, end, <Node>[]);
16567 }
16568
16569 Map<int, Node> asMap() =>
16570 IterableMixinWorkaround.asMapList(this);
16571
16572 String toString() {
16573 StringBuffer buffer = new StringBuffer('[');
16574 buffer.writeAll(this, ', ');
16575 buffer.write(']');
16576 return buffer.toString();
16577 }
16578
16579 // -- end List<Node> mixins. 15284 // -- end List<Node> mixins.
16580 15285
16581 @JSName('item') 15286 @JSName('item')
16582 @DomName('NodeList.item') 15287 @DomName('NodeList.item')
16583 @DocsEditable 15288 @DocsEditable
16584 Node _item(int index) native; 15289 Node _item(int index) native;
16585 } 15290 }
16586 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 15291 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
16587 // for details. All rights reserved. Use of this source code is governed by a 15292 // for details. All rights reserved. Use of this source code is governed by a
16588 // BSD-style license that can be found in the LICENSE file. 15293 // BSD-style license that can be found in the LICENSE file.
(...skipping 2308 matching lines...) Expand 10 before | Expand all | Expand 10 after
18897 @DocsEditable 17602 @DocsEditable
18898 void append(Uint8List data) native; 17603 void append(Uint8List data) native;
18899 } 17604 }
18900 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 17605 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
18901 // for details. All rights reserved. Use of this source code is governed by a 17606 // for details. All rights reserved. Use of this source code is governed by a
18902 // BSD-style license that can be found in the LICENSE file. 17607 // BSD-style license that can be found in the LICENSE file.
18903 17608
18904 17609
18905 @DocsEditable 17610 @DocsEditable
18906 @DomName('SourceBufferList') 17611 @DomName('SourceBufferList')
18907 class SourceBufferList extends EventTarget implements JavaScriptIndexingBehavior , List<SourceBuffer> native "SourceBufferList" { 17612 class SourceBufferList extends EventTarget with ListMixin<SourceBuffer>, Immutab leListMixin<SourceBuffer> implements JavaScriptIndexingBehavior, List<SourceBuff er> native "SourceBufferList" {
18908 17613
18909 @DomName('SourceBufferList.length') 17614 @DomName('SourceBufferList.length')
18910 @DocsEditable 17615 @DocsEditable
18911 int get length => JS("int", "#.length", this); 17616 int get length => JS("int", "#.length", this);
18912 17617
18913 SourceBuffer operator[](int index) => JS("SourceBuffer", "#[#]", this, index); 17618 SourceBuffer operator[](int index) => JS("SourceBuffer", "#[#]", this, index);
18914 17619
18915 void operator[]=(int index, SourceBuffer value) { 17620 void operator[]=(int index, SourceBuffer value) {
18916 throw new UnsupportedError("Cannot assign element of immutable List."); 17621 throw new UnsupportedError("Cannot assign element of immutable List.");
18917 } 17622 }
18918 // -- start List<SourceBuffer> mixins. 17623 // -- start List<SourceBuffer> mixins.
18919 // SourceBuffer is the element type. 17624 // SourceBuffer is the element type.
18920 17625
18921 // From Iterable<SourceBuffer>:
18922 17626
18923 Iterator<SourceBuffer> get iterator {
18924 // Note: NodeLists are not fixed size. And most probably length shouldn't
18925 // be cached in both iterator _and_ forEach method. For now caching it
18926 // for consistency.
18927 return new FixedSizeListIterator<SourceBuffer>(this);
18928 }
18929
18930 SourceBuffer reduce(SourceBuffer combine(SourceBuffer value, SourceBuffer elem ent)) {
18931 return IterableMixinWorkaround.reduce(this, combine);
18932 }
18933
18934 dynamic fold(dynamic initialValue,
18935 dynamic combine(dynamic previousValue, SourceBuffer element)) {
18936 return IterableMixinWorkaround.fold(this, initialValue, combine);
18937 }
18938
18939 bool contains(SourceBuffer element) => IterableMixinWorkaround.contains(this, element);
18940
18941 void forEach(void f(SourceBuffer element)) => IterableMixinWorkaround.forEach( this, f);
18942
18943 String join([String separator = ""]) =>
18944 IterableMixinWorkaround.joinList(this, separator);
18945
18946 Iterable map(f(SourceBuffer element)) =>
18947 IterableMixinWorkaround.mapList(this, f);
18948
18949 Iterable<SourceBuffer> where(bool f(SourceBuffer element)) =>
18950 IterableMixinWorkaround.where(this, f);
18951
18952 Iterable expand(Iterable f(SourceBuffer element)) =>
18953 IterableMixinWorkaround.expand(this, f);
18954
18955 bool every(bool f(SourceBuffer element)) => IterableMixinWorkaround.every(this , f);
18956
18957 bool any(bool f(SourceBuffer element)) => IterableMixinWorkaround.any(this, f) ;
18958
18959 List<SourceBuffer> toList({ bool growable: true }) =>
18960 new List<SourceBuffer>.from(this, growable: growable);
18961
18962 Set<SourceBuffer> toSet() => new Set<SourceBuffer>.from(this);
18963
18964 bool get isEmpty => this.length == 0;
18965
18966 Iterable<SourceBuffer> take(int n) => IterableMixinWorkaround.takeList(this, n );
18967
18968 Iterable<SourceBuffer> takeWhile(bool test(SourceBuffer value)) {
18969 return IterableMixinWorkaround.takeWhile(this, test);
18970 }
18971
18972 Iterable<SourceBuffer> skip(int n) => IterableMixinWorkaround.skipList(this, n );
18973
18974 Iterable<SourceBuffer> skipWhile(bool test(SourceBuffer value)) {
18975 return IterableMixinWorkaround.skipWhile(this, test);
18976 }
18977
18978 SourceBuffer firstWhere(bool test(SourceBuffer value), { SourceBuffer orElse() }) {
18979 return IterableMixinWorkaround.firstWhere(this, test, orElse);
18980 }
18981
18982 SourceBuffer lastWhere(bool test(SourceBuffer value), {SourceBuffer orElse()}) {
18983 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
18984 }
18985
18986 SourceBuffer singleWhere(bool test(SourceBuffer value)) {
18987 return IterableMixinWorkaround.singleWhere(this, test);
18988 }
18989
18990 SourceBuffer elementAt(int index) {
18991 return this[index];
18992 }
18993
18994 // From Collection<SourceBuffer>:
18995
18996 void add(SourceBuffer value) {
18997 throw new UnsupportedError("Cannot add to immutable List.");
18998 }
18999
19000 void addAll(Iterable<SourceBuffer> iterable) {
19001 throw new UnsupportedError("Cannot add to immutable List.");
19002 }
19003
19004 // From List<SourceBuffer>:
19005 void set length(int value) { 17627 void set length(int value) {
19006 throw new UnsupportedError("Cannot resize immutable List."); 17628 throw new UnsupportedError("Cannot resize immutable List.");
19007 } 17629 }
19008 17630
19009 void clear() {
19010 throw new UnsupportedError("Cannot clear immutable List.");
19011 }
19012
19013 Iterable<SourceBuffer> get reversed {
19014 return IterableMixinWorkaround.reversedList(this);
19015 }
19016
19017 void sort([int compare(SourceBuffer a, SourceBuffer b)]) {
19018 throw new UnsupportedError("Cannot sort immutable List.");
19019 }
19020
19021 int indexOf(SourceBuffer element, [int start = 0]) =>
19022 Lists.indexOf(this, element, start, this.length);
19023
19024 int lastIndexOf(SourceBuffer element, [int start]) {
19025 if (start == null) start = length - 1;
19026 return Lists.lastIndexOf(this, element, start);
19027 }
19028
19029 SourceBuffer get first {
19030 if (this.length > 0) return this[0];
19031 throw new StateError("No elements");
19032 }
19033
19034 SourceBuffer get last {
19035 if (this.length > 0) return this[this.length - 1];
19036 throw new StateError("No elements");
19037 }
19038
19039 SourceBuffer get single {
19040 if (length == 1) return this[0];
19041 if (length == 0) throw new StateError("No elements");
19042 throw new StateError("More than one element");
19043 }
19044
19045 void insert(int index, SourceBuffer element) {
19046 throw new UnsupportedError("Cannot add to immutable List.");
19047 }
19048
19049 void insertAll(int index, Iterable<SourceBuffer> iterable) {
19050 throw new UnsupportedError("Cannot add to immutable List.");
19051 }
19052
19053 void setAll(int index, Iterable<SourceBuffer> iterable) {
19054 throw new UnsupportedError("Cannot modify an immutable List.");
19055 }
19056
19057 SourceBuffer removeAt(int pos) {
19058 throw new UnsupportedError("Cannot remove from immutable List.");
19059 }
19060
19061 SourceBuffer removeLast() {
19062 throw new UnsupportedError("Cannot remove from immutable List.");
19063 }
19064
19065 bool remove(Object object) {
19066 throw new UnsupportedError("Cannot remove from immutable List.");
19067 }
19068
19069 void removeWhere(bool test(SourceBuffer element)) {
19070 throw new UnsupportedError("Cannot remove from immutable List.");
19071 }
19072
19073 void retainWhere(bool test(SourceBuffer element)) {
19074 throw new UnsupportedError("Cannot remove from immutable List.");
19075 }
19076
19077 void setRange(int start, int end, Iterable<SourceBuffer> iterable, [int skipCo unt=0]) {
19078 throw new UnsupportedError("Cannot setRange on immutable List.");
19079 }
19080
19081 void removeRange(int start, int end) {
19082 throw new UnsupportedError("Cannot removeRange on immutable List.");
19083 }
19084
19085 void replaceRange(int start, int end, Iterable<SourceBuffer> iterable) {
19086 throw new UnsupportedError("Cannot modify an immutable List.");
19087 }
19088
19089 void fillRange(int start, int end, [SourceBuffer fillValue]) {
19090 throw new UnsupportedError("Cannot modify an immutable List.");
19091 }
19092
19093 Iterable<SourceBuffer> getRange(int start, int end) =>
19094 IterableMixinWorkaround.getRangeList(this, start, end);
19095
19096 List<SourceBuffer> sublist(int start, [int end]) {
19097 if (end == null) end = length;
19098 return Lists.getRange(this, start, end, <SourceBuffer>[]);
19099 }
19100
19101 Map<int, SourceBuffer> asMap() =>
19102 IterableMixinWorkaround.asMapList(this);
19103
19104 String toString() {
19105 StringBuffer buffer = new StringBuffer('[');
19106 buffer.writeAll(this, ', ');
19107 buffer.write(']');
19108 return buffer.toString();
19109 }
19110
19111 // -- end List<SourceBuffer> mixins. 17631 // -- end List<SourceBuffer> mixins.
19112 17632
19113 @JSName('addEventListener') 17633 @JSName('addEventListener')
19114 @DomName('SourceBufferList.addEventListener') 17634 @DomName('SourceBufferList.addEventListener')
19115 @DocsEditable 17635 @DocsEditable
19116 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 17636 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
19117 17637
19118 @DomName('SourceBufferList.dispatchEvent') 17638 @DomName('SourceBufferList.dispatchEvent')
19119 @DocsEditable 17639 @DocsEditable
19120 bool dispatchEvent(Event event) native; 17640 bool dispatchEvent(Event event) native;
19121 17641
19122 @DomName('SourceBufferList.item') 17642 @DomName('SourceBufferList.item')
19123 @DocsEditable 17643 @DocsEditable
19124 SourceBuffer item(int index) native; 17644 SourceBuffer item(int index) native;
19125 17645
19126 @JSName('removeEventListener') 17646 @JSName('removeEventListener')
19127 @DomName('SourceBufferList.removeEventListener') 17647 @DomName('SourceBufferList.removeEventListener')
19128 @DocsEditable 17648 @DocsEditable
19129 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native; 17649 void $dom_removeEventListener(String type, EventListener listener, [bool useCa pture]) native;
19130 } 17650 }
19131 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 17651 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
19132 // for details. All rights reserved. Use of this source code is governed by a 17652 // for details. All rights reserved. Use of this source code is governed by a
17653 // BSD-style license that can be found in the LICENSE file.
17654
17655
17656 @DocsEditable
17657 @DomName('HTMLSourceElement')
17658 class SourceElement extends Element native "HTMLSourceElement" {
17659
17660 @DomName('HTMLSourceElement.HTMLSourceElement')
17661 @DocsEditable
17662 factory SourceElement() => document.$dom_createElement("source");
17663
17664 @DomName('HTMLSourceElement.media')
17665 @DocsEditable
17666 String media;
17667
17668 @DomName('HTMLSourceElement.src')
17669 @DocsEditable
17670 String src;
17671
17672 @DomName('HTMLSourceElement.type')
17673 @DocsEditable
17674 String type;
17675 }
17676 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
17677 // for details. All rights reserved. Use of this source code is governed by a
17678 // BSD-style license that can be found in the LICENSE file.
17679
17680
17681 @DocsEditable
17682 @DomName('HTMLSpanElement')
17683 class SpanElement extends Element native "HTMLSpanElement" {
17684
17685 @DomName('HTMLSpanElement.HTMLSpanElement')
17686 @DocsEditable
17687 factory SpanElement() => document.$dom_createElement("span");
17688 }
17689 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
17690 // for details. All rights reserved. Use of this source code is governed by a
17691 // BSD-style license that can be found in the LICENSE file.
17692
17693
17694 @DocsEditable
17695 @DomName('SpeechGrammar')
17696 class SpeechGrammar native "SpeechGrammar" {
17697
17698 @DomName('SpeechGrammar.SpeechGrammar')
17699 @DocsEditable
17700 factory SpeechGrammar() {
17701 return SpeechGrammar._create_1();
17702 }
17703 static SpeechGrammar _create_1() => JS('SpeechGrammar', 'new SpeechGrammar()') ;
17704
17705 @DomName('SpeechGrammar.src')
17706 @DocsEditable
17707 String src;
17708
17709 @DomName('SpeechGrammar.weight')
17710 @DocsEditable
17711 num weight;
17712 }
17713 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
17714 // for details. All rights reserved. Use of this source code is governed by a
17715 // BSD-style license that can be found in the LICENSE file.
17716
17717
17718 @DocsEditable
17719 @DomName('SpeechGrammarList')
17720 class SpeechGrammarList extends Object with ImmutableListMixin<SpeechGrammar>, L istMixin<SpeechGrammar> implements JavaScriptIndexingBehavior, List<SpeechGramma r> native "SpeechGrammarList" {
17721
17722 @DomName('SpeechGrammarList.SpeechGrammarList')
17723 @DocsEditable
17724 factory SpeechGrammarList() {
17725 return SpeechGrammarList._create_1();
17726 }
17727 static SpeechGrammarList _create_1() => JS('SpeechGrammarList', 'new SpeechGra mmarList()');
17728
17729 @DomName('SpeechGrammarList.length')
17730 @DocsEditable
17731 int get length => JS("int", "#.length", this);
17732
17733 SpeechGrammar operator[](int index) => JS("SpeechGrammar", "#[#]", this, index );
17734
17735 void operator[]=(int index, SpeechGrammar value) {
17736 throw new UnsupportedError("Cannot assign element of immutable List.");
17737 }
17738 // -- start List<SpeechGrammar> mixins.
17739 // SpeechGrammar is the element type.
17740
17741
17742 void set length(int value) {
17743 throw new UnsupportedError("Cannot resize immutable List.");
17744 }
17745
17746 // -- end List<SpeechGrammar> mixins.
17747
17748 @DomName('SpeechGrammarList.addFromString')
17749 @DocsEditable
17750 void addFromString(String string, [num weight]) native;
17751
17752 @DomName('SpeechGrammarList.addFromUri')
17753 @DocsEditable
17754 void addFromUri(String src, [num weight]) native;
17755
17756 @DomName('SpeechGrammarList.item')
17757 @DocsEditable
17758 SpeechGrammar item(int index) native;
17759 }
17760 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
17761 // for details. All rights reserved. Use of this source code is governed by a
19133 // BSD-style license that can be found in the LICENSE file. 17762 // BSD-style license that can be found in the LICENSE file.
19134 17763
19135 17764
19136 @DocsEditable 17765 @DocsEditable
19137 @DomName('HTMLSourceElement') 17766 @DomName('SpeechInputEvent')
19138 class SourceElement extends Element native "HTMLSourceElement" { 17767 class SpeechInputEvent extends Event native "SpeechInputEvent" {
19139 17768
19140 @DomName('HTMLSourceElement.HTMLSourceElement') 17769 @DomName('SpeechInputEvent.results')
19141 @DocsEditable 17770 @DocsEditable
19142 factory SourceElement() => document.$dom_createElement("source"); 17771 @Returns('_SpeechInputResultList')
19143 17772 @Creates('_SpeechInputResultList')
19144 @DomName('HTMLSourceElement.media') 17773 final List<SpeechInputResult> results;
19145 @DocsEditable
19146 String media;
19147
19148 @DomName('HTMLSourceElement.src')
19149 @DocsEditable
19150 String src;
19151
19152 @DomName('HTMLSourceElement.type')
19153 @DocsEditable
19154 String type;
19155 } 17774 }
19156 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 17775 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
19157 // for details. All rights reserved. Use of this source code is governed by a 17776 // for details. All rights reserved. Use of this source code is governed by a
19158 // BSD-style license that can be found in the LICENSE file. 17777 // BSD-style license that can be found in the LICENSE file.
19159 17778
19160 17779
19161 @DocsEditable 17780 @DocsEditable
19162 @DomName('HTMLSpanElement')
19163 class SpanElement extends Element native "HTMLSpanElement" {
19164
19165 @DomName('HTMLSpanElement.HTMLSpanElement')
19166 @DocsEditable
19167 factory SpanElement() => document.$dom_createElement("span");
19168 }
19169 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
19170 // for details. All rights reserved. Use of this source code is governed by a
19171 // BSD-style license that can be found in the LICENSE file.
19172
19173
19174 @DocsEditable
19175 @DomName('SpeechGrammar')
19176 class SpeechGrammar native "SpeechGrammar" {
19177
19178 @DomName('SpeechGrammar.SpeechGrammar')
19179 @DocsEditable
19180 factory SpeechGrammar() {
19181 return SpeechGrammar._create_1();
19182 }
19183 static SpeechGrammar _create_1() => JS('SpeechGrammar', 'new SpeechGrammar()') ;
19184
19185 @DomName('SpeechGrammar.src')
19186 @DocsEditable
19187 String src;
19188
19189 @DomName('SpeechGrammar.weight')
19190 @DocsEditable
19191 num weight;
19192 }
19193 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
19194 // for details. All rights reserved. Use of this source code is governed by a
19195 // BSD-style license that can be found in the LICENSE file.
19196
19197
19198 @DocsEditable
19199 @DomName('SpeechGrammarList')
19200 class SpeechGrammarList implements JavaScriptIndexingBehavior, List<SpeechGramma r> native "SpeechGrammarList" {
19201
19202 @DomName('SpeechGrammarList.SpeechGrammarList')
19203 @DocsEditable
19204 factory SpeechGrammarList() {
19205 return SpeechGrammarList._create_1();
19206 }
19207 static SpeechGrammarList _create_1() => JS('SpeechGrammarList', 'new SpeechGra mmarList()');
19208
19209 @DomName('SpeechGrammarList.length')
19210 @DocsEditable
19211 int get length => JS("int", "#.length", this);
19212
19213 SpeechGrammar operator[](int index) => JS("SpeechGrammar", "#[#]", this, index );
19214
19215 void operator[]=(int index, SpeechGrammar value) {
19216 throw new UnsupportedError("Cannot assign element of immutable List.");
19217 }
19218 // -- start List<SpeechGrammar> mixins.
19219 // SpeechGrammar is the element type.
19220
19221 // From Iterable<SpeechGrammar>:
19222
19223 Iterator<SpeechGrammar> get iterator {
19224 // Note: NodeLists are not fixed size. And most probably length shouldn't
19225 // be cached in both iterator _and_ forEach method. For now caching it
19226 // for consistency.
19227 return new FixedSizeListIterator<SpeechGrammar>(this);
19228 }
19229
19230 SpeechGrammar reduce(SpeechGrammar combine(SpeechGrammar value, SpeechGrammar element)) {
19231 return IterableMixinWorkaround.reduce(this, combine);
19232 }
19233
19234 dynamic fold(dynamic initialValue,
19235 dynamic combine(dynamic previousValue, SpeechGrammar element)) {
19236 return IterableMixinWorkaround.fold(this, initialValue, combine);
19237 }
19238
19239 bool contains(SpeechGrammar element) => IterableMixinWorkaround.contains(this, element);
19240
19241 void forEach(void f(SpeechGrammar element)) => IterableMixinWorkaround.forEach (this, f);
19242
19243 String join([String separator = ""]) =>
19244 IterableMixinWorkaround.joinList(this, separator);
19245
19246 Iterable map(f(SpeechGrammar element)) =>
19247 IterableMixinWorkaround.mapList(this, f);
19248
19249 Iterable<SpeechGrammar> where(bool f(SpeechGrammar element)) =>
19250 IterableMixinWorkaround.where(this, f);
19251
19252 Iterable expand(Iterable f(SpeechGrammar element)) =>
19253 IterableMixinWorkaround.expand(this, f);
19254
19255 bool every(bool f(SpeechGrammar element)) => IterableMixinWorkaround.every(thi s, f);
19256
19257 bool any(bool f(SpeechGrammar element)) => IterableMixinWorkaround.any(this, f );
19258
19259 List<SpeechGrammar> toList({ bool growable: true }) =>
19260 new List<SpeechGrammar>.from(this, growable: growable);
19261
19262 Set<SpeechGrammar> toSet() => new Set<SpeechGrammar>.from(this);
19263
19264 bool get isEmpty => this.length == 0;
19265
19266 Iterable<SpeechGrammar> take(int n) => IterableMixinWorkaround.takeList(this, n);
19267
19268 Iterable<SpeechGrammar> takeWhile(bool test(SpeechGrammar value)) {
19269 return IterableMixinWorkaround.takeWhile(this, test);
19270 }
19271
19272 Iterable<SpeechGrammar> skip(int n) => IterableMixinWorkaround.skipList(this, n);
19273
19274 Iterable<SpeechGrammar> skipWhile(bool test(SpeechGrammar value)) {
19275 return IterableMixinWorkaround.skipWhile(this, test);
19276 }
19277
19278 SpeechGrammar firstWhere(bool test(SpeechGrammar value), { SpeechGrammar orEls e() }) {
19279 return IterableMixinWorkaround.firstWhere(this, test, orElse);
19280 }
19281
19282 SpeechGrammar lastWhere(bool test(SpeechGrammar value), {SpeechGrammar orElse( )}) {
19283 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
19284 }
19285
19286 SpeechGrammar singleWhere(bool test(SpeechGrammar value)) {
19287 return IterableMixinWorkaround.singleWhere(this, test);
19288 }
19289
19290 SpeechGrammar elementAt(int index) {
19291 return this[index];
19292 }
19293
19294 // From Collection<SpeechGrammar>:
19295
19296 void add(SpeechGrammar value) {
19297 throw new UnsupportedError("Cannot add to immutable List.");
19298 }
19299
19300 void addAll(Iterable<SpeechGrammar> iterable) {
19301 throw new UnsupportedError("Cannot add to immutable List.");
19302 }
19303
19304 // From List<SpeechGrammar>:
19305 void set length(int value) {
19306 throw new UnsupportedError("Cannot resize immutable List.");
19307 }
19308
19309 void clear() {
19310 throw new UnsupportedError("Cannot clear immutable List.");
19311 }
19312
19313 Iterable<SpeechGrammar> get reversed {
19314 return IterableMixinWorkaround.reversedList(this);
19315 }
19316
19317 void sort([int compare(SpeechGrammar a, SpeechGrammar b)]) {
19318 throw new UnsupportedError("Cannot sort immutable List.");
19319 }
19320
19321 int indexOf(SpeechGrammar element, [int start = 0]) =>
19322 Lists.indexOf(this, element, start, this.length);
19323
19324 int lastIndexOf(SpeechGrammar element, [int start]) {
19325 if (start == null) start = length - 1;
19326 return Lists.lastIndexOf(this, element, start);
19327 }
19328
19329 SpeechGrammar get first {
19330 if (this.length > 0) return this[0];
19331 throw new StateError("No elements");
19332 }
19333
19334 SpeechGrammar get last {
19335 if (this.length > 0) return this[this.length - 1];
19336 throw new StateError("No elements");
19337 }
19338
19339 SpeechGrammar get single {
19340 if (length == 1) return this[0];
19341 if (length == 0) throw new StateError("No elements");
19342 throw new StateError("More than one element");
19343 }
19344
19345 void insert(int index, SpeechGrammar element) {
19346 throw new UnsupportedError("Cannot add to immutable List.");
19347 }
19348
19349 void insertAll(int index, Iterable<SpeechGrammar> iterable) {
19350 throw new UnsupportedError("Cannot add to immutable List.");
19351 }
19352
19353 void setAll(int index, Iterable<SpeechGrammar> iterable) {
19354 throw new UnsupportedError("Cannot modify an immutable List.");
19355 }
19356
19357 SpeechGrammar removeAt(int pos) {
19358 throw new UnsupportedError("Cannot remove from immutable List.");
19359 }
19360
19361 SpeechGrammar removeLast() {
19362 throw new UnsupportedError("Cannot remove from immutable List.");
19363 }
19364
19365 bool remove(Object object) {
19366 throw new UnsupportedError("Cannot remove from immutable List.");
19367 }
19368
19369 void removeWhere(bool test(SpeechGrammar element)) {
19370 throw new UnsupportedError("Cannot remove from immutable List.");
19371 }
19372
19373 void retainWhere(bool test(SpeechGrammar element)) {
19374 throw new UnsupportedError("Cannot remove from immutable List.");
19375 }
19376
19377 void setRange(int start, int end, Iterable<SpeechGrammar> iterable, [int skipC ount=0]) {
19378 throw new UnsupportedError("Cannot setRange on immutable List.");
19379 }
19380
19381 void removeRange(int start, int end) {
19382 throw new UnsupportedError("Cannot removeRange on immutable List.");
19383 }
19384
19385 void replaceRange(int start, int end, Iterable<SpeechGrammar> iterable) {
19386 throw new UnsupportedError("Cannot modify an immutable List.");
19387 }
19388
19389 void fillRange(int start, int end, [SpeechGrammar fillValue]) {
19390 throw new UnsupportedError("Cannot modify an immutable List.");
19391 }
19392
19393 Iterable<SpeechGrammar> getRange(int start, int end) =>
19394 IterableMixinWorkaround.getRangeList(this, start, end);
19395
19396 List<SpeechGrammar> sublist(int start, [int end]) {
19397 if (end == null) end = length;
19398 return Lists.getRange(this, start, end, <SpeechGrammar>[]);
19399 }
19400
19401 Map<int, SpeechGrammar> asMap() =>
19402 IterableMixinWorkaround.asMapList(this);
19403
19404 String toString() {
19405 StringBuffer buffer = new StringBuffer('[');
19406 buffer.writeAll(this, ', ');
19407 buffer.write(']');
19408 return buffer.toString();
19409 }
19410
19411 // -- end List<SpeechGrammar> mixins.
19412
19413 @DomName('SpeechGrammarList.addFromString')
19414 @DocsEditable
19415 void addFromString(String string, [num weight]) native;
19416
19417 @DomName('SpeechGrammarList.addFromUri')
19418 @DocsEditable
19419 void addFromUri(String src, [num weight]) native;
19420
19421 @DomName('SpeechGrammarList.item')
19422 @DocsEditable
19423 SpeechGrammar item(int index) native;
19424 }
19425 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
19426 // for details. All rights reserved. Use of this source code is governed by a
19427 // BSD-style license that can be found in the LICENSE file.
19428
19429
19430 @DocsEditable
19431 @DomName('SpeechInputEvent')
19432 class SpeechInputEvent extends Event native "SpeechInputEvent" {
19433
19434 @DomName('SpeechInputEvent.results')
19435 @DocsEditable
19436 @Returns('_SpeechInputResultList')
19437 @Creates('_SpeechInputResultList')
19438 final List<SpeechInputResult> results;
19439 }
19440 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
19441 // for details. All rights reserved. Use of this source code is governed by a
19442 // BSD-style license that can be found in the LICENSE file.
19443
19444
19445 @DocsEditable
19446 @DomName('SpeechInputResult') 17781 @DomName('SpeechInputResult')
19447 class SpeechInputResult native "SpeechInputResult" { 17782 class SpeechInputResult native "SpeechInputResult" {
19448 17783
19449 @DomName('SpeechInputResult.confidence') 17784 @DomName('SpeechInputResult.confidence')
19450 @DocsEditable 17785 @DocsEditable
19451 final num confidence; 17786 final num confidence;
19452 17787
19453 @DomName('SpeechInputResult.utterance') 17788 @DomName('SpeechInputResult.utterance')
19454 @DocsEditable 17789 @DocsEditable
19455 final String utterance; 17790 final String utterance;
(...skipping 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after
20664 @DocsEditable 18999 @DocsEditable
20665 Stream<Event> get onExit => exitEvent.forTarget(this); 19000 Stream<Event> get onExit => exitEvent.forTarget(this);
20666 } 19001 }
20667 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 19002 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
20668 // for details. All rights reserved. Use of this source code is governed by a 19003 // for details. All rights reserved. Use of this source code is governed by a
20669 // BSD-style license that can be found in the LICENSE file. 19004 // BSD-style license that can be found in the LICENSE file.
20670 19005
20671 19006
20672 @DocsEditable 19007 @DocsEditable
20673 @DomName('TextTrackCueList') 19008 @DomName('TextTrackCueList')
20674 class TextTrackCueList implements List<TextTrackCue>, JavaScriptIndexingBehavior native "TextTrackCueList" { 19009 class TextTrackCueList extends Object with ImmutableListMixin<TextTrackCue>, Lis tMixin<TextTrackCue> implements List<TextTrackCue>, JavaScriptIndexingBehavior n ative "TextTrackCueList" {
20675 19010
20676 @DomName('TextTrackCueList.length') 19011 @DomName('TextTrackCueList.length')
20677 @DocsEditable 19012 @DocsEditable
20678 int get length => JS("int", "#.length", this); 19013 int get length => JS("int", "#.length", this);
20679 19014
20680 TextTrackCue operator[](int index) => JS("TextTrackCue", "#[#]", this, index); 19015 TextTrackCue operator[](int index) => JS("TextTrackCue", "#[#]", this, index);
20681 19016
20682 void operator[]=(int index, TextTrackCue value) { 19017 void operator[]=(int index, TextTrackCue value) {
20683 throw new UnsupportedError("Cannot assign element of immutable List."); 19018 throw new UnsupportedError("Cannot assign element of immutable List.");
20684 } 19019 }
20685 // -- start List<TextTrackCue> mixins. 19020 // -- start List<TextTrackCue> mixins.
20686 // TextTrackCue is the element type. 19021 // TextTrackCue is the element type.
20687 19022
20688 // From Iterable<TextTrackCue>:
20689 19023
20690 Iterator<TextTrackCue> get iterator {
20691 // Note: NodeLists are not fixed size. And most probably length shouldn't
20692 // be cached in both iterator _and_ forEach method. For now caching it
20693 // for consistency.
20694 return new FixedSizeListIterator<TextTrackCue>(this);
20695 }
20696
20697 TextTrackCue reduce(TextTrackCue combine(TextTrackCue value, TextTrackCue elem ent)) {
20698 return IterableMixinWorkaround.reduce(this, combine);
20699 }
20700
20701 dynamic fold(dynamic initialValue,
20702 dynamic combine(dynamic previousValue, TextTrackCue element)) {
20703 return IterableMixinWorkaround.fold(this, initialValue, combine);
20704 }
20705
20706 bool contains(TextTrackCue element) => IterableMixinWorkaround.contains(this, element);
20707
20708 void forEach(void f(TextTrackCue element)) => IterableMixinWorkaround.forEach( this, f);
20709
20710 String join([String separator = ""]) =>
20711 IterableMixinWorkaround.joinList(this, separator);
20712
20713 Iterable map(f(TextTrackCue element)) =>
20714 IterableMixinWorkaround.mapList(this, f);
20715
20716 Iterable<TextTrackCue> where(bool f(TextTrackCue element)) =>
20717 IterableMixinWorkaround.where(this, f);
20718
20719 Iterable expand(Iterable f(TextTrackCue element)) =>
20720 IterableMixinWorkaround.expand(this, f);
20721
20722 bool every(bool f(TextTrackCue element)) => IterableMixinWorkaround.every(this , f);
20723
20724 bool any(bool f(TextTrackCue element)) => IterableMixinWorkaround.any(this, f) ;
20725
20726 List<TextTrackCue> toList({ bool growable: true }) =>
20727 new List<TextTrackCue>.from(this, growable: growable);
20728
20729 Set<TextTrackCue> toSet() => new Set<TextTrackCue>.from(this);
20730
20731 bool get isEmpty => this.length == 0;
20732
20733 Iterable<TextTrackCue> take(int n) => IterableMixinWorkaround.takeList(this, n );
20734
20735 Iterable<TextTrackCue> takeWhile(bool test(TextTrackCue value)) {
20736 return IterableMixinWorkaround.takeWhile(this, test);
20737 }
20738
20739 Iterable<TextTrackCue> skip(int n) => IterableMixinWorkaround.skipList(this, n );
20740
20741 Iterable<TextTrackCue> skipWhile(bool test(TextTrackCue value)) {
20742 return IterableMixinWorkaround.skipWhile(this, test);
20743 }
20744
20745 TextTrackCue firstWhere(bool test(TextTrackCue value), { TextTrackCue orElse() }) {
20746 return IterableMixinWorkaround.firstWhere(this, test, orElse);
20747 }
20748
20749 TextTrackCue lastWhere(bool test(TextTrackCue value), {TextTrackCue orElse()}) {
20750 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
20751 }
20752
20753 TextTrackCue singleWhere(bool test(TextTrackCue value)) {
20754 return IterableMixinWorkaround.singleWhere(this, test);
20755 }
20756
20757 TextTrackCue elementAt(int index) {
20758 return this[index];
20759 }
20760
20761 // From Collection<TextTrackCue>:
20762
20763 void add(TextTrackCue value) {
20764 throw new UnsupportedError("Cannot add to immutable List.");
20765 }
20766
20767 void addAll(Iterable<TextTrackCue> iterable) {
20768 throw new UnsupportedError("Cannot add to immutable List.");
20769 }
20770
20771 // From List<TextTrackCue>:
20772 void set length(int value) { 19024 void set length(int value) {
20773 throw new UnsupportedError("Cannot resize immutable List."); 19025 throw new UnsupportedError("Cannot resize immutable List.");
20774 } 19026 }
20775 19027
20776 void clear() {
20777 throw new UnsupportedError("Cannot clear immutable List.");
20778 }
20779
20780 Iterable<TextTrackCue> get reversed {
20781 return IterableMixinWorkaround.reversedList(this);
20782 }
20783
20784 void sort([int compare(TextTrackCue a, TextTrackCue b)]) {
20785 throw new UnsupportedError("Cannot sort immutable List.");
20786 }
20787
20788 int indexOf(TextTrackCue element, [int start = 0]) =>
20789 Lists.indexOf(this, element, start, this.length);
20790
20791 int lastIndexOf(TextTrackCue element, [int start]) {
20792 if (start == null) start = length - 1;
20793 return Lists.lastIndexOf(this, element, start);
20794 }
20795
20796 TextTrackCue get first {
20797 if (this.length > 0) return this[0];
20798 throw new StateError("No elements");
20799 }
20800
20801 TextTrackCue get last {
20802 if (this.length > 0) return this[this.length - 1];
20803 throw new StateError("No elements");
20804 }
20805
20806 TextTrackCue get single {
20807 if (length == 1) return this[0];
20808 if (length == 0) throw new StateError("No elements");
20809 throw new StateError("More than one element");
20810 }
20811
20812 void insert(int index, TextTrackCue element) {
20813 throw new UnsupportedError("Cannot add to immutable List.");
20814 }
20815
20816 void insertAll(int index, Iterable<TextTrackCue> iterable) {
20817 throw new UnsupportedError("Cannot add to immutable List.");
20818 }
20819
20820 void setAll(int index, Iterable<TextTrackCue> iterable) {
20821 throw new UnsupportedError("Cannot modify an immutable List.");
20822 }
20823
20824 TextTrackCue removeAt(int pos) {
20825 throw new UnsupportedError("Cannot remove from immutable List.");
20826 }
20827
20828 TextTrackCue removeLast() {
20829 throw new UnsupportedError("Cannot remove from immutable List.");
20830 }
20831
20832 bool remove(Object object) {
20833 throw new UnsupportedError("Cannot remove from immutable List.");
20834 }
20835
20836 void removeWhere(bool test(TextTrackCue element)) {
20837 throw new UnsupportedError("Cannot remove from immutable List.");
20838 }
20839
20840 void retainWhere(bool test(TextTrackCue element)) {
20841 throw new UnsupportedError("Cannot remove from immutable List.");
20842 }
20843
20844 void setRange(int start, int end, Iterable<TextTrackCue> iterable, [int skipCo unt=0]) {
20845 throw new UnsupportedError("Cannot setRange on immutable List.");
20846 }
20847
20848 void removeRange(int start, int end) {
20849 throw new UnsupportedError("Cannot removeRange on immutable List.");
20850 }
20851
20852 void replaceRange(int start, int end, Iterable<TextTrackCue> iterable) {
20853 throw new UnsupportedError("Cannot modify an immutable List.");
20854 }
20855
20856 void fillRange(int start, int end, [TextTrackCue fillValue]) {
20857 throw new UnsupportedError("Cannot modify an immutable List.");
20858 }
20859
20860 Iterable<TextTrackCue> getRange(int start, int end) =>
20861 IterableMixinWorkaround.getRangeList(this, start, end);
20862
20863 List<TextTrackCue> sublist(int start, [int end]) {
20864 if (end == null) end = length;
20865 return Lists.getRange(this, start, end, <TextTrackCue>[]);
20866 }
20867
20868 Map<int, TextTrackCue> asMap() =>
20869 IterableMixinWorkaround.asMapList(this);
20870
20871 String toString() {
20872 StringBuffer buffer = new StringBuffer('[');
20873 buffer.writeAll(this, ', ');
20874 buffer.write(']');
20875 return buffer.toString();
20876 }
20877
20878 // -- end List<TextTrackCue> mixins. 19028 // -- end List<TextTrackCue> mixins.
20879 19029
20880 @DomName('TextTrackCueList.getCueById') 19030 @DomName('TextTrackCueList.getCueById')
20881 @DocsEditable 19031 @DocsEditable
20882 TextTrackCue getCueById(String id) native; 19032 TextTrackCue getCueById(String id) native;
20883 19033
20884 @DomName('TextTrackCueList.item') 19034 @DomName('TextTrackCueList.item')
20885 @DocsEditable 19035 @DocsEditable
20886 TextTrackCue item(int index) native; 19036 TextTrackCue item(int index) native;
20887 } 19037 }
20888 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 19038 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
20889 // for details. All rights reserved. Use of this source code is governed by a 19039 // for details. All rights reserved. Use of this source code is governed by a
20890 // BSD-style license that can be found in the LICENSE file. 19040 // BSD-style license that can be found in the LICENSE file.
20891 19041
20892 19042
20893 @DocsEditable 19043 @DocsEditable
20894 @DomName('TextTrackList') 19044 @DomName('TextTrackList')
20895 class TextTrackList extends EventTarget implements JavaScriptIndexingBehavior, L ist<TextTrack> native "TextTrackList" { 19045 class TextTrackList extends EventTarget with ImmutableListMixin<TextTrack>, List Mixin<TextTrack> implements JavaScriptIndexingBehavior, List<TextTrack> native " TextTrackList" {
20896 19046
20897 @DomName('TextTrackList.addtrackEvent') 19047 @DomName('TextTrackList.addtrackEvent')
20898 @DocsEditable 19048 @DocsEditable
20899 static const EventStreamProvider<TrackEvent> addTrackEvent = const EventStream Provider<TrackEvent>('addtrack'); 19049 static const EventStreamProvider<TrackEvent> addTrackEvent = const EventStream Provider<TrackEvent>('addtrack');
20900 19050
20901 @DomName('TextTrackList.length') 19051 @DomName('TextTrackList.length')
20902 @DocsEditable 19052 @DocsEditable
20903 int get length => JS("int", "#.length", this); 19053 int get length => JS("int", "#.length", this);
20904 19054
20905 TextTrack operator[](int index) => JS("TextTrack", "#[#]", this, index); 19055 TextTrack operator[](int index) => JS("TextTrack", "#[#]", this, index);
20906 19056
20907 void operator[]=(int index, TextTrack value) { 19057 void operator[]=(int index, TextTrack value) {
20908 throw new UnsupportedError("Cannot assign element of immutable List."); 19058 throw new UnsupportedError("Cannot assign element of immutable List.");
20909 } 19059 }
20910 // -- start List<TextTrack> mixins. 19060 // -- start List<TextTrack> mixins.
20911 // TextTrack is the element type. 19061 // TextTrack is the element type.
20912 19062
20913 // From Iterable<TextTrack>:
20914 19063
20915 Iterator<TextTrack> get iterator {
20916 // Note: NodeLists are not fixed size. And most probably length shouldn't
20917 // be cached in both iterator _and_ forEach method. For now caching it
20918 // for consistency.
20919 return new FixedSizeListIterator<TextTrack>(this);
20920 }
20921
20922 TextTrack reduce(TextTrack combine(TextTrack value, TextTrack element)) {
20923 return IterableMixinWorkaround.reduce(this, combine);
20924 }
20925
20926 dynamic fold(dynamic initialValue,
20927 dynamic combine(dynamic previousValue, TextTrack element)) {
20928 return IterableMixinWorkaround.fold(this, initialValue, combine);
20929 }
20930
20931 bool contains(TextTrack element) => IterableMixinWorkaround.contains(this, ele ment);
20932
20933 void forEach(void f(TextTrack element)) => IterableMixinWorkaround.forEach(thi s, f);
20934
20935 String join([String separator = ""]) =>
20936 IterableMixinWorkaround.joinList(this, separator);
20937
20938 Iterable map(f(TextTrack element)) =>
20939 IterableMixinWorkaround.mapList(this, f);
20940
20941 Iterable<TextTrack> where(bool f(TextTrack element)) =>
20942 IterableMixinWorkaround.where(this, f);
20943
20944 Iterable expand(Iterable f(TextTrack element)) =>
20945 IterableMixinWorkaround.expand(this, f);
20946
20947 bool every(bool f(TextTrack element)) => IterableMixinWorkaround.every(this, f );
20948
20949 bool any(bool f(TextTrack element)) => IterableMixinWorkaround.any(this, f);
20950
20951 List<TextTrack> toList({ bool growable: true }) =>
20952 new List<TextTrack>.from(this, growable: growable);
20953
20954 Set<TextTrack> toSet() => new Set<TextTrack>.from(this);
20955
20956 bool get isEmpty => this.length == 0;
20957
20958 Iterable<TextTrack> take(int n) => IterableMixinWorkaround.takeList(this, n);
20959
20960 Iterable<TextTrack> takeWhile(bool test(TextTrack value)) {
20961 return IterableMixinWorkaround.takeWhile(this, test);
20962 }
20963
20964 Iterable<TextTrack> skip(int n) => IterableMixinWorkaround.skipList(this, n);
20965
20966 Iterable<TextTrack> skipWhile(bool test(TextTrack value)) {
20967 return IterableMixinWorkaround.skipWhile(this, test);
20968 }
20969
20970 TextTrack firstWhere(bool test(TextTrack value), { TextTrack orElse() }) {
20971 return IterableMixinWorkaround.firstWhere(this, test, orElse);
20972 }
20973
20974 TextTrack lastWhere(bool test(TextTrack value), {TextTrack orElse()}) {
20975 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
20976 }
20977
20978 TextTrack singleWhere(bool test(TextTrack value)) {
20979 return IterableMixinWorkaround.singleWhere(this, test);
20980 }
20981
20982 TextTrack elementAt(int index) {
20983 return this[index];
20984 }
20985
20986 // From Collection<TextTrack>:
20987
20988 void add(TextTrack value) {
20989 throw new UnsupportedError("Cannot add to immutable List.");
20990 }
20991
20992 void addAll(Iterable<TextTrack> iterable) {
20993 throw new UnsupportedError("Cannot add to immutable List.");
20994 }
20995
20996 // From List<TextTrack>:
20997 void set length(int value) { 19064 void set length(int value) {
20998 throw new UnsupportedError("Cannot resize immutable List."); 19065 throw new UnsupportedError("Cannot resize immutable List.");
20999 } 19066 }
21000 19067
21001 void clear() {
21002 throw new UnsupportedError("Cannot clear immutable List.");
21003 }
21004
21005 Iterable<TextTrack> get reversed {
21006 return IterableMixinWorkaround.reversedList(this);
21007 }
21008
21009 void sort([int compare(TextTrack a, TextTrack b)]) {
21010 throw new UnsupportedError("Cannot sort immutable List.");
21011 }
21012
21013 int indexOf(TextTrack element, [int start = 0]) =>
21014 Lists.indexOf(this, element, start, this.length);
21015
21016 int lastIndexOf(TextTrack element, [int start]) {
21017 if (start == null) start = length - 1;
21018 return Lists.lastIndexOf(this, element, start);
21019 }
21020
21021 TextTrack get first {
21022 if (this.length > 0) return this[0];
21023 throw new StateError("No elements");
21024 }
21025
21026 TextTrack get last {
21027 if (this.length > 0) return this[this.length - 1];
21028 throw new StateError("No elements");
21029 }
21030
21031 TextTrack get single {
21032 if (length == 1) return this[0];
21033 if (length == 0) throw new StateError("No elements");
21034 throw new StateError("More than one element");
21035 }
21036
21037 void insert(int index, TextTrack element) {
21038 throw new UnsupportedError("Cannot add to immutable List.");
21039 }
21040
21041 void insertAll(int index, Iterable<TextTrack> iterable) {
21042 throw new UnsupportedError("Cannot add to immutable List.");
21043 }
21044
21045 void setAll(int index, Iterable<TextTrack> iterable) {
21046 throw new UnsupportedError("Cannot modify an immutable List.");
21047 }
21048
21049 TextTrack removeAt(int pos) {
21050 throw new UnsupportedError("Cannot remove from immutable List.");
21051 }
21052
21053 TextTrack removeLast() {
21054 throw new UnsupportedError("Cannot remove from immutable List.");
21055 }
21056
21057 bool remove(Object object) {
21058 throw new UnsupportedError("Cannot remove from immutable List.");
21059 }
21060
21061 void removeWhere(bool test(TextTrack element)) {
21062 throw new UnsupportedError("Cannot remove from immutable List.");
21063 }
21064
21065 void retainWhere(bool test(TextTrack element)) {
21066 throw new UnsupportedError("Cannot remove from immutable List.");
21067 }
21068
21069 void setRange(int start, int end, Iterable<TextTrack> iterable, [int skipCount =0]) {
21070 throw new UnsupportedError("Cannot setRange on immutable List.");
21071 }
21072
21073 void removeRange(int start, int end) {
21074 throw new UnsupportedError("Cannot removeRange on immutable List.");
21075 }
21076
21077 void replaceRange(int start, int end, Iterable<TextTrack> iterable) {
21078 throw new UnsupportedError("Cannot modify an immutable List.");
21079 }
21080
21081 void fillRange(int start, int end, [TextTrack fillValue]) {
21082 throw new UnsupportedError("Cannot modify an immutable List.");
21083 }
21084
21085 Iterable<TextTrack> getRange(int start, int end) =>
21086 IterableMixinWorkaround.getRangeList(this, start, end);
21087
21088 List<TextTrack> sublist(int start, [int end]) {
21089 if (end == null) end = length;
21090 return Lists.getRange(this, start, end, <TextTrack>[]);
21091 }
21092
21093 Map<int, TextTrack> asMap() =>
21094 IterableMixinWorkaround.asMapList(this);
21095
21096 String toString() {
21097 StringBuffer buffer = new StringBuffer('[');
21098 buffer.writeAll(this, ', ');
21099 buffer.write(']');
21100 return buffer.toString();
21101 }
21102
21103 // -- end List<TextTrack> mixins. 19068 // -- end List<TextTrack> mixins.
21104 19069
21105 @JSName('addEventListener') 19070 @JSName('addEventListener')
21106 @DomName('TextTrackList.addEventListener') 19071 @DomName('TextTrackList.addEventListener')
21107 @DocsEditable 19072 @DocsEditable
21108 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 19073 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
21109 19074
21110 @DomName('TextTrackList.dispatchEvent') 19075 @DomName('TextTrackList.dispatchEvent')
21111 @DocsEditable 19076 @DocsEditable
21112 bool dispatchEvent(Event evt) native; 19077 bool dispatchEvent(Event evt) native;
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
21333 } 19298 }
21334 } 19299 }
21335 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 19300 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
21336 // for details. All rights reserved. Use of this source code is governed by a 19301 // for details. All rights reserved. Use of this source code is governed by a
21337 // BSD-style license that can be found in the LICENSE file. 19302 // BSD-style license that can be found in the LICENSE file.
21338 19303
21339 // WARNING: Do not edit - generated code. 19304 // WARNING: Do not edit - generated code.
21340 19305
21341 19306
21342 @DomName('TouchList') 19307 @DomName('TouchList')
21343 class TouchList implements JavaScriptIndexingBehavior, List<Touch> native "Touch List" { 19308 class TouchList extends Object with ListMixin<Touch>, ImmutableListMixin<Touch> implements JavaScriptIndexingBehavior, List<Touch> native "TouchList" {
21344 /// NB: This constructor likely does not work as you might expect it to! This 19309 /// NB: This constructor likely does not work as you might expect it to! This
21345 /// constructor will simply fail (returning null) if you are not on a device 19310 /// constructor will simply fail (returning null) if you are not on a device
21346 /// with touch enabled. See dartbug.com/8314. 19311 /// with touch enabled. See dartbug.com/8314.
21347 factory TouchList() => document.$dom_createTouchList(); 19312 factory TouchList() => document.$dom_createTouchList();
21348 19313
21349 /// Checks if this type is supported on the current platform. 19314 /// Checks if this type is supported on the current platform.
21350 static bool get supported => JS('bool', '!!document.createTouchList'); 19315 static bool get supported => JS('bool', '!!document.createTouchList');
21351 19316
21352 @DomName('TouchList.length') 19317 @DomName('TouchList.length')
21353 @DocsEditable 19318 @DocsEditable
21354 int get length => JS("int", "#.length", this); 19319 int get length => JS("int", "#.length", this);
21355 19320
21356 Touch operator[](int index) => JS("Touch", "#[#]", this, index); 19321 Touch operator[](int index) => JS("Touch", "#[#]", this, index);
21357 19322
21358 void operator[]=(int index, Touch value) { 19323 void operator[]=(int index, Touch value) {
21359 throw new UnsupportedError("Cannot assign element of immutable List."); 19324 throw new UnsupportedError("Cannot assign element of immutable List.");
21360 } 19325 }
21361 // -- start List<Touch> mixins. 19326 // -- start List<Touch> mixins.
21362 // Touch is the element type. 19327 // Touch is the element type.
21363 19328
21364 // From Iterable<Touch>:
21365 19329
21366 Iterator<Touch> get iterator {
21367 // Note: NodeLists are not fixed size. And most probably length shouldn't
21368 // be cached in both iterator _and_ forEach method. For now caching it
21369 // for consistency.
21370 return new FixedSizeListIterator<Touch>(this);
21371 }
21372
21373 Touch reduce(Touch combine(Touch value, Touch element)) {
21374 return IterableMixinWorkaround.reduce(this, combine);
21375 }
21376
21377 dynamic fold(dynamic initialValue,
21378 dynamic combine(dynamic previousValue, Touch element)) {
21379 return IterableMixinWorkaround.fold(this, initialValue, combine);
21380 }
21381
21382 bool contains(Touch element) => IterableMixinWorkaround.contains(this, element );
21383
21384 void forEach(void f(Touch element)) => IterableMixinWorkaround.forEach(this, f );
21385
21386 String join([String separator = ""]) =>
21387 IterableMixinWorkaround.joinList(this, separator);
21388
21389 Iterable map(f(Touch element)) =>
21390 IterableMixinWorkaround.mapList(this, f);
21391
21392 Iterable<Touch> where(bool f(Touch element)) =>
21393 IterableMixinWorkaround.where(this, f);
21394
21395 Iterable expand(Iterable f(Touch element)) =>
21396 IterableMixinWorkaround.expand(this, f);
21397
21398 bool every(bool f(Touch element)) => IterableMixinWorkaround.every(this, f);
21399
21400 bool any(bool f(Touch element)) => IterableMixinWorkaround.any(this, f);
21401
21402 List<Touch> toList({ bool growable: true }) =>
21403 new List<Touch>.from(this, growable: growable);
21404
21405 Set<Touch> toSet() => new Set<Touch>.from(this);
21406
21407 bool get isEmpty => this.length == 0;
21408
21409 Iterable<Touch> take(int n) => IterableMixinWorkaround.takeList(this, n);
21410
21411 Iterable<Touch> takeWhile(bool test(Touch value)) {
21412 return IterableMixinWorkaround.takeWhile(this, test);
21413 }
21414
21415 Iterable<Touch> skip(int n) => IterableMixinWorkaround.skipList(this, n);
21416
21417 Iterable<Touch> skipWhile(bool test(Touch value)) {
21418 return IterableMixinWorkaround.skipWhile(this, test);
21419 }
21420
21421 Touch firstWhere(bool test(Touch value), { Touch orElse() }) {
21422 return IterableMixinWorkaround.firstWhere(this, test, orElse);
21423 }
21424
21425 Touch lastWhere(bool test(Touch value), {Touch orElse()}) {
21426 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
21427 }
21428
21429 Touch singleWhere(bool test(Touch value)) {
21430 return IterableMixinWorkaround.singleWhere(this, test);
21431 }
21432
21433 Touch elementAt(int index) {
21434 return this[index];
21435 }
21436
21437 // From Collection<Touch>:
21438
21439 void add(Touch value) {
21440 throw new UnsupportedError("Cannot add to immutable List.");
21441 }
21442
21443 void addAll(Iterable<Touch> iterable) {
21444 throw new UnsupportedError("Cannot add to immutable List.");
21445 }
21446
21447 // From List<Touch>:
21448 void set length(int value) { 19330 void set length(int value) {
21449 throw new UnsupportedError("Cannot resize immutable List."); 19331 throw new UnsupportedError("Cannot resize immutable List.");
21450 } 19332 }
21451 19333
21452 void clear() {
21453 throw new UnsupportedError("Cannot clear immutable List.");
21454 }
21455
21456 Iterable<Touch> get reversed {
21457 return IterableMixinWorkaround.reversedList(this);
21458 }
21459
21460 void sort([int compare(Touch a, Touch b)]) {
21461 throw new UnsupportedError("Cannot sort immutable List.");
21462 }
21463
21464 int indexOf(Touch element, [int start = 0]) =>
21465 Lists.indexOf(this, element, start, this.length);
21466
21467 int lastIndexOf(Touch element, [int start]) {
21468 if (start == null) start = length - 1;
21469 return Lists.lastIndexOf(this, element, start);
21470 }
21471
21472 Touch get first {
21473 if (this.length > 0) return this[0];
21474 throw new StateError("No elements");
21475 }
21476
21477 Touch get last {
21478 if (this.length > 0) return this[this.length - 1];
21479 throw new StateError("No elements");
21480 }
21481
21482 Touch get single {
21483 if (length == 1) return this[0];
21484 if (length == 0) throw new StateError("No elements");
21485 throw new StateError("More than one element");
21486 }
21487
21488 void insert(int index, Touch element) {
21489 throw new UnsupportedError("Cannot add to immutable List.");
21490 }
21491
21492 void insertAll(int index, Iterable<Touch> iterable) {
21493 throw new UnsupportedError("Cannot add to immutable List.");
21494 }
21495
21496 void setAll(int index, Iterable<Touch> iterable) {
21497 throw new UnsupportedError("Cannot modify an immutable List.");
21498 }
21499
21500 Touch removeAt(int pos) {
21501 throw new UnsupportedError("Cannot remove from immutable List.");
21502 }
21503
21504 Touch removeLast() {
21505 throw new UnsupportedError("Cannot remove from immutable List.");
21506 }
21507
21508 bool remove(Object object) {
21509 throw new UnsupportedError("Cannot remove from immutable List.");
21510 }
21511
21512 void removeWhere(bool test(Touch element)) {
21513 throw new UnsupportedError("Cannot remove from immutable List.");
21514 }
21515
21516 void retainWhere(bool test(Touch element)) {
21517 throw new UnsupportedError("Cannot remove from immutable List.");
21518 }
21519
21520 void setRange(int start, int end, Iterable<Touch> iterable, [int skipCount=0]) {
21521 throw new UnsupportedError("Cannot setRange on immutable List.");
21522 }
21523
21524 void removeRange(int start, int end) {
21525 throw new UnsupportedError("Cannot removeRange on immutable List.");
21526 }
21527
21528 void replaceRange(int start, int end, Iterable<Touch> iterable) {
21529 throw new UnsupportedError("Cannot modify an immutable List.");
21530 }
21531
21532 void fillRange(int start, int end, [Touch fillValue]) {
21533 throw new UnsupportedError("Cannot modify an immutable List.");
21534 }
21535
21536 Iterable<Touch> getRange(int start, int end) =>
21537 IterableMixinWorkaround.getRangeList(this, start, end);
21538
21539 List<Touch> sublist(int start, [int end]) {
21540 if (end == null) end = length;
21541 return Lists.getRange(this, start, end, <Touch>[]);
21542 }
21543
21544 Map<int, Touch> asMap() =>
21545 IterableMixinWorkaround.asMapList(this);
21546
21547 String toString() {
21548 StringBuffer buffer = new StringBuffer('[');
21549 buffer.writeAll(this, ', ');
21550 buffer.write(']');
21551 return buffer.toString();
21552 }
21553
21554 // -- end List<Touch> mixins. 19334 // -- end List<Touch> mixins.
21555 19335
21556 @DomName('TouchList.item') 19336 @DomName('TouchList.item')
21557 @DocsEditable 19337 @DocsEditable
21558 Touch item(int index) native; 19338 Touch item(int index) native;
21559 19339
21560 } 19340 }
21561 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 19341 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21562 // for details. All rights reserved. Use of this source code is governed by a 19342 // for details. All rights reserved. Use of this source code is governed by a
21563 // BSD-style license that can be found in the LICENSE file. 19343 // BSD-style license that can be found in the LICENSE file.
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
22604 * Gets an instance of the Indexed DB factory to being using Indexed DB. 20384 * Gets an instance of the Indexed DB factory to being using Indexed DB.
22605 * 20385 *
22606 * Use [IdbFactory.supported] to check if Indexed DB is supported on the 20386 * Use [IdbFactory.supported] to check if Indexed DB is supported on the
22607 * current platform. 20387 * current platform.
22608 */ 20388 */
22609 @SupportedBrowser(SupportedBrowser.CHROME, '23.0') 20389 @SupportedBrowser(SupportedBrowser.CHROME, '23.0')
22610 @SupportedBrowser(SupportedBrowser.FIREFOX, '15.0') 20390 @SupportedBrowser(SupportedBrowser.FIREFOX, '15.0')
22611 @SupportedBrowser(SupportedBrowser.IE, '10.0') 20391 @SupportedBrowser(SupportedBrowser.IE, '10.0')
22612 @Experimental 20392 @Experimental
22613 IdbFactory get indexedDB => 20393 IdbFactory get indexedDB =>
22614 JS('IdbFactory|Null', 20394 JS('IdbFactory|Null', // If not supported, returns `null`.
22615 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB', 20395 '#.indexedDB || #.webkitIndexedDB || #.mozIndexedDB',
22616 this, this, this); 20396 this, this, this);
22617 20397
22618 @DomName('Window.console') 20398 @DomName('Window.console')
22619 Console get console => Console.safeConsole; 20399 Console get console => Console.safeConsole;
22620 20400
22621 /// Checks if _setImmediate is supported. 20401 /// Checks if _setImmediate is supported.
22622 static bool get _supportsSetImmediate => 20402 static bool get _supportsSetImmediate =>
22623 JS('bool', '!!(window.setImmediate)'); 20403 JS('bool', '!!(window.setImmediate)');
22624 20404
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after
23499 @DomName('XPathEvaluator.createNSResolver') 21279 @DomName('XPathEvaluator.createNSResolver')
23500 @DocsEditable 21280 @DocsEditable
23501 XPathNSResolver createNSResolver(Node nodeResolver) native; 21281 XPathNSResolver createNSResolver(Node nodeResolver) native;
23502 21282
23503 @DomName('XPathEvaluator.evaluate') 21283 @DomName('XPathEvaluator.evaluate')
23504 @DocsEditable 21284 @DocsEditable
23505 XPathResult evaluate(String expression, Node contextNode, XPathNSResolver reso lver, int type, XPathResult inResult) native; 21285 XPathResult evaluate(String expression, Node contextNode, XPathNSResolver reso lver, int type, XPathResult inResult) native;
23506 } 21286 }
23507 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21287 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23508 // for details. All rights reserved. Use of this source code is governed by a 21288 // for details. All rights reserved. Use of this source code is governed by a
23509 // BSD-style license that can be found in the LICENSE file.
23510
23511
23512 @DocsEditable
23513 @DomName('XPathException')
23514 class XPathException native "XPathException" {
23515
23516 static const int INVALID_EXPRESSION_ERR = 51;
23517
23518 static const int TYPE_ERR = 52;
23519
23520 @DomName('XPathException.code')
23521 @DocsEditable
23522 final int code;
23523
23524 @DomName('XPathException.message')
23525 @DocsEditable
23526 final String message;
23527
23528 @DomName('XPathException.name')
23529 @DocsEditable
23530 final String name;
23531
23532 @DomName('XPathException.toString')
23533 @DocsEditable
23534 String toString() native;
23535 }
23536 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23537 // for details. All rights reserved. Use of this source code is governed by a
23538 // BSD-style license that can be found in the LICENSE file.
23539
23540
23541 @DocsEditable
23542 @DomName('XPathExpression')
23543 class XPathExpression native "XPathExpression" {
23544
23545 @DomName('XPathExpression.evaluate')
23546 @DocsEditable
23547 XPathResult evaluate(Node contextNode, int type, XPathResult inResult) native;
23548 }
23549 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23550 // for details. All rights reserved. Use of this source code is governed by a
23551 // BSD-style license that can be found in the LICENSE file.
23552
23553
23554 @DocsEditable
23555 @DomName('XPathNSResolver')
23556 class XPathNSResolver native "XPathNSResolver" {
23557
23558 @JSName('lookupNamespaceURI')
23559 @DomName('XPathNSResolver.lookupNamespaceURI')
23560 @DocsEditable
23561 String lookupNamespaceUri(String prefix) native;
23562 }
23563 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23564 // for details. All rights reserved. Use of this source code is governed by a
23565 // BSD-style license that can be found in the LICENSE file.
23566
23567
23568 @DocsEditable
23569 @DomName('XPathResult')
23570 class XPathResult native "XPathResult" {
23571
23572 static const int ANY_TYPE = 0;
23573
23574 static const int ANY_UNORDERED_NODE_TYPE = 8;
23575
23576 static const int BOOLEAN_TYPE = 3;
23577
23578 static const int FIRST_ORDERED_NODE_TYPE = 9;
23579
23580 static const int NUMBER_TYPE = 1;
23581
23582 static const int ORDERED_NODE_ITERATOR_TYPE = 5;
23583
23584 static const int ORDERED_NODE_SNAPSHOT_TYPE = 7;
23585
23586 static const int STRING_TYPE = 2;
23587
23588 static const int UNORDERED_NODE_ITERATOR_TYPE = 4;
23589
23590 static const int UNORDERED_NODE_SNAPSHOT_TYPE = 6;
23591
23592 @DomName('XPathResult.booleanValue')
23593 @DocsEditable
23594 final bool booleanValue;
23595
23596 @DomName('XPathResult.invalidIteratorState')
23597 @DocsEditable
23598 final bool invalidIteratorState;
23599
23600 @DomName('XPathResult.numberValue')
23601 @DocsEditable
23602 final num numberValue;
23603
23604 @DomName('XPathResult.resultType')
23605 @DocsEditable
23606 final int resultType;
23607
23608 @DomName('XPathResult.singleNodeValue')
23609 @DocsEditable
23610 final Node singleNodeValue;
23611
23612 @DomName('XPathResult.snapshotLength')
23613 @DocsEditable
23614 final int snapshotLength;
23615
23616 @DomName('XPathResult.stringValue')
23617 @DocsEditable
23618 final String stringValue;
23619
23620 @DomName('XPathResult.iterateNext')
23621 @DocsEditable
23622 Node iterateNext() native;
23623
23624 @DomName('XPathResult.snapshotItem')
23625 @DocsEditable
23626 Node snapshotItem(int index) native;
23627 }
23628 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23629 // for details. All rights reserved. Use of this source code is governed by a
23630 // BSD-style license that can be found in the LICENSE file.
23631
23632
23633 @DocsEditable
23634 @DomName('XMLSerializer')
23635 class XmlSerializer native "XMLSerializer" {
23636
23637 @DomName('XMLSerializer.XMLSerializer')
23638 @DocsEditable
23639 factory XmlSerializer() {
23640 return XmlSerializer._create_1();
23641 }
23642 static XmlSerializer _create_1() => JS('XmlSerializer', 'new XMLSerializer()') ;
23643
23644 @DomName('XMLSerializer.serializeToString')
23645 @DocsEditable
23646 String serializeToString(Node node) native;
23647 }
23648 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23649 // for details. All rights reserved. Use of this source code is governed by a
23650 // BSD-style license that can be found in the LICENSE file.
23651
23652
23653 @DocsEditable
23654 @DomName('XSLTProcessor')
23655 @SupportedBrowser(SupportedBrowser.CHROME)
23656 @SupportedBrowser(SupportedBrowser.FIREFOX)
23657 @SupportedBrowser(SupportedBrowser.SAFARI)
23658 class XsltProcessor native "XSLTProcessor" {
23659
23660 @DomName('XSLTProcessor.XSLTProcessor')
23661 @DocsEditable
23662 factory XsltProcessor() {
23663 return XsltProcessor._create_1();
23664 }
23665 static XsltProcessor _create_1() => JS('XsltProcessor', 'new XSLTProcessor()') ;
23666
23667 /// Checks if this type is supported on the current platform.
23668 static bool get supported => JS('bool', '!!(window.XSLTProcessor)');
23669
23670 @DomName('XSLTProcessor.clearParameters')
23671 @DocsEditable
23672 void clearParameters() native;
23673
23674 @DomName('XSLTProcessor.getParameter')
23675 @DocsEditable
23676 String getParameter(String namespaceURI, String localName) native;
23677
23678 @DomName('XSLTProcessor.importStylesheet')
23679 @DocsEditable
23680 void importStylesheet(Node stylesheet) native;
23681
23682 @DomName('XSLTProcessor.removeParameter')
23683 @DocsEditable
23684 void removeParameter(String namespaceURI, String localName) native;
23685
23686 @DomName('XSLTProcessor.reset')
23687 @DocsEditable
23688 void reset() native;
23689
23690 @DomName('XSLTProcessor.setParameter')
23691 @DocsEditable
23692 void setParameter(String namespaceURI, String localName, String value) native;
23693
23694 @DomName('XSLTProcessor.transformToDocument')
23695 @DocsEditable
23696 Document transformToDocument(Node source) native;
23697
23698 @DomName('XSLTProcessor.transformToFragment')
23699 @DocsEditable
23700 DocumentFragment transformToFragment(Node source, Document docVal) native;
23701 }
23702 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23703 // for details. All rights reserved. Use of this source code is governed by a
23704 // BSD-style license that can be found in the LICENSE file.
23705
23706
23707 @DocsEditable
23708 @DomName('CSSPrimitiveValue')
23709 abstract class _CSSPrimitiveValue extends _CSSValue native "CSSPrimitiveValue" {
23710 }
23711 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23712 // for details. All rights reserved. Use of this source code is governed by a
23713 // BSD-style license that can be found in the LICENSE file.
23714
23715
23716 @DocsEditable
23717 @DomName('CSSValue')
23718 abstract class _CSSValue native "CSSValue" {
23719 }
23720 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
23721 // for details. All rights reserved. Use of this source code is governed by a
23722 // BSD-style license that can be found in the LICENSE file.
23723
23724
23725 @DocsEditable
23726 @DomName('ClientRect')
23727 class _ClientRect implements Rect native "ClientRect" {
23728
23729 // NOTE! All code below should be common with Rect.
23730 // TODO(blois): implement with mixins when available.
23731
23732 String toString() {
23733 return '($left, $top, $width, $height)';
23734 }
23735
23736 bool operator ==(other) {
23737 if (other is !Rect) return false;
23738 return left == other.left && top == other.top && width == other.width &&
23739 height == other.height;
23740 }
23741
23742 /**
23743 * Computes the intersection of this rectangle and the rectangle parameter.
23744 * Returns null if there is no intersection.
23745 */
23746 Rect intersection(Rect rect) {
23747 var x0 = max(left, rect.left);
23748 var x1 = min(left + width, rect.left + rect.width);
23749
23750 if (x0 <= x1) {
23751 var y0 = max(top, rect.top);
23752 var y1 = min(top + height, rect.top + rect.height);
23753
23754 if (y0 <= y1) {
23755 return new Rect(x0, y0, x1 - x0, y1 - y0);
23756 }
23757 }
23758 return null;
23759 }
23760
23761
23762 /**
23763 * Returns whether a rectangle intersects this rectangle.
23764 */
23765 bool intersects(Rect other) {
23766 return (left <= other.left + other.width && other.left <= left + width &&
23767 top <= other.top + other.height && other.top <= top + height);
23768 }
23769
23770 /**
23771 * Returns a new rectangle which completely contains this rectangle and the
23772 * input rectangle.
23773 */
23774 Rect union(Rect rect) {
23775 var right = max(this.left + this.width, rect.left + rect.width);
23776 var bottom = max(this.top + this.height, rect.top + rect.height);
23777
23778 var left = min(this.left, rect.left);
23779 var top = min(this.top, rect.top);
23780
23781 return new Rect(left, top, right - left, bottom - top);
23782 }
23783
23784 /**
23785 * Tests whether this rectangle entirely contains another rectangle.
23786 */
23787 bool containsRect(Rect another) {
23788 return left <= another.left &&
23789 left + width >= another.left + another.width &&
23790 top <= another.top &&
23791 top + height >= another.top + another.height;
23792 }
23793
23794 /**
23795 * Tests whether this rectangle entirely contains a point.
23796 */
23797 bool containsPoint(Point another) {
23798 return another.x >= left &&
23799 another.x <= left + width &&
23800 another.y >= top &&
23801 another.y <= top + height;
23802 }
23803
23804 Rect ceil() => new Rect(left.ceil(), top.ceil(), width.ceil(), height.ceil());
23805 Rect floor() => new Rect(left.floor(), top.floor(), width.floor(),
23806 height.floor());
23807 Rect round() => new Rect(left.round(), top.round(), width.round(),
23808 height.round());
23809
23810 /**
23811 * Truncates coordinates to integers and returns the result as a new
23812 * rectangle.
23813 */
23814 Rect toInt() => new Rect(left.toInt(), top.toInt(), width.toInt(),
23815 height.toInt());
23816
23817 Point get topLeft => new Point(this.left, this.top);
23818 Point get bottomRight => new Point(this.left + this.width,
23819 this.top + this.height);
23820
23821 @DomName('ClientRect.bottom')
23822 @DocsEditable
23823 final num bottom;
23824
23825 @DomName('ClientRect.height')
23826 @DocsEditable
23827 final num height;
23828
23829 @DomName('ClientRect.left')
23830 @DocsEditable
23831 final num left;
23832
23833 @DomName('ClientRect.right')
23834 @DocsEditable
23835 final num right;
23836
23837 @DomName('ClientRect.top')
23838 @DocsEditable
23839 final num top;
23840
23841 @DomName('ClientRect.width')
23842 @DocsEditable
23843 final num width;
23844 }
23845 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23846 // for details. All rights reserved. Use of this source code is governed by a
23847 // BSD-style license that can be found in the LICENSE file.
23848
23849
23850 @DocsEditable
23851 @DomName('ClientRectList')
23852 class _ClientRectList implements JavaScriptIndexingBehavior, List<Rect> native " ClientRectList" {
23853
23854 @DomName('ClientRectList.length')
23855 @DocsEditable
23856 int get length => JS("int", "#.length", this);
23857
23858 Rect operator[](int index) => JS("Rect", "#[#]", this, index);
23859
23860 void operator[]=(int index, Rect value) {
23861 throw new UnsupportedError("Cannot assign element of immutable List.");
23862 }
23863 // -- start List<Rect> mixins.
23864 // Rect is the element type.
23865
23866 // From Iterable<Rect>:
23867
23868 Iterator<Rect> get iterator {
23869 // Note: NodeLists are not fixed size. And most probably length shouldn't
23870 // be cached in both iterator _and_ forEach method. For now caching it
23871 // for consistency.
23872 return new FixedSizeListIterator<Rect>(this);
23873 }
23874
23875 Rect reduce(Rect combine(Rect value, Rect element)) {
23876 return IterableMixinWorkaround.reduce(this, combine);
23877 }
23878
23879 dynamic fold(dynamic initialValue,
23880 dynamic combine(dynamic previousValue, Rect element)) {
23881 return IterableMixinWorkaround.fold(this, initialValue, combine);
23882 }
23883
23884 bool contains(Rect element) => IterableMixinWorkaround.contains(this, element) ;
23885
23886 void forEach(void f(Rect element)) => IterableMixinWorkaround.forEach(this, f) ;
23887
23888 String join([String separator = ""]) =>
23889 IterableMixinWorkaround.joinList(this, separator);
23890
23891 Iterable map(f(Rect element)) =>
23892 IterableMixinWorkaround.mapList(this, f);
23893
23894 Iterable<Rect> where(bool f(Rect element)) =>
23895 IterableMixinWorkaround.where(this, f);
23896
23897 Iterable expand(Iterable f(Rect element)) =>
23898 IterableMixinWorkaround.expand(this, f);
23899
23900 bool every(bool f(Rect element)) => IterableMixinWorkaround.every(this, f);
23901
23902 bool any(bool f(Rect element)) => IterableMixinWorkaround.any(this, f);
23903
23904 List<Rect> toList({ bool growable: true }) =>
23905 new List<Rect>.from(this, growable: growable);
23906
23907 Set<Rect> toSet() => new Set<Rect>.from(this);
23908
23909 bool get isEmpty => this.length == 0;
23910
23911 Iterable<Rect> take(int n) => IterableMixinWorkaround.takeList(this, n);
23912
23913 Iterable<Rect> takeWhile(bool test(Rect value)) {
23914 return IterableMixinWorkaround.takeWhile(this, test);
23915 }
23916
23917 Iterable<Rect> skip(int n) => IterableMixinWorkaround.skipList(this, n);
23918
23919 Iterable<Rect> skipWhile(bool test(Rect value)) {
23920 return IterableMixinWorkaround.skipWhile(this, test);
23921 }
23922
23923 Rect firstWhere(bool test(Rect value), { Rect orElse() }) {
23924 return IterableMixinWorkaround.firstWhere(this, test, orElse);
23925 }
23926
23927 Rect lastWhere(bool test(Rect value), {Rect orElse()}) {
23928 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
23929 }
23930
23931 Rect singleWhere(bool test(Rect value)) {
23932 return IterableMixinWorkaround.singleWhere(this, test);
23933 }
23934
23935 Rect elementAt(int index) {
23936 return this[index];
23937 }
23938
23939 // From Collection<Rect>:
23940
23941 void add(Rect value) {
23942 throw new UnsupportedError("Cannot add to immutable List.");
23943 }
23944
23945 void addAll(Iterable<Rect> iterable) {
23946 throw new UnsupportedError("Cannot add to immutable List.");
23947 }
23948
23949 // From List<Rect>:
23950 void set length(int value) {
23951 throw new UnsupportedError("Cannot resize immutable List.");
23952 }
23953
23954 void clear() {
23955 throw new UnsupportedError("Cannot clear immutable List.");
23956 }
23957
23958 Iterable<Rect> get reversed {
23959 return IterableMixinWorkaround.reversedList(this);
23960 }
23961
23962 void sort([int compare(Rect a, Rect b)]) {
23963 throw new UnsupportedError("Cannot sort immutable List.");
23964 }
23965
23966 int indexOf(Rect element, [int start = 0]) =>
23967 Lists.indexOf(this, element, start, this.length);
23968
23969 int lastIndexOf(Rect element, [int start]) {
23970 if (start == null) start = length - 1;
23971 return Lists.lastIndexOf(this, element, start);
23972 }
23973
23974 Rect get first {
23975 if (this.length > 0) return this[0];
23976 throw new StateError("No elements");
23977 }
23978
23979 Rect get last {
23980 if (this.length > 0) return this[this.length - 1];
23981 throw new StateError("No elements");
23982 }
23983
23984 Rect get single {
23985 if (length == 1) return this[0];
23986 if (length == 0) throw new StateError("No elements");
23987 throw new StateError("More than one element");
23988 }
23989
23990 void insert(int index, Rect element) {
23991 throw new UnsupportedError("Cannot add to immutable List.");
23992 }
23993
23994 void insertAll(int index, Iterable<Rect> iterable) {
23995 throw new UnsupportedError("Cannot add to immutable List.");
23996 }
23997
23998 void setAll(int index, Iterable<Rect> iterable) {
23999 throw new UnsupportedError("Cannot modify an immutable List.");
24000 }
24001
24002 Rect removeAt(int pos) {
24003 throw new UnsupportedError("Cannot remove from immutable List.");
24004 }
24005
24006 Rect removeLast() {
24007 throw new UnsupportedError("Cannot remove from immutable List.");
24008 }
24009
24010 bool remove(Object object) {
24011 throw new UnsupportedError("Cannot remove from immutable List.");
24012 }
24013
24014 void removeWhere(bool test(Rect element)) {
24015 throw new UnsupportedError("Cannot remove from immutable List.");
24016 }
24017
24018 void retainWhere(bool test(Rect element)) {
24019 throw new UnsupportedError("Cannot remove from immutable List.");
24020 }
24021
24022 void setRange(int start, int end, Iterable<Rect> iterable, [int skipCount=0]) {
24023 throw new UnsupportedError("Cannot setRange on immutable List.");
24024 }
24025
24026 void removeRange(int start, int end) {
24027 throw new UnsupportedError("Cannot removeRange on immutable List.");
24028 }
24029
24030 void replaceRange(int start, int end, Iterable<Rect> iterable) {
24031 throw new UnsupportedError("Cannot modify an immutable List.");
24032 }
24033
24034 void fillRange(int start, int end, [Rect fillValue]) {
24035 throw new UnsupportedError("Cannot modify an immutable List.");
24036 }
24037
24038 Iterable<Rect> getRange(int start, int end) =>
24039 IterableMixinWorkaround.getRangeList(this, start, end);
24040
24041 List<Rect> sublist(int start, [int end]) {
24042 if (end == null) end = length;
24043 return Lists.getRange(this, start, end, <Rect>[]);
24044 }
24045
24046 Map<int, Rect> asMap() =>
24047 IterableMixinWorkaround.asMapList(this);
24048
24049 String toString() {
24050 StringBuffer buffer = new StringBuffer('[');
24051 buffer.writeAll(this, ', ');
24052 buffer.write(']');
24053 return buffer.toString();
24054 }
24055
24056 // -- end List<Rect> mixins.
24057
24058 @DomName('ClientRectList.item')
24059 @DocsEditable
24060 Rect item(int index) native;
24061 }
24062 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24063 // for details. All rights reserved. Use of this source code is governed by a
24064 // BSD-style license that can be found in the LICENSE file.
24065
24066
24067 @DocsEditable
24068 @DomName('Counter')
24069 abstract class _Counter native "Counter" {
24070 }
24071 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24072 // for details. All rights reserved. Use of this source code is governed by a
24073 // BSD-style license that can be found in the LICENSE file.
24074
24075
24076 @DocsEditable
24077 @DomName('CSSRuleList')
24078 class _CssRuleList implements JavaScriptIndexingBehavior, List<CssRule> native " CSSRuleList" {
24079
24080 @DomName('CSSRuleList.length')
24081 @DocsEditable
24082 int get length => JS("int", "#.length", this);
24083
24084 CssRule operator[](int index) => JS("CssRule", "#[#]", this, index);
24085
24086 void operator[]=(int index, CssRule value) {
24087 throw new UnsupportedError("Cannot assign element of immutable List.");
24088 }
24089 // -- start List<CssRule> mixins.
24090 // CssRule is the element type.
24091
24092 // From Iterable<CssRule>:
24093
24094 Iterator<CssRule> get iterator {
24095 // Note: NodeLists are not fixed size. And most probably length shouldn't
24096 // be cached in both iterator _and_ forEach method. For now caching it
24097 // for consistency.
24098 return new FixedSizeListIterator<CssRule>(this);
24099 }
24100
24101 CssRule reduce(CssRule combine(CssRule value, CssRule element)) {
24102 return IterableMixinWorkaround.reduce(this, combine);
24103 }
24104
24105 dynamic fold(dynamic initialValue,
24106 dynamic combine(dynamic previousValue, CssRule element)) {
24107 return IterableMixinWorkaround.fold(this, initialValue, combine);
24108 }
24109
24110 bool contains(CssRule element) => IterableMixinWorkaround.contains(this, eleme nt);
24111
24112 void forEach(void f(CssRule element)) => IterableMixinWorkaround.forEach(this, f);
24113
24114 String join([String separator = ""]) =>
24115 IterableMixinWorkaround.joinList(this, separator);
24116
24117 Iterable map(f(CssRule element)) =>
24118 IterableMixinWorkaround.mapList(this, f);
24119
24120 Iterable<CssRule> where(bool f(CssRule element)) =>
24121 IterableMixinWorkaround.where(this, f);
24122
24123 Iterable expand(Iterable f(CssRule element)) =>
24124 IterableMixinWorkaround.expand(this, f);
24125
24126 bool every(bool f(CssRule element)) => IterableMixinWorkaround.every(this, f);
24127
24128 bool any(bool f(CssRule element)) => IterableMixinWorkaround.any(this, f);
24129
24130 List<CssRule> toList({ bool growable: true }) =>
24131 new List<CssRule>.from(this, growable: growable);
24132
24133 Set<CssRule> toSet() => new Set<CssRule>.from(this);
24134
24135 bool get isEmpty => this.length == 0;
24136
24137 Iterable<CssRule> take(int n) => IterableMixinWorkaround.takeList(this, n);
24138
24139 Iterable<CssRule> takeWhile(bool test(CssRule value)) {
24140 return IterableMixinWorkaround.takeWhile(this, test);
24141 }
24142
24143 Iterable<CssRule> skip(int n) => IterableMixinWorkaround.skipList(this, n);
24144
24145 Iterable<CssRule> skipWhile(bool test(CssRule value)) {
24146 return IterableMixinWorkaround.skipWhile(this, test);
24147 }
24148
24149 CssRule firstWhere(bool test(CssRule value), { CssRule orElse() }) {
24150 return IterableMixinWorkaround.firstWhere(this, test, orElse);
24151 }
24152
24153 CssRule lastWhere(bool test(CssRule value), {CssRule orElse()}) {
24154 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
24155 }
24156
24157 CssRule singleWhere(bool test(CssRule value)) {
24158 return IterableMixinWorkaround.singleWhere(this, test);
24159 }
24160
24161 CssRule elementAt(int index) {
24162 return this[index];
24163 }
24164
24165 // From Collection<CssRule>:
24166
24167 void add(CssRule value) {
24168 throw new UnsupportedError("Cannot add to immutable List.");
24169 }
24170
24171 void addAll(Iterable<CssRule> iterable) {
24172 throw new UnsupportedError("Cannot add to immutable List.");
24173 }
24174
24175 // From List<CssRule>:
24176 void set length(int value) {
24177 throw new UnsupportedError("Cannot resize immutable List.");
24178 }
24179
24180 void clear() {
24181 throw new UnsupportedError("Cannot clear immutable List.");
24182 }
24183
24184 Iterable<CssRule> get reversed {
24185 return IterableMixinWorkaround.reversedList(this);
24186 }
24187
24188 void sort([int compare(CssRule a, CssRule b)]) {
24189 throw new UnsupportedError("Cannot sort immutable List.");
24190 }
24191
24192 int indexOf(CssRule element, [int start = 0]) =>
24193 Lists.indexOf(this, element, start, this.length);
24194
24195 int lastIndexOf(CssRule element, [int start]) {
24196 if (start == null) start = length - 1;
24197 return Lists.lastIndexOf(this, element, start);
24198 }
24199
24200 CssRule get first {
24201 if (this.length > 0) return this[0];
24202 throw new StateError("No elements");
24203 }
24204
24205 CssRule get last {
24206 if (this.length > 0) return this[this.length - 1];
24207 throw new StateError("No elements");
24208 }
24209
24210 CssRule get single {
24211 if (length == 1) return this[0];
24212 if (length == 0) throw new StateError("No elements");
24213 throw new StateError("More than one element");
24214 }
24215
24216 void insert(int index, CssRule element) {
24217 throw new UnsupportedError("Cannot add to immutable List.");
24218 }
24219
24220 void insertAll(int index, Iterable<CssRule> iterable) {
24221 throw new UnsupportedError("Cannot add to immutable List.");
24222 }
24223
24224 void setAll(int index, Iterable<CssRule> iterable) {
24225 throw new UnsupportedError("Cannot modify an immutable List.");
24226 }
24227
24228 CssRule removeAt(int pos) {
24229 throw new UnsupportedError("Cannot remove from immutable List.");
24230 }
24231
24232 CssRule removeLast() {
24233 throw new UnsupportedError("Cannot remove from immutable List.");
24234 }
24235
24236 bool remove(Object object) {
24237 throw new UnsupportedError("Cannot remove from immutable List.");
24238 }
24239
24240 void removeWhere(bool test(CssRule element)) {
24241 throw new UnsupportedError("Cannot remove from immutable List.");
24242 }
24243
24244 void retainWhere(bool test(CssRule element)) {
24245 throw new UnsupportedError("Cannot remove from immutable List.");
24246 }
24247
24248 void setRange(int start, int end, Iterable<CssRule> iterable, [int skipCount=0 ]) {
24249 throw new UnsupportedError("Cannot setRange on immutable List.");
24250 }
24251
24252 void removeRange(int start, int end) {
24253 throw new UnsupportedError("Cannot removeRange on immutable List.");
24254 }
24255
24256 void replaceRange(int start, int end, Iterable<CssRule> iterable) {
24257 throw new UnsupportedError("Cannot modify an immutable List.");
24258 }
24259
24260 void fillRange(int start, int end, [CssRule fillValue]) {
24261 throw new UnsupportedError("Cannot modify an immutable List.");
24262 }
24263
24264 Iterable<CssRule> getRange(int start, int end) =>
24265 IterableMixinWorkaround.getRangeList(this, start, end);
24266
24267 List<CssRule> sublist(int start, [int end]) {
24268 if (end == null) end = length;
24269 return Lists.getRange(this, start, end, <CssRule>[]);
24270 }
24271
24272 Map<int, CssRule> asMap() =>
24273 IterableMixinWorkaround.asMapList(this);
24274
24275 String toString() {
24276 StringBuffer buffer = new StringBuffer('[');
24277 buffer.writeAll(this, ', ');
24278 buffer.write(']');
24279 return buffer.toString();
24280 }
24281
24282 // -- end List<CssRule> mixins.
24283
24284 @DomName('CSSRuleList.item')
24285 @DocsEditable
24286 CssRule item(int index) native;
24287 }
24288 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24289 // for details. All rights reserved. Use of this source code is governed by a
24290 // BSD-style license that can be found in the LICENSE file.
24291
24292
24293 @DocsEditable
24294 @DomName('CSSValueList')
24295 class _CssValueList extends _CSSValue implements JavaScriptIndexingBehavior, Lis t<_CSSValue> native "CSSValueList" {
24296
24297 @DomName('CSSValueList.length')
24298 @DocsEditable
24299 int get length => JS("int", "#.length", this);
24300
24301 _CSSValue operator[](int index) => JS("_CSSValue", "#[#]", this, index);
24302
24303 void operator[]=(int index, _CSSValue value) {
24304 throw new UnsupportedError("Cannot assign element of immutable List.");
24305 }
24306 // -- start List<_CSSValue> mixins.
24307 // _CSSValue is the element type.
24308
24309 // From Iterable<_CSSValue>:
24310
24311 Iterator<_CSSValue> get iterator {
24312 // Note: NodeLists are not fixed size. And most probably length shouldn't
24313 // be cached in both iterator _and_ forEach method. For now caching it
24314 // for consistency.
24315 return new FixedSizeListIterator<_CSSValue>(this);
24316 }
24317
24318 _CSSValue reduce(_CSSValue combine(_CSSValue value, _CSSValue element)) {
24319 return IterableMixinWorkaround.reduce(this, combine);
24320 }
24321
24322 dynamic fold(dynamic initialValue,
24323 dynamic combine(dynamic previousValue, _CSSValue element)) {
24324 return IterableMixinWorkaround.fold(this, initialValue, combine);
24325 }
24326
24327 bool contains(_CSSValue element) => IterableMixinWorkaround.contains(this, ele ment);
24328
24329 void forEach(void f(_CSSValue element)) => IterableMixinWorkaround.forEach(thi s, f);
24330
24331 String join([String separator = ""]) =>
24332 IterableMixinWorkaround.joinList(this, separator);
24333
24334 Iterable map(f(_CSSValue element)) =>
24335 IterableMixinWorkaround.mapList(this, f);
24336
24337 Iterable<_CSSValue> where(bool f(_CSSValue element)) =>
24338 IterableMixinWorkaround.where(this, f);
24339
24340 Iterable expand(Iterable f(_CSSValue element)) =>
24341 IterableMixinWorkaround.expand(this, f);
24342
24343 bool every(bool f(_CSSValue element)) => IterableMixinWorkaround.every(this, f );
24344
24345 bool any(bool f(_CSSValue element)) => IterableMixinWorkaround.any(this, f);
24346
24347 List<_CSSValue> toList({ bool growable: true }) =>
24348 new List<_CSSValue>.from(this, growable: growable);
24349
24350 Set<_CSSValue> toSet() => new Set<_CSSValue>.from(this);
24351
24352 bool get isEmpty => this.length == 0;
24353
24354 Iterable<_CSSValue> take(int n) => IterableMixinWorkaround.takeList(this, n);
24355
24356 Iterable<_CSSValue> takeWhile(bool test(_CSSValue value)) {
24357 return IterableMixinWorkaround.takeWhile(this, test);
24358 }
24359
24360 Iterable<_CSSValue> skip(int n) => IterableMixinWorkaround.skipList(this, n);
24361
24362 Iterable<_CSSValue> skipWhile(bool test(_CSSValue value)) {
24363 return IterableMixinWorkaround.skipWhile(this, test);
24364 }
24365
24366 _CSSValue firstWhere(bool test(_CSSValue value), { _CSSValue orElse() }) {
24367 return IterableMixinWorkaround.firstWhere(this, test, orElse);
24368 }
24369
24370 _CSSValue lastWhere(bool test(_CSSValue value), {_CSSValue orElse()}) {
24371 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
24372 }
24373
24374 _CSSValue singleWhere(bool test(_CSSValue value)) {
24375 return IterableMixinWorkaround.singleWhere(this, test);
24376 }
24377
24378 _CSSValue elementAt(int index) {
24379 return this[index];
24380 }
24381
24382 // From Collection<_CSSValue>:
24383
24384 void add(_CSSValue value) {
24385 throw new UnsupportedError("Cannot add to immutable List.");
24386 }
24387
24388 void addAll(Iterable<_CSSValue> iterable) {
24389 throw new UnsupportedError("Cannot add to immutable List.");
24390 }
24391
24392 // From List<_CSSValue>:
24393 void set length(int value) {
24394 throw new UnsupportedError("Cannot resize immutable List.");
24395 }
24396
24397 void clear() {
24398 throw new UnsupportedError("Cannot clear immutable List.");
24399 }
24400
24401 Iterable<_CSSValue> get reversed {
24402 return IterableMixinWorkaround.reversedList(this);
24403 }
24404
24405 void sort([int compare(_CSSValue a, _CSSValue b)]) {
24406 throw new UnsupportedError("Cannot sort immutable List.");
24407 }
24408
24409 int indexOf(_CSSValue element, [int start = 0]) =>
24410 Lists.indexOf(this, element, start, this.length);
24411
24412 int lastIndexOf(_CSSValue element, [int start]) {
24413 if (start == null) start = length - 1;
24414 return Lists.lastIndexOf(this, element, start);
24415 }
24416
24417 _CSSValue get first {
24418 if (this.length > 0) return this[0];
24419 throw new StateError("No elements");
24420 }
24421
24422 _CSSValue get last {
24423 if (this.length > 0) return this[this.length - 1];
24424 throw new StateError("No elements");
24425 }
24426
24427 _CSSValue get single {
24428 if (length == 1) return this[0];
24429 if (length == 0) throw new StateError("No elements");
24430 throw new StateError("More than one element");
24431 }
24432
24433 void insert(int index, _CSSValue element) {
24434 throw new UnsupportedError("Cannot add to immutable List.");
24435 }
24436
24437 void insertAll(int index, Iterable<_CSSValue> iterable) {
24438 throw new UnsupportedError("Cannot add to immutable List.");
24439 }
24440
24441 void setAll(int index, Iterable<_CSSValue> iterable) {
24442 throw new UnsupportedError("Cannot modify an immutable List.");
24443 }
24444
24445 _CSSValue removeAt(int pos) {
24446 throw new UnsupportedError("Cannot remove from immutable List.");
24447 }
24448
24449 _CSSValue removeLast() {
24450 throw new UnsupportedError("Cannot remove from immutable List.");
24451 }
24452
24453 bool remove(Object object) {
24454 throw new UnsupportedError("Cannot remove from immutable List.");
24455 }
24456
24457 void removeWhere(bool test(_CSSValue element)) {
24458 throw new UnsupportedError("Cannot remove from immutable List.");
24459 }
24460
24461 void retainWhere(bool test(_CSSValue element)) {
24462 throw new UnsupportedError("Cannot remove from immutable List.");
24463 }
24464
24465 void setRange(int start, int end, Iterable<_CSSValue> iterable, [int skipCount =0]) {
24466 throw new UnsupportedError("Cannot setRange on immutable List.");
24467 }
24468
24469 void removeRange(int start, int end) {
24470 throw new UnsupportedError("Cannot removeRange on immutable List.");
24471 }
24472
24473 void replaceRange(int start, int end, Iterable<_CSSValue> iterable) {
24474 throw new UnsupportedError("Cannot modify an immutable List.");
24475 }
24476
24477 void fillRange(int start, int end, [_CSSValue fillValue]) {
24478 throw new UnsupportedError("Cannot modify an immutable List.");
24479 }
24480
24481 Iterable<_CSSValue> getRange(int start, int end) =>
24482 IterableMixinWorkaround.getRangeList(this, start, end);
24483
24484 List<_CSSValue> sublist(int start, [int end]) {
24485 if (end == null) end = length;
24486 return Lists.getRange(this, start, end, <_CSSValue>[]);
24487 }
24488
24489 Map<int, _CSSValue> asMap() =>
24490 IterableMixinWorkaround.asMapList(this);
24491
24492 String toString() {
24493 StringBuffer buffer = new StringBuffer('[');
24494 buffer.writeAll(this, ', ');
24495 buffer.write(']');
24496 return buffer.toString();
24497 }
24498
24499 // -- end List<_CSSValue> mixins.
24500
24501 @DomName('CSSValueList.item')
24502 @DocsEditable
24503 _CSSValue item(int index) native;
24504 }
24505 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24506 // for details. All rights reserved. Use of this source code is governed by a
24507 // BSD-style license that can be found in the LICENSE file.
24508
24509
24510 @DocsEditable
24511 @DomName('DOMFileSystemSync')
24512 @SupportedBrowser(SupportedBrowser.CHROME)
24513 @Experimental
24514 abstract class _DOMFileSystemSync native "DOMFileSystemSync" {
24515 }
24516 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24517 // for details. All rights reserved. Use of this source code is governed by a
24518 // BSD-style license that can be found in the LICENSE file.
24519
24520
24521 @DocsEditable
24522 @DomName('DatabaseSync')
24523 @SupportedBrowser(SupportedBrowser.CHROME)
24524 @SupportedBrowser(SupportedBrowser.SAFARI)
24525 @Experimental
24526 abstract class _DatabaseSync native "DatabaseSync" {
24527 }
24528 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24529 // for details. All rights reserved. Use of this source code is governed by a
24530 // BSD-style license that can be found in the LICENSE file.
24531
24532
24533 @DocsEditable
24534 @DomName('DedicatedWorkerContext')
24535 abstract class _DedicatedWorkerContext extends _WorkerContext native "DedicatedW orkerContext" {
24536 }
24537 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24538 // for details. All rights reserved. Use of this source code is governed by a
24539 // BSD-style license that can be found in the LICENSE file.
24540
24541
24542 @DocsEditable
24543 @DomName('DirectoryEntrySync')
24544 abstract class _DirectoryEntrySync extends _EntrySync native "DirectoryEntrySync " {
24545 }
24546 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24547 // for details. All rights reserved. Use of this source code is governed by a
24548 // BSD-style license that can be found in the LICENSE file.
24549
24550
24551 @DocsEditable
24552 @DomName('DirectoryReaderSync')
24553 abstract class _DirectoryReaderSync native "DirectoryReaderSync" {
24554 }
24555 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24556 // for details. All rights reserved. Use of this source code is governed by a
24557 // BSD-style license that can be found in the LICENSE file.
24558
24559
24560 @DocsEditable
24561 @DomName('WebKitPoint')
24562 @SupportedBrowser(SupportedBrowser.CHROME)
24563 @SupportedBrowser(SupportedBrowser.SAFARI)
24564 @Experimental
24565 class _DomPoint native "WebKitPoint" {
24566
24567 @DomName('DOMPoint.DOMPoint')
24568 @DocsEditable
24569 factory _DomPoint(num x, num y) {
24570 return _DomPoint._create_1(x, y);
24571 }
24572 static _DomPoint _create_1(x, y) => JS('_DomPoint', 'new WebKitPoint(#,#)', x, y);
24573
24574 /// Checks if this type is supported on the current platform.
24575 static bool get supported => JS('bool', '!!(window.WebKitPoint)');
24576
24577 @DomName('DOMPoint.x')
24578 @DocsEditable
24579 num x;
24580
24581 @DomName('DOMPoint.y')
24582 @DocsEditable
24583 num y;
24584 }
24585 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24586 // for details. All rights reserved. Use of this source code is governed by a
24587 // BSD-style license that can be found in the LICENSE file.
24588
24589
24590 @DocsEditable
24591 @DomName('EntryArray')
24592 class _EntryArray implements JavaScriptIndexingBehavior, List<Entry> native "Ent ryArray" {
24593
24594 @DomName('EntryArray.length')
24595 @DocsEditable
24596 int get length => JS("int", "#.length", this);
24597
24598 Entry operator[](int index) => JS("Entry", "#[#]", this, index);
24599
24600 void operator[]=(int index, Entry value) {
24601 throw new UnsupportedError("Cannot assign element of immutable List.");
24602 }
24603 // -- start List<Entry> mixins.
24604 // Entry is the element type.
24605
24606 // From Iterable<Entry>:
24607
24608 Iterator<Entry> get iterator {
24609 // Note: NodeLists are not fixed size. And most probably length shouldn't
24610 // be cached in both iterator _and_ forEach method. For now caching it
24611 // for consistency.
24612 return new FixedSizeListIterator<Entry>(this);
24613 }
24614
24615 Entry reduce(Entry combine(Entry value, Entry element)) {
24616 return IterableMixinWorkaround.reduce(this, combine);
24617 }
24618
24619 dynamic fold(dynamic initialValue,
24620 dynamic combine(dynamic previousValue, Entry element)) {
24621 return IterableMixinWorkaround.fold(this, initialValue, combine);
24622 }
24623
24624 bool contains(Entry element) => IterableMixinWorkaround.contains(this, element );
24625
24626 void forEach(void f(Entry element)) => IterableMixinWorkaround.forEach(this, f );
24627
24628 String join([String separator = ""]) =>
24629 IterableMixinWorkaround.joinList(this, separator);
24630
24631 Iterable map(f(Entry element)) =>
24632 IterableMixinWorkaround.mapList(this, f);
24633
24634 Iterable<Entry> where(bool f(Entry element)) =>
24635 IterableMixinWorkaround.where(this, f);
24636
24637 Iterable expand(Iterable f(Entry element)) =>
24638 IterableMixinWorkaround.expand(this, f);
24639
24640 bool every(bool f(Entry element)) => IterableMixinWorkaround.every(this, f);
24641
24642 bool any(bool f(Entry element)) => IterableMixinWorkaround.any(this, f);
24643
24644 List<Entry> toList({ bool growable: true }) =>
24645 new List<Entry>.from(this, growable: growable);
24646
24647 Set<Entry> toSet() => new Set<Entry>.from(this);
24648
24649 bool get isEmpty => this.length == 0;
24650
24651 Iterable<Entry> take(int n) => IterableMixinWorkaround.takeList(this, n);
24652
24653 Iterable<Entry> takeWhile(bool test(Entry value)) {
24654 return IterableMixinWorkaround.takeWhile(this, test);
24655 }
24656
24657 Iterable<Entry> skip(int n) => IterableMixinWorkaround.skipList(this, n);
24658
24659 Iterable<Entry> skipWhile(bool test(Entry value)) {
24660 return IterableMixinWorkaround.skipWhile(this, test);
24661 }
24662
24663 Entry firstWhere(bool test(Entry value), { Entry orElse() }) {
24664 return IterableMixinWorkaround.firstWhere(this, test, orElse);
24665 }
24666
24667 Entry lastWhere(bool test(Entry value), {Entry orElse()}) {
24668 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
24669 }
24670
24671 Entry singleWhere(bool test(Entry value)) {
24672 return IterableMixinWorkaround.singleWhere(this, test);
24673 }
24674
24675 Entry elementAt(int index) {
24676 return this[index];
24677 }
24678
24679 // From Collection<Entry>:
24680
24681 void add(Entry value) {
24682 throw new UnsupportedError("Cannot add to immutable List.");
24683 }
24684
24685 void addAll(Iterable<Entry> iterable) {
24686 throw new UnsupportedError("Cannot add to immutable List.");
24687 }
24688
24689 // From List<Entry>:
24690 void set length(int value) {
24691 throw new UnsupportedError("Cannot resize immutable List.");
24692 }
24693
24694 void clear() {
24695 throw new UnsupportedError("Cannot clear immutable List.");
24696 }
24697
24698 Iterable<Entry> get reversed {
24699 return IterableMixinWorkaround.reversedList(this);
24700 }
24701
24702 void sort([int compare(Entry a, Entry b)]) {
24703 throw new UnsupportedError("Cannot sort immutable List.");
24704 }
24705
24706 int indexOf(Entry element, [int start = 0]) =>
24707 Lists.indexOf(this, element, start, this.length);
24708
24709 int lastIndexOf(Entry element, [int start]) {
24710 if (start == null) start = length - 1;
24711 return Lists.lastIndexOf(this, element, start);
24712 }
24713
24714 Entry get first {
24715 if (this.length > 0) return this[0];
24716 throw new StateError("No elements");
24717 }
24718
24719 Entry get last {
24720 if (this.length > 0) return this[this.length - 1];
24721 throw new StateError("No elements");
24722 }
24723
24724 Entry get single {
24725 if (length == 1) return this[0];
24726 if (length == 0) throw new StateError("No elements");
24727 throw new StateError("More than one element");
24728 }
24729
24730 void insert(int index, Entry element) {
24731 throw new UnsupportedError("Cannot add to immutable List.");
24732 }
24733
24734 void insertAll(int index, Iterable<Entry> iterable) {
24735 throw new UnsupportedError("Cannot add to immutable List.");
24736 }
24737
24738 void setAll(int index, Iterable<Entry> iterable) {
24739 throw new UnsupportedError("Cannot modify an immutable List.");
24740 }
24741
24742 Entry removeAt(int pos) {
24743 throw new UnsupportedError("Cannot remove from immutable List.");
24744 }
24745
24746 Entry removeLast() {
24747 throw new UnsupportedError("Cannot remove from immutable List.");
24748 }
24749
24750 bool remove(Object object) {
24751 throw new UnsupportedError("Cannot remove from immutable List.");
24752 }
24753
24754 void removeWhere(bool test(Entry element)) {
24755 throw new UnsupportedError("Cannot remove from immutable List.");
24756 }
24757
24758 void retainWhere(bool test(Entry element)) {
24759 throw new UnsupportedError("Cannot remove from immutable List.");
24760 }
24761
24762 void setRange(int start, int end, Iterable<Entry> iterable, [int skipCount=0]) {
24763 throw new UnsupportedError("Cannot setRange on immutable List.");
24764 }
24765
24766 void removeRange(int start, int end) {
24767 throw new UnsupportedError("Cannot removeRange on immutable List.");
24768 }
24769
24770 void replaceRange(int start, int end, Iterable<Entry> iterable) {
24771 throw new UnsupportedError("Cannot modify an immutable List.");
24772 }
24773
24774 void fillRange(int start, int end, [Entry fillValue]) {
24775 throw new UnsupportedError("Cannot modify an immutable List.");
24776 }
24777
24778 Iterable<Entry> getRange(int start, int end) =>
24779 IterableMixinWorkaround.getRangeList(this, start, end);
24780
24781 List<Entry> sublist(int start, [int end]) {
24782 if (end == null) end = length;
24783 return Lists.getRange(this, start, end, <Entry>[]);
24784 }
24785
24786 Map<int, Entry> asMap() =>
24787 IterableMixinWorkaround.asMapList(this);
24788
24789 String toString() {
24790 StringBuffer buffer = new StringBuffer('[');
24791 buffer.writeAll(this, ', ');
24792 buffer.write(']');
24793 return buffer.toString();
24794 }
24795
24796 // -- end List<Entry> mixins.
24797
24798 @DomName('EntryArray.item')
24799 @DocsEditable
24800 Entry item(int index) native;
24801 }
24802 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
24803 // for details. All rights reserved. Use of this source code is governed by a
24804 // BSD-style license that can be found in the LICENSE file.
24805
24806
24807 @DocsEditable
24808 @DomName('EntryArraySync')
24809 class _EntryArraySync implements JavaScriptIndexingBehavior, List<_EntrySync> na tive "EntryArraySync" {
24810
24811 @DomName('EntryArraySync.length')
24812 @DocsEditable
24813 int get length => JS("int", "#.length", this);
24814
24815 _EntrySync operator[](int index) => JS("_EntrySync", "#[#]", this, index);
24816
24817 void operator[]=(int index, _EntrySync value) {
24818 throw new UnsupportedError("Cannot assign element of immutable List.");
24819 }
24820 // -- start List<_EntrySync> mixins.
24821 // _EntrySync is the element type.
24822
24823 // From Iterable<_EntrySync>:
24824
24825 Iterator<_EntrySync> get iterator {
24826 // Note: NodeLists are not fixed size. And most probably length shouldn't
24827 // be cached in both iterator _and_ forEach method. For now caching it
24828 // for consistency.
24829 return new FixedSizeListIterator<_EntrySync>(this);
24830 }
24831
24832 _EntrySync reduce(_EntrySync combine(_EntrySync value, _EntrySync element)) {
24833 return IterableMixinWorkaround.reduce(this, combine);
24834 }
24835
24836 dynamic fold(dynamic initialValue,
24837 dynamic combine(dynamic previousValue, _EntrySync element)) {
24838 return IterableMixinWorkaround.fold(this, initialValue, combine);
24839 }
24840
24841 bool contains(_EntrySync element) => IterableMixinWorkaround.contains(this, el ement);
24842
24843 void forEach(void f(_EntrySync element)) => IterableMixinWorkaround.forEach(th is, f);
24844
24845 String join([String separator = ""]) =>
24846 IterableMixinWorkaround.joinList(this, separator);
24847
24848 Iterable map(f(_EntrySync element)) =>
24849 IterableMixinWorkaround.mapList(this, f);
24850
24851 Iterable<_EntrySync> where(bool f(_EntrySync element)) =>
24852 IterableMixinWorkaround.where(this, f);
24853
24854 Iterable expand(Iterable f(_EntrySync element)) =>
24855 IterableMixinWorkaround.expand(this, f);
24856
24857 bool every(bool f(_EntrySync element)) => IterableMixinWorkaround.every(this, f);
24858
24859 bool any(bool f(_EntrySync element)) => IterableMixinWorkaround.any(this, f);
24860
24861 List<_EntrySync> toList({ bool growable: true }) =>
24862 new List<_EntrySync>.from(this, growable: growable);
24863
24864 Set<_EntrySync> toSet() => new Set<_EntrySync>.from(this);
24865
24866 bool get isEmpty => this.length == 0;
24867
24868 Iterable<_EntrySync> take(int n) => IterableMixinWorkaround.takeList(this, n);
24869
24870 Iterable<_EntrySync> takeWhile(bool test(_EntrySync value)) {
24871 return IterableMixinWorkaround.takeWhile(this, test);
24872 }
24873
24874 Iterable<_EntrySync> skip(int n) => IterableMixinWorkaround.skipList(this, n);
24875
24876 Iterable<_EntrySync> skipWhile(bool test(_EntrySync value)) {
24877 return IterableMixinWorkaround.skipWhile(this, test);
24878 }
24879
24880 _EntrySync firstWhere(bool test(_EntrySync value), { _EntrySync orElse() }) {
24881 return IterableMixinWorkaround.firstWhere(this, test, orElse);
24882 }
24883
24884 _EntrySync lastWhere(bool test(_EntrySync value), {_EntrySync orElse()}) {
24885 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
24886 }
24887
24888 _EntrySync singleWhere(bool test(_EntrySync value)) {
24889 return IterableMixinWorkaround.singleWhere(this, test);
24890 }
24891
24892 _EntrySync elementAt(int index) {
24893 return this[index];
24894 }
24895
24896 // From Collection<_EntrySync>:
24897
24898 void add(_EntrySync value) {
24899 throw new UnsupportedError("Cannot add to immutable List.");
24900 }
24901
24902 void addAll(Iterable<_EntrySync> iterable) {
24903 throw new UnsupportedError("Cannot add to immutable List.");
24904 }
24905
24906 // From List<_EntrySync>:
24907 void set length(int value) {
24908 throw new UnsupportedError("Cannot resize immutable List.");
24909 }
24910
24911 void clear() {
24912 throw new UnsupportedError("Cannot clear immutable List.");
24913 }
24914
24915 Iterable<_EntrySync> get reversed {
24916 return IterableMixinWorkaround.reversedList(this);
24917 }
24918
24919 void sort([int compare(_EntrySync a, _EntrySync b)]) {
24920 throw new UnsupportedError("Cannot sort immutable List.");
24921 }
24922
24923 int indexOf(_EntrySync element, [int start = 0]) =>
24924 Lists.indexOf(this, element, start, this.length);
24925
24926 int lastIndexOf(_EntrySync element, [int start]) {
24927 if (start == null) start = length - 1;
24928 return Lists.lastIndexOf(this, element, start);
24929 }
24930
24931 _EntrySync get first {
24932 if (this.length > 0) return this[0];
24933 throw new StateError("No elements");
24934 }
24935
24936 _EntrySync get last {
24937 if (this.length > 0) return this[this.length - 1];
24938 throw new StateError("No elements");
24939 }
24940
24941 _EntrySync get single {
24942 if (length == 1) return this[0];
24943 if (length == 0) throw new StateError("No elements");
24944 throw new StateError("More than one element");
24945 }
24946
24947 void insert(int index, _EntrySync element) {
24948 throw new UnsupportedError("Cannot add to immutable List.");
24949 }
24950
24951 void insertAll(int index, Iterable<_EntrySync> iterable) {
24952 throw new UnsupportedError("Cannot add to immutable List.");
24953 }
24954
24955 void setAll(int index, Iterable<_EntrySync> iterable) {
24956 throw new UnsupportedError("Cannot modify an immutable List.");
24957 }
24958
24959 _EntrySync removeAt(int pos) {
24960 throw new UnsupportedError("Cannot remove from immutable List.");
24961 }
24962
24963 _EntrySync removeLast() {
24964 throw new UnsupportedError("Cannot remove from immutable List.");
24965 }
24966
24967 bool remove(Object object) {
24968 throw new UnsupportedError("Cannot remove from immutable List.");
24969 }
24970
24971 void removeWhere(bool test(_EntrySync element)) {
24972 throw new UnsupportedError("Cannot remove from immutable List.");
24973 }
24974
24975 void retainWhere(bool test(_EntrySync element)) {
24976 throw new UnsupportedError("Cannot remove from immutable List.");
24977 }
24978
24979 void setRange(int start, int end, Iterable<_EntrySync> iterable, [int skipCoun t=0]) {
24980 throw new UnsupportedError("Cannot setRange on immutable List.");
24981 }
24982
24983 void removeRange(int start, int end) {
24984 throw new UnsupportedError("Cannot removeRange on immutable List.");
24985 }
24986
24987 void replaceRange(int start, int end, Iterable<_EntrySync> iterable) {
24988 throw new UnsupportedError("Cannot modify an immutable List.");
24989 }
24990
24991 void fillRange(int start, int end, [_EntrySync fillValue]) {
24992 throw new UnsupportedError("Cannot modify an immutable List.");
24993 }
24994
24995 Iterable<_EntrySync> getRange(int start, int end) =>
24996 IterableMixinWorkaround.getRangeList(this, start, end);
24997
24998 List<_EntrySync> sublist(int start, [int end]) {
24999 if (end == null) end = length;
25000 return Lists.getRange(this, start, end, <_EntrySync>[]);
25001 }
25002
25003 Map<int, _EntrySync> asMap() =>
25004 IterableMixinWorkaround.asMapList(this);
25005
25006 String toString() {
25007 StringBuffer buffer = new StringBuffer('[');
25008 buffer.writeAll(this, ', ');
25009 buffer.write(']');
25010 return buffer.toString();
25011 }
25012
25013 // -- end List<_EntrySync> mixins.
25014
25015 @DomName('EntryArraySync.item')
25016 @DocsEditable
25017 _EntrySync item(int index) native;
25018 }
25019 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25020 // for details. All rights reserved. Use of this source code is governed by a
25021 // BSD-style license that can be found in the LICENSE file.
25022
25023
25024 @DocsEditable
25025 @DomName('EntrySync')
25026 abstract class _EntrySync native "EntrySync" {
25027 }
25028 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25029 // for details. All rights reserved. Use of this source code is governed by a
25030 // BSD-style license that can be found in the LICENSE file.
25031
25032
25033 @DocsEditable
25034 @DomName('FileEntrySync')
25035 abstract class _FileEntrySync extends _EntrySync native "FileEntrySync" {
25036 }
25037 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25038 // for details. All rights reserved. Use of this source code is governed by a
25039 // BSD-style license that can be found in the LICENSE file.
25040
25041
25042 @DocsEditable
25043 @DomName('FileReaderSync')
25044 abstract class _FileReaderSync native "FileReaderSync" {
25045
25046 @DomName('FileReaderSync.FileReaderSync')
25047 @DocsEditable
25048 factory _FileReaderSync() {
25049 return _FileReaderSync._create_1();
25050 }
25051 static _FileReaderSync _create_1() => JS('_FileReaderSync', 'new FileReaderSyn c()');
25052 }
25053 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25054 // for details. All rights reserved. Use of this source code is governed by a
25055 // BSD-style license that can be found in the LICENSE file.
25056
25057
25058 @DocsEditable
25059 @DomName('FileWriterSync')
25060 abstract class _FileWriterSync native "FileWriterSync" {
25061 }
25062 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25063 // for details. All rights reserved. Use of this source code is governed by a
25064 // BSD-style license that can be found in the LICENSE file.
25065
25066
25067 @DocsEditable
25068 @DomName('GamepadList')
25069 class _GamepadList implements JavaScriptIndexingBehavior, List<Gamepad> native " GamepadList" {
25070
25071 @DomName('GamepadList.length')
25072 @DocsEditable
25073 int get length => JS("int", "#.length", this);
25074
25075 Gamepad operator[](int index) => JS("Gamepad", "#[#]", this, index);
25076
25077 void operator[]=(int index, Gamepad value) {
25078 throw new UnsupportedError("Cannot assign element of immutable List.");
25079 }
25080 // -- start List<Gamepad> mixins.
25081 // Gamepad is the element type.
25082
25083 // From Iterable<Gamepad>:
25084
25085 Iterator<Gamepad> get iterator {
25086 // Note: NodeLists are not fixed size. And most probably length shouldn't
25087 // be cached in both iterator _and_ forEach method. For now caching it
25088 // for consistency.
25089 return new FixedSizeListIterator<Gamepad>(this);
25090 }
25091
25092 Gamepad reduce(Gamepad combine(Gamepad value, Gamepad element)) {
25093 return IterableMixinWorkaround.reduce(this, combine);
25094 }
25095
25096 dynamic fold(dynamic initialValue,
25097 dynamic combine(dynamic previousValue, Gamepad element)) {
25098 return IterableMixinWorkaround.fold(this, initialValue, combine);
25099 }
25100
25101 bool contains(Gamepad element) => IterableMixinWorkaround.contains(this, eleme nt);
25102
25103 void forEach(void f(Gamepad element)) => IterableMixinWorkaround.forEach(this, f);
25104
25105 String join([String separator = ""]) =>
25106 IterableMixinWorkaround.joinList(this, separator);
25107
25108 Iterable map(f(Gamepad element)) =>
25109 IterableMixinWorkaround.mapList(this, f);
25110
25111 Iterable<Gamepad> where(bool f(Gamepad element)) =>
25112 IterableMixinWorkaround.where(this, f);
25113
25114 Iterable expand(Iterable f(Gamepad element)) =>
25115 IterableMixinWorkaround.expand(this, f);
25116
25117 bool every(bool f(Gamepad element)) => IterableMixinWorkaround.every(this, f);
25118
25119 bool any(bool f(Gamepad element)) => IterableMixinWorkaround.any(this, f);
25120
25121 List<Gamepad> toList({ bool growable: true }) =>
25122 new List<Gamepad>.from(this, growable: growable);
25123
25124 Set<Gamepad> toSet() => new Set<Gamepad>.from(this);
25125
25126 bool get isEmpty => this.length == 0;
25127
25128 Iterable<Gamepad> take(int n) => IterableMixinWorkaround.takeList(this, n);
25129
25130 Iterable<Gamepad> takeWhile(bool test(Gamepad value)) {
25131 return IterableMixinWorkaround.takeWhile(this, test);
25132 }
25133
25134 Iterable<Gamepad> skip(int n) => IterableMixinWorkaround.skipList(this, n);
25135
25136 Iterable<Gamepad> skipWhile(bool test(Gamepad value)) {
25137 return IterableMixinWorkaround.skipWhile(this, test);
25138 }
25139
25140 Gamepad firstWhere(bool test(Gamepad value), { Gamepad orElse() }) {
25141 return IterableMixinWorkaround.firstWhere(this, test, orElse);
25142 }
25143
25144 Gamepad lastWhere(bool test(Gamepad value), {Gamepad orElse()}) {
25145 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
25146 }
25147
25148 Gamepad singleWhere(bool test(Gamepad value)) {
25149 return IterableMixinWorkaround.singleWhere(this, test);
25150 }
25151
25152 Gamepad elementAt(int index) {
25153 return this[index];
25154 }
25155
25156 // From Collection<Gamepad>:
25157
25158 void add(Gamepad value) {
25159 throw new UnsupportedError("Cannot add to immutable List.");
25160 }
25161
25162 void addAll(Iterable<Gamepad> iterable) {
25163 throw new UnsupportedError("Cannot add to immutable List.");
25164 }
25165
25166 // From List<Gamepad>:
25167 void set length(int value) {
25168 throw new UnsupportedError("Cannot resize immutable List.");
25169 }
25170
25171 void clear() {
25172 throw new UnsupportedError("Cannot clear immutable List.");
25173 }
25174
25175 Iterable<Gamepad> get reversed {
25176 return IterableMixinWorkaround.reversedList(this);
25177 }
25178
25179 void sort([int compare(Gamepad a, Gamepad b)]) {
25180 throw new UnsupportedError("Cannot sort immutable List.");
25181 }
25182
25183 int indexOf(Gamepad element, [int start = 0]) =>
25184 Lists.indexOf(this, element, start, this.length);
25185
25186 int lastIndexOf(Gamepad element, [int start]) {
25187 if (start == null) start = length - 1;
25188 return Lists.lastIndexOf(this, element, start);
25189 }
25190
25191 Gamepad get first {
25192 if (this.length > 0) return this[0];
25193 throw new StateError("No elements");
25194 }
25195
25196 Gamepad get last {
25197 if (this.length > 0) return this[this.length - 1];
25198 throw new StateError("No elements");
25199 }
25200
25201 Gamepad get single {
25202 if (length == 1) return this[0];
25203 if (length == 0) throw new StateError("No elements");
25204 throw new StateError("More than one element");
25205 }
25206
25207 void insert(int index, Gamepad element) {
25208 throw new UnsupportedError("Cannot add to immutable List.");
25209 }
25210
25211 void insertAll(int index, Iterable<Gamepad> iterable) {
25212 throw new UnsupportedError("Cannot add to immutable List.");
25213 }
25214
25215 void setAll(int index, Iterable<Gamepad> iterable) {
25216 throw new UnsupportedError("Cannot modify an immutable List.");
25217 }
25218
25219 Gamepad removeAt(int pos) {
25220 throw new UnsupportedError("Cannot remove from immutable List.");
25221 }
25222
25223 Gamepad removeLast() {
25224 throw new UnsupportedError("Cannot remove from immutable List.");
25225 }
25226
25227 bool remove(Object object) {
25228 throw new UnsupportedError("Cannot remove from immutable List.");
25229 }
25230
25231 void removeWhere(bool test(Gamepad element)) {
25232 throw new UnsupportedError("Cannot remove from immutable List.");
25233 }
25234
25235 void retainWhere(bool test(Gamepad element)) {
25236 throw new UnsupportedError("Cannot remove from immutable List.");
25237 }
25238
25239 void setRange(int start, int end, Iterable<Gamepad> iterable, [int skipCount=0 ]) {
25240 throw new UnsupportedError("Cannot setRange on immutable List.");
25241 }
25242
25243 void removeRange(int start, int end) {
25244 throw new UnsupportedError("Cannot removeRange on immutable List.");
25245 }
25246
25247 void replaceRange(int start, int end, Iterable<Gamepad> iterable) {
25248 throw new UnsupportedError("Cannot modify an immutable List.");
25249 }
25250
25251 void fillRange(int start, int end, [Gamepad fillValue]) {
25252 throw new UnsupportedError("Cannot modify an immutable List.");
25253 }
25254
25255 Iterable<Gamepad> getRange(int start, int end) =>
25256 IterableMixinWorkaround.getRangeList(this, start, end);
25257
25258 List<Gamepad> sublist(int start, [int end]) {
25259 if (end == null) end = length;
25260 return Lists.getRange(this, start, end, <Gamepad>[]);
25261 }
25262
25263 Map<int, Gamepad> asMap() =>
25264 IterableMixinWorkaround.asMapList(this);
25265
25266 String toString() {
25267 StringBuffer buffer = new StringBuffer('[');
25268 buffer.writeAll(this, ', ');
25269 buffer.write(']');
25270 return buffer.toString();
25271 }
25272
25273 // -- end List<Gamepad> mixins.
25274
25275 @DomName('GamepadList.item')
25276 @DocsEditable
25277 Gamepad item(int index) native;
25278 }
25279 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25280 // for details. All rights reserved. Use of this source code is governed by a
25281 // BSD-style license that can be found in the LICENSE file. 21289 // BSD-style license that can be found in the LICENSE file.
25282 21290
25283 21291
25284 @DocsEditable 21292 @DocsEditable
25285 @DomName('HTMLAppletElement') 21293 @DomName('XPathException')
25286 abstract class _HTMLAppletElement extends Element native "HTMLAppletElement" { 21294 class XPathException native "XPathException" {
21295
21296 static const int INVALID_EXPRESSION_ERR = 51;
21297
21298 static const int TYPE_ERR = 52;
21299
21300 @DomName('XPathException.code')
21301 @DocsEditable
21302 final int code;
21303
21304 @DomName('XPathException.message')
21305 @DocsEditable
21306 final String message;
21307
21308 @DomName('XPathException.name')
21309 @DocsEditable
21310 final String name;
21311
21312 @DomName('XPathException.toString')
21313 @DocsEditable
21314 String toString() native;
25287 } 21315 }
25288 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21316 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25289 // for details. All rights reserved. Use of this source code is governed by a 21317 // for details. All rights reserved. Use of this source code is governed by a
25290 // BSD-style license that can be found in the LICENSE file.
25291
25292
25293 @DocsEditable
25294 @DomName('HTMLBaseFontElement')
25295 abstract class _HTMLBaseFontElement extends Element native "HTMLBaseFontElement" {
25296 }
25297 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25298 // for details. All rights reserved. Use of this source code is governed by a
25299 // BSD-style license that can be found in the LICENSE file.
25300
25301
25302 @DocsEditable
25303 @DomName('HTMLDirectoryElement')
25304 abstract class _HTMLDirectoryElement extends Element native "HTMLDirectoryElemen t" {
25305 }
25306 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25307 // for details. All rights reserved. Use of this source code is governed by a
25308 // BSD-style license that can be found in the LICENSE file.
25309
25310
25311 @DocsEditable
25312 @DomName('HTMLFontElement')
25313 abstract class _HTMLFontElement extends Element native "HTMLFontElement" {
25314 }
25315 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25316 // for details. All rights reserved. Use of this source code is governed by a
25317 // BSD-style license that can be found in the LICENSE file. 21318 // BSD-style license that can be found in the LICENSE file.
25318 21319
25319 21320
25320 @DocsEditable 21321 @DocsEditable
25321 @DomName('HTMLFrameElement') 21322 @DomName('XPathExpression')
25322 abstract class _HTMLFrameElement extends Element native "HTMLFrameElement" { 21323 class XPathExpression native "XPathExpression" {
21324
21325 @DomName('XPathExpression.evaluate')
21326 @DocsEditable
21327 XPathResult evaluate(Node contextNode, int type, XPathResult inResult) native;
25323 } 21328 }
25324 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21329 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25325 // for details. All rights reserved. Use of this source code is governed by a 21330 // for details. All rights reserved. Use of this source code is governed by a
25326 // BSD-style license that can be found in the LICENSE file. 21331 // BSD-style license that can be found in the LICENSE file.
25327 21332
25328 21333
25329 @DocsEditable 21334 @DocsEditable
25330 @DomName('HTMLFrameSetElement') 21335 @DomName('XPathNSResolver')
25331 abstract class _HTMLFrameSetElement extends Element native "HTMLFrameSetElement" { 21336 class XPathNSResolver native "XPathNSResolver" {
21337
21338 @JSName('lookupNamespaceURI')
21339 @DomName('XPathNSResolver.lookupNamespaceURI')
21340 @DocsEditable
21341 String lookupNamespaceUri(String prefix) native;
25332 } 21342 }
25333 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21343 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25334 // for details. All rights reserved. Use of this source code is governed by a 21344 // for details. All rights reserved. Use of this source code is governed by a
25335 // BSD-style license that can be found in the LICENSE file. 21345 // BSD-style license that can be found in the LICENSE file.
25336 21346
25337 21347
25338 @DocsEditable 21348 @DocsEditable
25339 @DomName('HTMLMarqueeElement') 21349 @DomName('XPathResult')
25340 abstract class _HTMLMarqueeElement extends Element native "HTMLMarqueeElement" { 21350 class XPathResult native "XPathResult" {
25341 } 21351
25342 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21352 static const int ANY_TYPE = 0;
25343 // for details. All rights reserved. Use of this source code is governed by a 21353
25344 // BSD-style license that can be found in the LICENSE file. 21354 static const int ANY_UNORDERED_NODE_TYPE = 8;
25345 21355
25346 21356 static const int BOOLEAN_TYPE = 3;
25347 @DocsEditable 21357
25348 @DomName('NamedNodeMap') 21358 static const int FIRST_ORDERED_NODE_TYPE = 9;
25349 class _NamedNodeMap implements JavaScriptIndexingBehavior, List<Node> native "Na medNodeMap" { 21359
25350 21360 static const int NUMBER_TYPE = 1;
25351 @DomName('NamedNodeMap.length') 21361
25352 @DocsEditable 21362 static const int ORDERED_NODE_ITERATOR_TYPE = 5;
25353 int get length => JS("int", "#.length", this); 21363
25354 21364 static const int ORDERED_NODE_SNAPSHOT_TYPE = 7;
25355 Node operator[](int index) => JS("Node", "#[#]", this, index); 21365
25356 21366 static const int STRING_TYPE = 2;
25357 void operator[]=(int index, Node value) { 21367
25358 throw new UnsupportedError("Cannot assign element of immutable List."); 21368 static const int UNORDERED_NODE_ITERATOR_TYPE = 4;
25359 } 21369
25360 // -- start List<Node> mixins. 21370 static const int UNORDERED_NODE_SNAPSHOT_TYPE = 6;
25361 // Node is the element type. 21371
25362 21372 @DomName('XPathResult.booleanValue')
25363 // From Iterable<Node>: 21373 @DocsEditable
25364 21374 final bool booleanValue;
25365 Iterator<Node> get iterator { 21375
25366 // Note: NodeLists are not fixed size. And most probably length shouldn't 21376 @DomName('XPathResult.invalidIteratorState')
25367 // be cached in both iterator _and_ forEach method. For now caching it 21377 @DocsEditable
25368 // for consistency. 21378 final bool invalidIteratorState;
25369 return new FixedSizeListIterator<Node>(this); 21379
25370 } 21380 @DomName('XPathResult.numberValue')
25371 21381 @DocsEditable
25372 Node reduce(Node combine(Node value, Node element)) { 21382 final num numberValue;
25373 return IterableMixinWorkaround.reduce(this, combine); 21383
25374 } 21384 @DomName('XPathResult.resultType')
25375 21385 @DocsEditable
25376 dynamic fold(dynamic initialValue, 21386 final int resultType;
25377 dynamic combine(dynamic previousValue, Node element)) { 21387
25378 return IterableMixinWorkaround.fold(this, initialValue, combine); 21388 @DomName('XPathResult.singleNodeValue')
25379 } 21389 @DocsEditable
25380 21390 final Node singleNodeValue;
25381 bool contains(Node element) => IterableMixinWorkaround.contains(this, element) ; 21391
25382 21392 @DomName('XPathResult.snapshotLength')
25383 void forEach(void f(Node element)) => IterableMixinWorkaround.forEach(this, f) ; 21393 @DocsEditable
25384 21394 final int snapshotLength;
25385 String join([String separator = ""]) => 21395
25386 IterableMixinWorkaround.joinList(this, separator); 21396 @DomName('XPathResult.stringValue')
25387 21397 @DocsEditable
25388 Iterable map(f(Node element)) => 21398 final String stringValue;
25389 IterableMixinWorkaround.mapList(this, f); 21399
25390 21400 @DomName('XPathResult.iterateNext')
25391 Iterable<Node> where(bool f(Node element)) => 21401 @DocsEditable
25392 IterableMixinWorkaround.where(this, f); 21402 Node iterateNext() native;
25393 21403
25394 Iterable expand(Iterable f(Node element)) => 21404 @DomName('XPathResult.snapshotItem')
25395 IterableMixinWorkaround.expand(this, f); 21405 @DocsEditable
25396 21406 Node snapshotItem(int index) native;
25397 bool every(bool f(Node element)) => IterableMixinWorkaround.every(this, f); 21407 }
25398 21408 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25399 bool any(bool f(Node element)) => IterableMixinWorkaround.any(this, f); 21409 // for details. All rights reserved. Use of this source code is governed by a
25400 21410 // BSD-style license that can be found in the LICENSE file.
25401 List<Node> toList({ bool growable: true }) => 21411
25402 new List<Node>.from(this, growable: growable); 21412
25403 21413 @DocsEditable
25404 Set<Node> toSet() => new Set<Node>.from(this); 21414 @DomName('XMLSerializer')
25405 21415 class XmlSerializer native "XMLSerializer" {
25406 bool get isEmpty => this.length == 0; 21416
25407 21417 @DomName('XMLSerializer.XMLSerializer')
25408 Iterable<Node> take(int n) => IterableMixinWorkaround.takeList(this, n); 21418 @DocsEditable
25409 21419 factory XmlSerializer() {
25410 Iterable<Node> takeWhile(bool test(Node value)) { 21420 return XmlSerializer._create_1();
25411 return IterableMixinWorkaround.takeWhile(this, test); 21421 }
25412 } 21422 static XmlSerializer _create_1() => JS('XmlSerializer', 'new XMLSerializer()') ;
25413 21423
25414 Iterable<Node> skip(int n) => IterableMixinWorkaround.skipList(this, n); 21424 @DomName('XMLSerializer.serializeToString')
25415 21425 @DocsEditable
25416 Iterable<Node> skipWhile(bool test(Node value)) { 21426 String serializeToString(Node node) native;
25417 return IterableMixinWorkaround.skipWhile(this, test); 21427 }
25418 } 21428 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25419 21429 // for details. All rights reserved. Use of this source code is governed by a
25420 Node firstWhere(bool test(Node value), { Node orElse() }) { 21430 // BSD-style license that can be found in the LICENSE file.
25421 return IterableMixinWorkaround.firstWhere(this, test, orElse); 21431
25422 } 21432
25423 21433 @DocsEditable
25424 Node lastWhere(bool test(Node value), {Node orElse()}) { 21434 @DomName('XSLTProcessor')
25425 return IterableMixinWorkaround.lastWhereList(this, test, orElse); 21435 @SupportedBrowser(SupportedBrowser.CHROME)
25426 } 21436 @SupportedBrowser(SupportedBrowser.FIREFOX)
25427 21437 @SupportedBrowser(SupportedBrowser.SAFARI)
25428 Node singleWhere(bool test(Node value)) { 21438 class XsltProcessor native "XSLTProcessor" {
25429 return IterableMixinWorkaround.singleWhere(this, test); 21439
25430 } 21440 @DomName('XSLTProcessor.XSLTProcessor')
25431 21441 @DocsEditable
25432 Node elementAt(int index) { 21442 factory XsltProcessor() {
25433 return this[index]; 21443 return XsltProcessor._create_1();
25434 } 21444 }
25435 21445 static XsltProcessor _create_1() => JS('XsltProcessor', 'new XSLTProcessor()') ;
25436 // From Collection<Node>: 21446
25437 21447 /// Checks if this type is supported on the current platform.
25438 void add(Node value) { 21448 static bool get supported => JS('bool', '!!(window.XSLTProcessor)');
25439 throw new UnsupportedError("Cannot add to immutable List."); 21449
25440 } 21450 @DomName('XSLTProcessor.clearParameters')
25441 21451 @DocsEditable
25442 void addAll(Iterable<Node> iterable) { 21452 void clearParameters() native;
25443 throw new UnsupportedError("Cannot add to immutable List."); 21453
25444 } 21454 @DomName('XSLTProcessor.getParameter')
25445 21455 @DocsEditable
25446 // From List<Node>: 21456 String getParameter(String namespaceURI, String localName) native;
25447 void set length(int value) { 21457
25448 throw new UnsupportedError("Cannot resize immutable List."); 21458 @DomName('XSLTProcessor.importStylesheet')
25449 } 21459 @DocsEditable
25450 21460 void importStylesheet(Node stylesheet) native;
25451 void clear() { 21461
25452 throw new UnsupportedError("Cannot clear immutable List."); 21462 @DomName('XSLTProcessor.removeParameter')
25453 } 21463 @DocsEditable
25454 21464 void removeParameter(String namespaceURI, String localName) native;
25455 Iterable<Node> get reversed { 21465
25456 return IterableMixinWorkaround.reversedList(this); 21466 @DomName('XSLTProcessor.reset')
25457 } 21467 @DocsEditable
25458 21468 void reset() native;
25459 void sort([int compare(Node a, Node b)]) { 21469
25460 throw new UnsupportedError("Cannot sort immutable List."); 21470 @DomName('XSLTProcessor.setParameter')
25461 } 21471 @DocsEditable
25462 21472 void setParameter(String namespaceURI, String localName, String value) native;
25463 int indexOf(Node element, [int start = 0]) => 21473
25464 Lists.indexOf(this, element, start, this.length); 21474 @DomName('XSLTProcessor.transformToDocument')
25465 21475 @DocsEditable
25466 int lastIndexOf(Node element, [int start]) { 21476 Document transformToDocument(Node source) native;
25467 if (start == null) start = length - 1; 21477
25468 return Lists.lastIndexOf(this, element, start); 21478 @DomName('XSLTProcessor.transformToFragment')
25469 } 21479 @DocsEditable
25470 21480 DocumentFragment transformToFragment(Node source, Document docVal) native;
25471 Node get first { 21481 }
25472 if (this.length > 0) return this[0]; 21482 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25473 throw new StateError("No elements"); 21483 // for details. All rights reserved. Use of this source code is governed by a
25474 } 21484 // BSD-style license that can be found in the LICENSE file.
25475 21485
25476 Node get last { 21486
25477 if (this.length > 0) return this[this.length - 1]; 21487 @DocsEditable
25478 throw new StateError("No elements"); 21488 @DomName('CSSPrimitiveValue')
25479 } 21489 abstract class _CSSPrimitiveValue extends _CSSValue native "CSSPrimitiveValue" {
25480 21490 }
25481 Node get single { 21491 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25482 if (length == 1) return this[0]; 21492 // for details. All rights reserved. Use of this source code is governed by a
25483 if (length == 0) throw new StateError("No elements"); 21493 // BSD-style license that can be found in the LICENSE file.
25484 throw new StateError("More than one element"); 21494
25485 } 21495
25486 21496 @DocsEditable
25487 void insert(int index, Node element) { 21497 @DomName('CSSValue')
25488 throw new UnsupportedError("Cannot add to immutable List."); 21498 abstract class _CSSValue native "CSSValue" {
25489 } 21499 }
25490 21500 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
25491 void insertAll(int index, Iterable<Node> iterable) { 21501 // for details. All rights reserved. Use of this source code is governed by a
25492 throw new UnsupportedError("Cannot add to immutable List."); 21502 // BSD-style license that can be found in the LICENSE file.
25493 } 21503
25494 21504
25495 void setAll(int index, Iterable<Node> iterable) { 21505 @DocsEditable
25496 throw new UnsupportedError("Cannot modify an immutable List."); 21506 @DomName('ClientRect')
25497 } 21507 class _ClientRect implements Rect native "ClientRect" {
25498 21508
25499 Node removeAt(int pos) { 21509 // NOTE! All code below should be common with Rect.
25500 throw new UnsupportedError("Cannot remove from immutable List."); 21510 // TODO(blois): implement with mixins when available.
25501 }
25502
25503 Node removeLast() {
25504 throw new UnsupportedError("Cannot remove from immutable List.");
25505 }
25506
25507 bool remove(Object object) {
25508 throw new UnsupportedError("Cannot remove from immutable List.");
25509 }
25510
25511 void removeWhere(bool test(Node element)) {
25512 throw new UnsupportedError("Cannot remove from immutable List.");
25513 }
25514
25515 void retainWhere(bool test(Node element)) {
25516 throw new UnsupportedError("Cannot remove from immutable List.");
25517 }
25518
25519 void setRange(int start, int end, Iterable<Node> iterable, [int skipCount=0]) {
25520 throw new UnsupportedError("Cannot setRange on immutable List.");
25521 }
25522
25523 void removeRange(int start, int end) {
25524 throw new UnsupportedError("Cannot removeRange on immutable List.");
25525 }
25526
25527 void replaceRange(int start, int end, Iterable<Node> iterable) {
25528 throw new UnsupportedError("Cannot modify an immutable List.");
25529 }
25530
25531 void fillRange(int start, int end, [Node fillValue]) {
25532 throw new UnsupportedError("Cannot modify an immutable List.");
25533 }
25534
25535 Iterable<Node> getRange(int start, int end) =>
25536 IterableMixinWorkaround.getRangeList(this, start, end);
25537
25538 List<Node> sublist(int start, [int end]) {
25539 if (end == null) end = length;
25540 return Lists.getRange(this, start, end, <Node>[]);
25541 }
25542
25543 Map<int, Node> asMap() =>
25544 IterableMixinWorkaround.asMapList(this);
25545 21511
25546 String toString() { 21512 String toString() {
25547 StringBuffer buffer = new StringBuffer('['); 21513 return '($left, $top, $width, $height)';
25548 buffer.writeAll(this, ', '); 21514 }
25549 buffer.write(']'); 21515
25550 return buffer.toString(); 21516 bool operator ==(other) {
25551 } 21517 if (other is !Rect) return false;
25552 21518 return left == other.left && top == other.top && width == other.width &&
25553 // -- end List<Node> mixins. 21519 height == other.height;
25554 21520 }
25555 @DomName('NamedNodeMap.getNamedItem') 21521
25556 @DocsEditable 21522 /**
25557 Node getNamedItem(String name) native; 21523 * Computes the intersection of this rectangle and the rectangle parameter.
25558 21524 * Returns null if there is no intersection.
25559 @DomName('NamedNodeMap.getNamedItemNS') 21525 */
25560 @DocsEditable 21526 Rect intersection(Rect rect) {
25561 Node getNamedItemNS(String namespaceURI, String localName) native; 21527 var x0 = max(left, rect.left);
25562 21528 var x1 = min(left + width, rect.left + rect.width);
25563 @DomName('NamedNodeMap.item') 21529
25564 @DocsEditable 21530 if (x0 <= x1) {
25565 Node item(int index) native; 21531 var y0 = max(top, rect.top);
25566 21532 var y1 = min(top + height, rect.top + rect.height);
25567 @DomName('NamedNodeMap.removeNamedItem') 21533
25568 @DocsEditable 21534 if (y0 <= y1) {
25569 Node removeNamedItem(String name) native; 21535 return new Rect(x0, y0, x1 - x0, y1 - y0);
25570 21536 }
25571 @DomName('NamedNodeMap.removeNamedItemNS') 21537 }
25572 @DocsEditable 21538 return null;
25573 Node removeNamedItemNS(String namespaceURI, String localName) native; 21539 }
25574 21540
25575 @DomName('NamedNodeMap.setNamedItem') 21541
25576 @DocsEditable 21542 /**
25577 Node setNamedItem(Node node) native; 21543 * Returns whether a rectangle intersects this rectangle.
25578 21544 */
25579 @DomName('NamedNodeMap.setNamedItemNS') 21545 bool intersects(Rect other) {
25580 @DocsEditable 21546 return (left <= other.left + other.width && other.left <= left + width &&
25581 Node setNamedItemNS(Node node) native; 21547 top <= other.top + other.height && other.top <= top + height);
25582 } 21548 }
25583 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21549
25584 // for details. All rights reserved. Use of this source code is governed by a 21550 /**
21551 * Returns a new rectangle which completely contains this rectangle and the
21552 * input rectangle.
21553 */
21554 Rect union(Rect rect) {
21555 var right = max(this.left + this.width, rect.left + rect.width);
21556 var bottom = max(this.top + this.height, rect.top + rect.height);
21557
21558 var left = min(this.left, rect.left);
21559 var top = min(this.top, rect.top);
21560
21561 return new Rect(left, top, right - left, bottom - top);
21562 }
21563
21564 /**
21565 * Tests whether this rectangle entirely contains another rectangle.
21566 */
21567 bool containsRect(Rect another) {
21568 return left <= another.left &&
21569 left + width >= another.left + another.width &&
21570 top <= another.top &&
21571 top + height >= another.top + another.height;
21572 }
21573
21574 /**
21575 * Tests whether this rectangle entirely contains a point.
21576 */
21577 bool containsPoint(Point another) {
21578 return another.x >= left &&
21579 another.x <= left + width &&
21580 another.y >= top &&
21581 another.y <= top + height;
21582 }
21583
21584 Rect ceil() => new Rect(left.ceil(), top.ceil(), width.ceil(), height.ceil());
21585 Rect floor() => new Rect(left.floor(), top.floor(), width.floor(),
21586 height.floor());
21587 Rect round() => new Rect(left.round(), top.round(), width.round(),
21588 height.round());
21589
21590 /**
21591 * Truncates coordinates to integers and returns the result as a new
21592 * rectangle.
21593 */
21594 Rect toInt() => new Rect(left.toInt(), top.toInt(), width.toInt(),
21595 height.toInt());
21596
21597 Point get topLeft => new Point(this.left, this.top);
21598 Point get bottomRight => new Point(this.left + this.width,
21599 this.top + this.height);
21600
21601 @DomName('ClientRect.bottom')
21602 @DocsEditable
21603 final num bottom;
21604
21605 @DomName('ClientRect.height')
21606 @DocsEditable
21607 final num height;
21608
21609 @DomName('ClientRect.left')
21610 @DocsEditable
21611 final num left;
21612
21613 @DomName('ClientRect.right')
21614 @DocsEditable
21615 final num right;
21616
21617 @DomName('ClientRect.top')
21618 @DocsEditable
21619 final num top;
21620
21621 @DomName('ClientRect.width')
21622 @DocsEditable
21623 final num width;
21624 }
21625 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21626 // for details. All rights reserved. Use of this source code is governed by a
25585 // BSD-style license that can be found in the LICENSE file. 21627 // BSD-style license that can be found in the LICENSE file.
25586 21628
25587 21629
25588 @DocsEditable 21630 @DocsEditable
25589 @DomName('RGBColor') 21631 @DomName('ClientRectList')
25590 abstract class _RGBColor native "RGBColor" { 21632 class _ClientRectList extends Object with ListMixin<Rect>, ImmutableListMixin<Re ct> implements JavaScriptIndexingBehavior, List<Rect> native "ClientRectList" {
25591 } 21633
25592 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 21634 @DomName('ClientRectList.length')
25593 // for details. All rights reserved. Use of this source code is governed by a 21635 @DocsEditable
25594 // BSD-style license that can be found in the LICENSE file. 21636 int get length => JS("int", "#.length", this);
21637
21638 Rect operator[](int index) => JS("Rect", "#[#]", this, index);
21639
21640 void operator[]=(int index, Rect value) {
21641 throw new UnsupportedError("Cannot assign element of immutable List.");
21642 }
21643 // -- start List<Rect> mixins.
21644 // Rect is the element type.
25595 21645
25596 21646
25597 // Omit RadioNodeList for dart2js. The Dart Form and FieldSet APIs don't 21647 void set length(int value) {
25598 // currently expose an API the returns RadioNodeList. The only use of a 21648 throw new UnsupportedError("Cannot resize immutable List.");
25599 // RadioNodeList is to get the selected value and it will be cleaner to 21649 }
25600 // introduce a different API for that purpose.
25601 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25602 // for details. All rights reserved. Use of this source code is governed by a
25603 // BSD-style license that can be found in the LICENSE file.
25604 21650
21651 // -- end List<Rect> mixins.
25605 21652
25606 @DocsEditable 21653 @DomName('ClientRectList.item')
25607 @DomName('Rect') 21654 @DocsEditable
25608 abstract class _Rect native "Rect" { 21655 Rect item(int index) native;
25609 } 21656 }
25610 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21657 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25611 // for details. All rights reserved. Use of this source code is governed by a 21658 // for details. All rights reserved. Use of this source code is governed by a
25612 // BSD-style license that can be found in the LICENSE file.
25613
25614
25615 @DocsEditable
25616 @DomName('SharedWorker')
25617 abstract class _SharedWorker extends AbstractWorker native "SharedWorker" {
25618
25619 @DomName('SharedWorker.SharedWorker')
25620 @DocsEditable
25621 factory _SharedWorker(String scriptURL, [String name]) {
25622 if (?name) {
25623 return _SharedWorker._create_1(scriptURL, name);
25624 }
25625 return _SharedWorker._create_2(scriptURL);
25626 }
25627 static _SharedWorker _create_1(scriptURL, name) => JS('_SharedWorker', 'new Sh aredWorker(#,#)', scriptURL, name);
25628 static _SharedWorker _create_2(scriptURL) => JS('_SharedWorker', 'new SharedWo rker(#)', scriptURL);
25629 }
25630 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25631 // for details. All rights reserved. Use of this source code is governed by a
25632 // BSD-style license that can be found in the LICENSE file. 21659 // BSD-style license that can be found in the LICENSE file.
25633 21660
25634 21661
25635 @DocsEditable 21662 @DocsEditable
25636 @DomName('SharedWorkerContext') 21663 @DomName('Counter')
25637 abstract class _SharedWorkerContext extends _WorkerContext native "SharedWorkerC ontext" { 21664 abstract class _Counter native "Counter" {
25638 } 21665 }
25639 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21666 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25640 // for details. All rights reserved. Use of this source code is governed by a 21667 // for details. All rights reserved. Use of this source code is governed by a
25641 // BSD-style license that can be found in the LICENSE file. 21668 // BSD-style license that can be found in the LICENSE file.
25642 21669
25643 21670
25644 @DocsEditable 21671 @DocsEditable
25645 @DomName('SpeechInputResultList') 21672 @DomName('CSSRuleList')
25646 class _SpeechInputResultList implements JavaScriptIndexingBehavior, List<SpeechI nputResult> native "SpeechInputResultList" { 21673 class _CssRuleList extends Object with ListMixin<CssRule>, ImmutableListMixin<Cs sRule> implements JavaScriptIndexingBehavior, List<CssRule> native "CSSRuleList" {
25647 21674
25648 @DomName('SpeechInputResultList.length') 21675 @DomName('CSSRuleList.length')
25649 @DocsEditable 21676 @DocsEditable
25650 int get length => JS("int", "#.length", this); 21677 int get length => JS("int", "#.length", this);
25651 21678
25652 SpeechInputResult operator[](int index) => JS("SpeechInputResult", "#[#]", thi s, index); 21679 CssRule operator[](int index) => JS("CssRule", "#[#]", this, index);
25653 21680
25654 void operator[]=(int index, SpeechInputResult value) { 21681 void operator[]=(int index, CssRule value) {
25655 throw new UnsupportedError("Cannot assign element of immutable List."); 21682 throw new UnsupportedError("Cannot assign element of immutable List.");
25656 } 21683 }
25657 // -- start List<SpeechInputResult> mixins. 21684 // -- start List<CssRule> mixins.
25658 // SpeechInputResult is the element type. 21685 // CssRule is the element type.
25659 21686
25660 // From Iterable<SpeechInputResult>:
25661 21687
25662 Iterator<SpeechInputResult> get iterator {
25663 // Note: NodeLists are not fixed size. And most probably length shouldn't
25664 // be cached in both iterator _and_ forEach method. For now caching it
25665 // for consistency.
25666 return new FixedSizeListIterator<SpeechInputResult>(this);
25667 }
25668
25669 SpeechInputResult reduce(SpeechInputResult combine(SpeechInputResult value, Sp eechInputResult element)) {
25670 return IterableMixinWorkaround.reduce(this, combine);
25671 }
25672
25673 dynamic fold(dynamic initialValue,
25674 dynamic combine(dynamic previousValue, SpeechInputResult element) ) {
25675 return IterableMixinWorkaround.fold(this, initialValue, combine);
25676 }
25677
25678 bool contains(SpeechInputResult element) => IterableMixinWorkaround.contains(t his, element);
25679
25680 void forEach(void f(SpeechInputResult element)) => IterableMixinWorkaround.for Each(this, f);
25681
25682 String join([String separator = ""]) =>
25683 IterableMixinWorkaround.joinList(this, separator);
25684
25685 Iterable map(f(SpeechInputResult element)) =>
25686 IterableMixinWorkaround.mapList(this, f);
25687
25688 Iterable<SpeechInputResult> where(bool f(SpeechInputResult element)) =>
25689 IterableMixinWorkaround.where(this, f);
25690
25691 Iterable expand(Iterable f(SpeechInputResult element)) =>
25692 IterableMixinWorkaround.expand(this, f);
25693
25694 bool every(bool f(SpeechInputResult element)) => IterableMixinWorkaround.every (this, f);
25695
25696 bool any(bool f(SpeechInputResult element)) => IterableMixinWorkaround.any(thi s, f);
25697
25698 List<SpeechInputResult> toList({ bool growable: true }) =>
25699 new List<SpeechInputResult>.from(this, growable: growable);
25700
25701 Set<SpeechInputResult> toSet() => new Set<SpeechInputResult>.from(this);
25702
25703 bool get isEmpty => this.length == 0;
25704
25705 Iterable<SpeechInputResult> take(int n) => IterableMixinWorkaround.takeList(th is, n);
25706
25707 Iterable<SpeechInputResult> takeWhile(bool test(SpeechInputResult value)) {
25708 return IterableMixinWorkaround.takeWhile(this, test);
25709 }
25710
25711 Iterable<SpeechInputResult> skip(int n) => IterableMixinWorkaround.skipList(th is, n);
25712
25713 Iterable<SpeechInputResult> skipWhile(bool test(SpeechInputResult value)) {
25714 return IterableMixinWorkaround.skipWhile(this, test);
25715 }
25716
25717 SpeechInputResult firstWhere(bool test(SpeechInputResult value), { SpeechInput Result orElse() }) {
25718 return IterableMixinWorkaround.firstWhere(this, test, orElse);
25719 }
25720
25721 SpeechInputResult lastWhere(bool test(SpeechInputResult value), {SpeechInputRe sult orElse()}) {
25722 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
25723 }
25724
25725 SpeechInputResult singleWhere(bool test(SpeechInputResult value)) {
25726 return IterableMixinWorkaround.singleWhere(this, test);
25727 }
25728
25729 SpeechInputResult elementAt(int index) {
25730 return this[index];
25731 }
25732
25733 // From Collection<SpeechInputResult>:
25734
25735 void add(SpeechInputResult value) {
25736 throw new UnsupportedError("Cannot add to immutable List.");
25737 }
25738
25739 void addAll(Iterable<SpeechInputResult> iterable) {
25740 throw new UnsupportedError("Cannot add to immutable List.");
25741 }
25742
25743 // From List<SpeechInputResult>:
25744 void set length(int value) { 21688 void set length(int value) {
25745 throw new UnsupportedError("Cannot resize immutable List."); 21689 throw new UnsupportedError("Cannot resize immutable List.");
25746 } 21690 }
25747 21691
25748 void clear() { 21692 // -- end List<CssRule> mixins.
25749 throw new UnsupportedError("Cannot clear immutable List.");
25750 }
25751 21693
25752 Iterable<SpeechInputResult> get reversed { 21694 @DomName('CSSRuleList.item')
25753 return IterableMixinWorkaround.reversedList(this);
25754 }
25755
25756 void sort([int compare(SpeechInputResult a, SpeechInputResult b)]) {
25757 throw new UnsupportedError("Cannot sort immutable List.");
25758 }
25759
25760 int indexOf(SpeechInputResult element, [int start = 0]) =>
25761 Lists.indexOf(this, element, start, this.length);
25762
25763 int lastIndexOf(SpeechInputResult element, [int start]) {
25764 if (start == null) start = length - 1;
25765 return Lists.lastIndexOf(this, element, start);
25766 }
25767
25768 SpeechInputResult get first {
25769 if (this.length > 0) return this[0];
25770 throw new StateError("No elements");
25771 }
25772
25773 SpeechInputResult get last {
25774 if (this.length > 0) return this[this.length - 1];
25775 throw new StateError("No elements");
25776 }
25777
25778 SpeechInputResult get single {
25779 if (length == 1) return this[0];
25780 if (length == 0) throw new StateError("No elements");
25781 throw new StateError("More than one element");
25782 }
25783
25784 void insert(int index, SpeechInputResult element) {
25785 throw new UnsupportedError("Cannot add to immutable List.");
25786 }
25787
25788 void insertAll(int index, Iterable<SpeechInputResult> iterable) {
25789 throw new UnsupportedError("Cannot add to immutable List.");
25790 }
25791
25792 void setAll(int index, Iterable<SpeechInputResult> iterable) {
25793 throw new UnsupportedError("Cannot modify an immutable List.");
25794 }
25795
25796 SpeechInputResult removeAt(int pos) {
25797 throw new UnsupportedError("Cannot remove from immutable List.");
25798 }
25799
25800 SpeechInputResult removeLast() {
25801 throw new UnsupportedError("Cannot remove from immutable List.");
25802 }
25803
25804 bool remove(Object object) {
25805 throw new UnsupportedError("Cannot remove from immutable List.");
25806 }
25807
25808 void removeWhere(bool test(SpeechInputResult element)) {
25809 throw new UnsupportedError("Cannot remove from immutable List.");
25810 }
25811
25812 void retainWhere(bool test(SpeechInputResult element)) {
25813 throw new UnsupportedError("Cannot remove from immutable List.");
25814 }
25815
25816 void setRange(int start, int end, Iterable<SpeechInputResult> iterable, [int s kipCount=0]) {
25817 throw new UnsupportedError("Cannot setRange on immutable List.");
25818 }
25819
25820 void removeRange(int start, int end) {
25821 throw new UnsupportedError("Cannot removeRange on immutable List.");
25822 }
25823
25824 void replaceRange(int start, int end, Iterable<SpeechInputResult> iterable) {
25825 throw new UnsupportedError("Cannot modify an immutable List.");
25826 }
25827
25828 void fillRange(int start, int end, [SpeechInputResult fillValue]) {
25829 throw new UnsupportedError("Cannot modify an immutable List.");
25830 }
25831
25832 Iterable<SpeechInputResult> getRange(int start, int end) =>
25833 IterableMixinWorkaround.getRangeList(this, start, end);
25834
25835 List<SpeechInputResult> sublist(int start, [int end]) {
25836 if (end == null) end = length;
25837 return Lists.getRange(this, start, end, <SpeechInputResult>[]);
25838 }
25839
25840 Map<int, SpeechInputResult> asMap() =>
25841 IterableMixinWorkaround.asMapList(this);
25842
25843 String toString() {
25844 StringBuffer buffer = new StringBuffer('[');
25845 buffer.writeAll(this, ', ');
25846 buffer.write(']');
25847 return buffer.toString();
25848 }
25849
25850 // -- end List<SpeechInputResult> mixins.
25851
25852 @DomName('SpeechInputResultList.item')
25853 @DocsEditable 21695 @DocsEditable
25854 SpeechInputResult item(int index) native; 21696 CssRule item(int index) native;
25855 } 21697 }
25856 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21698 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25857 // for details. All rights reserved. Use of this source code is governed by a 21699 // for details. All rights reserved. Use of this source code is governed by a
21700 // BSD-style license that can be found in the LICENSE file.
21701
21702
21703 @DocsEditable
21704 @DomName('CSSValueList')
21705 class _CssValueList extends _CSSValue with ImmutableListMixin<_CSSValue>, ListMi xin<_CSSValue> implements JavaScriptIndexingBehavior, List<_CSSValue> native "CS SValueList" {
21706
21707 @DomName('CSSValueList.length')
21708 @DocsEditable
21709 int get length => JS("int", "#.length", this);
21710
21711 _CSSValue operator[](int index) => JS("_CSSValue", "#[#]", this, index);
21712
21713 void operator[]=(int index, _CSSValue value) {
21714 throw new UnsupportedError("Cannot assign element of immutable List.");
21715 }
21716 // -- start List<_CSSValue> mixins.
21717 // _CSSValue is the element type.
21718
21719
21720 void set length(int value) {
21721 throw new UnsupportedError("Cannot resize immutable List.");
21722 }
21723
21724 // -- end List<_CSSValue> mixins.
21725
21726 @DomName('CSSValueList.item')
21727 @DocsEditable
21728 _CSSValue item(int index) native;
21729 }
21730 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21731 // for details. All rights reserved. Use of this source code is governed by a
21732 // BSD-style license that can be found in the LICENSE file.
21733
21734
21735 @DocsEditable
21736 @DomName('DOMFileSystemSync')
21737 @SupportedBrowser(SupportedBrowser.CHROME)
21738 @Experimental
21739 abstract class _DOMFileSystemSync native "DOMFileSystemSync" {
21740 }
21741 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21742 // for details. All rights reserved. Use of this source code is governed by a
21743 // BSD-style license that can be found in the LICENSE file.
21744
21745
21746 @DocsEditable
21747 @DomName('DatabaseSync')
21748 @SupportedBrowser(SupportedBrowser.CHROME)
21749 @SupportedBrowser(SupportedBrowser.SAFARI)
21750 @Experimental
21751 abstract class _DatabaseSync native "DatabaseSync" {
21752 }
21753 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21754 // for details. All rights reserved. Use of this source code is governed by a
21755 // BSD-style license that can be found in the LICENSE file.
21756
21757
21758 @DocsEditable
21759 @DomName('DedicatedWorkerContext')
21760 abstract class _DedicatedWorkerContext extends _WorkerContext native "DedicatedW orkerContext" {
21761 }
21762 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21763 // for details. All rights reserved. Use of this source code is governed by a
21764 // BSD-style license that can be found in the LICENSE file.
21765
21766
21767 @DocsEditable
21768 @DomName('DirectoryEntrySync')
21769 abstract class _DirectoryEntrySync extends _EntrySync native "DirectoryEntrySync " {
21770 }
21771 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21772 // for details. All rights reserved. Use of this source code is governed by a
21773 // BSD-style license that can be found in the LICENSE file.
21774
21775
21776 @DocsEditable
21777 @DomName('DirectoryReaderSync')
21778 abstract class _DirectoryReaderSync native "DirectoryReaderSync" {
21779 }
21780 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21781 // for details. All rights reserved. Use of this source code is governed by a
21782 // BSD-style license that can be found in the LICENSE file.
21783
21784
21785 @DocsEditable
21786 @DomName('WebKitPoint')
21787 @SupportedBrowser(SupportedBrowser.CHROME)
21788 @SupportedBrowser(SupportedBrowser.SAFARI)
21789 @Experimental
21790 class _DomPoint native "WebKitPoint" {
21791
21792 @DomName('DOMPoint.DOMPoint')
21793 @DocsEditable
21794 factory _DomPoint(num x, num y) {
21795 return _DomPoint._create_1(x, y);
21796 }
21797 static _DomPoint _create_1(x, y) => JS('_DomPoint', 'new WebKitPoint(#,#)', x, y);
21798
21799 /// Checks if this type is supported on the current platform.
21800 static bool get supported => JS('bool', '!!(window.WebKitPoint)');
21801
21802 @DomName('DOMPoint.x')
21803 @DocsEditable
21804 num x;
21805
21806 @DomName('DOMPoint.y')
21807 @DocsEditable
21808 num y;
21809 }
21810 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21811 // for details. All rights reserved. Use of this source code is governed by a
25858 // BSD-style license that can be found in the LICENSE file. 21812 // BSD-style license that can be found in the LICENSE file.
25859 21813
25860 21814
25861 @DocsEditable 21815 @DocsEditable
25862 @DomName('SpeechRecognitionResultList') 21816 @DomName('EntryArray')
25863 class _SpeechRecognitionResultList implements JavaScriptIndexingBehavior, List<S peechRecognitionResult> native "SpeechRecognitionResultList" { 21817 class _EntryArray extends Object with ImmutableListMixin<Entry>, ListMixin<Entry > implements JavaScriptIndexingBehavior, List<Entry> native "EntryArray" {
25864 21818
25865 @DomName('SpeechRecognitionResultList.length') 21819 @DomName('EntryArray.length')
25866 @DocsEditable 21820 @DocsEditable
25867 int get length => JS("int", "#.length", this); 21821 int get length => JS("int", "#.length", this);
25868 21822
25869 SpeechRecognitionResult operator[](int index) => JS("SpeechRecognitionResult", "#[#]", this, index); 21823 Entry operator[](int index) => JS("Entry", "#[#]", this, index);
25870 21824
25871 void operator[]=(int index, SpeechRecognitionResult value) { 21825 void operator[]=(int index, Entry value) {
25872 throw new UnsupportedError("Cannot assign element of immutable List."); 21826 throw new UnsupportedError("Cannot assign element of immutable List.");
25873 } 21827 }
25874 // -- start List<SpeechRecognitionResult> mixins. 21828 // -- start List<Entry> mixins.
25875 // SpeechRecognitionResult is the element type. 21829 // Entry is the element type.
25876 21830
25877 // From Iterable<SpeechRecognitionResult>: 21831
25878
25879 Iterator<SpeechRecognitionResult> get iterator {
25880 // Note: NodeLists are not fixed size. And most probably length shouldn't
25881 // be cached in both iterator _and_ forEach method. For now caching it
25882 // for consistency.
25883 return new FixedSizeListIterator<SpeechRecognitionResult>(this);
25884 }
25885
25886 SpeechRecognitionResult reduce(SpeechRecognitionResult combine(SpeechRecogniti onResult value, SpeechRecognitionResult element)) {
25887 return IterableMixinWorkaround.reduce(this, combine);
25888 }
25889
25890 dynamic fold(dynamic initialValue,
25891 dynamic combine(dynamic previousValue, SpeechRecognitionResult el ement)) {
25892 return IterableMixinWorkaround.fold(this, initialValue, combine);
25893 }
25894
25895 bool contains(SpeechRecognitionResult element) => IterableMixinWorkaround.cont ains(this, element);
25896
25897 void forEach(void f(SpeechRecognitionResult element)) => IterableMixinWorkarou nd.forEach(this, f);
25898
25899 String join([String separator = ""]) =>
25900 IterableMixinWorkaround.joinList(this, separator);
25901
25902 Iterable map(f(SpeechRecognitionResult element)) =>
25903 IterableMixinWorkaround.mapList(this, f);
25904
25905 Iterable<SpeechRecognitionResult> where(bool f(SpeechRecognitionResult element )) =>
25906 IterableMixinWorkaround.where(this, f);
25907
25908 Iterable expand(Iterable f(SpeechRecognitionResult element)) =>
25909 IterableMixinWorkaround.expand(this, f);
25910
25911 bool every(bool f(SpeechRecognitionResult element)) => IterableMixinWorkaround .every(this, f);
25912
25913 bool any(bool f(SpeechRecognitionResult element)) => IterableMixinWorkaround.a ny(this, f);
25914
25915 List<SpeechRecognitionResult> toList({ bool growable: true }) =>
25916 new List<SpeechRecognitionResult>.from(this, growable: growable);
25917
25918 Set<SpeechRecognitionResult> toSet() => new Set<SpeechRecognitionResult>.from( this);
25919
25920 bool get isEmpty => this.length == 0;
25921
25922 Iterable<SpeechRecognitionResult> take(int n) => IterableMixinWorkaround.takeL ist(this, n);
25923
25924 Iterable<SpeechRecognitionResult> takeWhile(bool test(SpeechRecognitionResult value)) {
25925 return IterableMixinWorkaround.takeWhile(this, test);
25926 }
25927
25928 Iterable<SpeechRecognitionResult> skip(int n) => IterableMixinWorkaround.skipL ist(this, n);
25929
25930 Iterable<SpeechRecognitionResult> skipWhile(bool test(SpeechRecognitionResult value)) {
25931 return IterableMixinWorkaround.skipWhile(this, test);
25932 }
25933
25934 SpeechRecognitionResult firstWhere(bool test(SpeechRecognitionResult value), { SpeechRecognitionResult orElse() }) {
25935 return IterableMixinWorkaround.firstWhere(this, test, orElse);
25936 }
25937
25938 SpeechRecognitionResult lastWhere(bool test(SpeechRecognitionResult value), {S peechRecognitionResult orElse()}) {
25939 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
25940 }
25941
25942 SpeechRecognitionResult singleWhere(bool test(SpeechRecognitionResult value)) {
25943 return IterableMixinWorkaround.singleWhere(this, test);
25944 }
25945
25946 SpeechRecognitionResult elementAt(int index) {
25947 return this[index];
25948 }
25949
25950 // From Collection<SpeechRecognitionResult>:
25951
25952 void add(SpeechRecognitionResult value) {
25953 throw new UnsupportedError("Cannot add to immutable List.");
25954 }
25955
25956 void addAll(Iterable<SpeechRecognitionResult> iterable) {
25957 throw new UnsupportedError("Cannot add to immutable List.");
25958 }
25959
25960 // From List<SpeechRecognitionResult>:
25961 void set length(int value) { 21832 void set length(int value) {
25962 throw new UnsupportedError("Cannot resize immutable List."); 21833 throw new UnsupportedError("Cannot resize immutable List.");
25963 } 21834 }
25964 21835
25965 void clear() { 21836 // -- end List<Entry> mixins.
25966 throw new UnsupportedError("Cannot clear immutable List."); 21837
25967 } 21838 @DomName('EntryArray.item')
25968 21839 @DocsEditable
25969 Iterable<SpeechRecognitionResult> get reversed { 21840 Entry item(int index) native;
25970 return IterableMixinWorkaround.reversedList(this); 21841 }
25971 } 21842 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
25972 21843 // for details. All rights reserved. Use of this source code is governed by a
25973 void sort([int compare(SpeechRecognitionResult a, SpeechRecognitionResult b)]) { 21844 // BSD-style license that can be found in the LICENSE file.
25974 throw new UnsupportedError("Cannot sort immutable List."); 21845
25975 } 21846
25976 21847 @DocsEditable
25977 int indexOf(SpeechRecognitionResult element, [int start = 0]) => 21848 @DomName('EntryArraySync')
25978 Lists.indexOf(this, element, start, this.length); 21849 class _EntryArraySync extends Object with ImmutableListMixin<_EntrySync>, ListMi xin<_EntrySync> implements JavaScriptIndexingBehavior, List<_EntrySync> native " EntryArraySync" {
25979 21850
25980 int lastIndexOf(SpeechRecognitionResult element, [int start]) { 21851 @DomName('EntryArraySync.length')
25981 if (start == null) start = length - 1; 21852 @DocsEditable
25982 return Lists.lastIndexOf(this, element, start); 21853 int get length => JS("int", "#.length", this);
25983 } 21854
25984 21855 _EntrySync operator[](int index) => JS("_EntrySync", "#[#]", this, index);
25985 SpeechRecognitionResult get first { 21856
25986 if (this.length > 0) return this[0]; 21857 void operator[]=(int index, _EntrySync value) {
25987 throw new StateError("No elements"); 21858 throw new UnsupportedError("Cannot assign element of immutable List.");
25988 } 21859 }
25989 21860 // -- start List<_EntrySync> mixins.
25990 SpeechRecognitionResult get last { 21861 // _EntrySync is the element type.
25991 if (this.length > 0) return this[this.length - 1]; 21862
25992 throw new StateError("No elements"); 21863
25993 } 21864 void set length(int value) {
25994 21865 throw new UnsupportedError("Cannot resize immutable List.");
25995 SpeechRecognitionResult get single { 21866 }
25996 if (length == 1) return this[0]; 21867
25997 if (length == 0) throw new StateError("No elements"); 21868 // -- end List<_EntrySync> mixins.
25998 throw new StateError("More than one element"); 21869
25999 } 21870 @DomName('EntryArraySync.item')
26000 21871 @DocsEditable
26001 void insert(int index, SpeechRecognitionResult element) { 21872 _EntrySync item(int index) native;
26002 throw new UnsupportedError("Cannot add to immutable List."); 21873 }
26003 } 21874 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
26004 21875 // for details. All rights reserved. Use of this source code is governed by a
26005 void insertAll(int index, Iterable<SpeechRecognitionResult> iterable) { 21876 // BSD-style license that can be found in the LICENSE file.
26006 throw new UnsupportedError("Cannot add to immutable List."); 21877
26007 } 21878
26008 21879 @DocsEditable
26009 void setAll(int index, Iterable<SpeechRecognitionResult> iterable) { 21880 @DomName('EntrySync')
26010 throw new UnsupportedError("Cannot modify an immutable List."); 21881 abstract class _EntrySync native "EntrySync" {
26011 } 21882 }
26012 21883 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
26013 SpeechRecognitionResult removeAt(int pos) { 21884 // for details. All rights reserved. Use of this source code is governed by a
26014 throw new UnsupportedError("Cannot remove from immutable List."); 21885 // BSD-style license that can be found in the LICENSE file.
26015 } 21886
26016 21887
26017 SpeechRecognitionResult removeLast() { 21888 @DocsEditable
26018 throw new UnsupportedError("Cannot remove from immutable List."); 21889 @DomName('FileEntrySync')
26019 } 21890 abstract class _FileEntrySync extends _EntrySync native "FileEntrySync" {
26020 21891 }
26021 bool remove(Object object) { 21892 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
26022 throw new UnsupportedError("Cannot remove from immutable List."); 21893 // for details. All rights reserved. Use of this source code is governed by a
26023 } 21894 // BSD-style license that can be found in the LICENSE file.
26024 21895
26025 void removeWhere(bool test(SpeechRecognitionResult element)) { 21896
26026 throw new UnsupportedError("Cannot remove from immutable List."); 21897 @DocsEditable
26027 } 21898 @DomName('FileReaderSync')
26028 21899 abstract class _FileReaderSync native "FileReaderSync" {
26029 void retainWhere(bool test(SpeechRecognitionResult element)) { 21900
26030 throw new UnsupportedError("Cannot remove from immutable List."); 21901 @DomName('FileReaderSync.FileReaderSync')
26031 } 21902 @DocsEditable
26032 21903 factory _FileReaderSync() {
26033 void setRange(int start, int end, Iterable<SpeechRecognitionResult> iterable, [int skipCount=0]) { 21904 return _FileReaderSync._create_1();
26034 throw new UnsupportedError("Cannot setRange on immutable List."); 21905 }
26035 } 21906 static _FileReaderSync _create_1() => JS('_FileReaderSync', 'new FileReaderSyn c()');
26036 21907 }
26037 void removeRange(int start, int end) { 21908 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
26038 throw new UnsupportedError("Cannot removeRange on immutable List."); 21909 // for details. All rights reserved. Use of this source code is governed by a
26039 } 21910 // BSD-style license that can be found in the LICENSE file.
26040 21911
26041 void replaceRange(int start, int end, Iterable<SpeechRecognitionResult> iterab le) { 21912
26042 throw new UnsupportedError("Cannot modify an immutable List."); 21913 @DocsEditable
26043 } 21914 @DomName('FileWriterSync')
26044 21915 abstract class _FileWriterSync native "FileWriterSync" {
26045 void fillRange(int start, int end, [SpeechRecognitionResult fillValue]) { 21916 }
26046 throw new UnsupportedError("Cannot modify an immutable List."); 21917 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
26047 } 21918 // for details. All rights reserved. Use of this source code is governed by a
26048 21919 // BSD-style license that can be found in the LICENSE file.
26049 Iterable<SpeechRecognitionResult> getRange(int start, int end) => 21920
26050 IterableMixinWorkaround.getRangeList(this, start, end); 21921
26051 21922 @DocsEditable
26052 List<SpeechRecognitionResult> sublist(int start, [int end]) { 21923 @DomName('GamepadList')
26053 if (end == null) end = length; 21924 class _GamepadList extends Object with ImmutableListMixin<Gamepad>, ListMixin<Ga mepad> implements JavaScriptIndexingBehavior, List<Gamepad> native "GamepadList" {
26054 return Lists.getRange(this, start, end, <SpeechRecognitionResult>[]); 21925
26055 } 21926 @DomName('GamepadList.length')
26056 21927 @DocsEditable
26057 Map<int, SpeechRecognitionResult> asMap() => 21928 int get length => JS("int", "#.length", this);
26058 IterableMixinWorkaround.asMapList(this); 21929
26059 21930 Gamepad operator[](int index) => JS("Gamepad", "#[#]", this, index);
26060 String toString() { 21931
26061 StringBuffer buffer = new StringBuffer('['); 21932 void operator[]=(int index, Gamepad value) {
26062 buffer.writeAll(this, ', '); 21933 throw new UnsupportedError("Cannot assign element of immutable List.");
26063 buffer.write(']'); 21934 }
26064 return buffer.toString(); 21935 // -- start List<Gamepad> mixins.
26065 } 21936 // Gamepad is the element type.
26066 21937
26067 // -- end List<SpeechRecognitionResult> mixins. 21938
26068 21939 void set length(int value) {
26069 @DomName('SpeechRecognitionResultList.item') 21940 throw new UnsupportedError("Cannot resize immutable List.");
26070 @DocsEditable 21941 }
26071 SpeechRecognitionResult item(int index) native; 21942
26072 } 21943 // -- end List<Gamepad> mixins.
26073 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 21944
26074 // for details. All rights reserved. Use of this source code is governed by a 21945 @DomName('GamepadList.item')
21946 @DocsEditable
21947 Gamepad item(int index) native;
21948 }
21949 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21950 // for details. All rights reserved. Use of this source code is governed by a
21951 // BSD-style license that can be found in the LICENSE file.
21952
21953
21954 @DocsEditable
21955 @DomName('HTMLAppletElement')
21956 abstract class _HTMLAppletElement extends Element native "HTMLAppletElement" {
21957 }
21958 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21959 // for details. All rights reserved. Use of this source code is governed by a
21960 // BSD-style license that can be found in the LICENSE file.
21961
21962
21963 @DocsEditable
21964 @DomName('HTMLBaseFontElement')
21965 abstract class _HTMLBaseFontElement extends Element native "HTMLBaseFontElement" {
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
21973 @DomName('HTMLDirectoryElement')
21974 abstract class _HTMLDirectoryElement extends Element native "HTMLDirectoryElemen t" {
21975 }
21976 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21977 // for details. All rights reserved. Use of this source code is governed by a
21978 // BSD-style license that can be found in the LICENSE file.
21979
21980
21981 @DocsEditable
21982 @DomName('HTMLFontElement')
21983 abstract class _HTMLFontElement extends Element native "HTMLFontElement" {
21984 }
21985 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21986 // for details. All rights reserved. Use of this source code is governed by a
21987 // BSD-style license that can be found in the LICENSE file.
21988
21989
21990 @DocsEditable
21991 @DomName('HTMLFrameElement')
21992 abstract class _HTMLFrameElement extends Element native "HTMLFrameElement" {
21993 }
21994 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21995 // for details. All rights reserved. Use of this source code is governed by a
21996 // BSD-style license that can be found in the LICENSE file.
21997
21998
21999 @DocsEditable
22000 @DomName('HTMLFrameSetElement')
22001 abstract class _HTMLFrameSetElement extends Element native "HTMLFrameSetElement" {
22002 }
22003 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22004 // for details. All rights reserved. Use of this source code is governed by a
22005 // BSD-style license that can be found in the LICENSE file.
22006
22007
22008 @DocsEditable
22009 @DomName('HTMLMarqueeElement')
22010 abstract class _HTMLMarqueeElement extends Element native "HTMLMarqueeElement" {
22011 }
22012 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22013 // for details. All rights reserved. Use of this source code is governed by a
26075 // BSD-style license that can be found in the LICENSE file. 22014 // BSD-style license that can be found in the LICENSE file.
26076 22015
26077 22016
26078 @DocsEditable 22017 @DocsEditable
22018 @DomName('NamedNodeMap')
22019 class _NamedNodeMap extends Object with ImmutableListMixin<Node>, ListMixin<Node > implements JavaScriptIndexingBehavior, List<Node> native "NamedNodeMap" {
22020
22021 @DomName('NamedNodeMap.length')
22022 @DocsEditable
22023 int get length => JS("int", "#.length", this);
22024
22025 Node operator[](int index) => JS("Node", "#[#]", this, index);
22026
22027 void operator[]=(int index, Node value) {
22028 throw new UnsupportedError("Cannot assign element of immutable List.");
22029 }
22030 // -- start List<Node> mixins.
22031 // Node is the element type.
22032
22033
22034 void set length(int value) {
22035 throw new UnsupportedError("Cannot resize immutable List.");
22036 }
22037
22038 // -- end List<Node> mixins.
22039
22040 @DomName('NamedNodeMap.getNamedItem')
22041 @DocsEditable
22042 Node getNamedItem(String name) native;
22043
22044 @DomName('NamedNodeMap.getNamedItemNS')
22045 @DocsEditable
22046 Node getNamedItemNS(String namespaceURI, String localName) native;
22047
22048 @DomName('NamedNodeMap.item')
22049 @DocsEditable
22050 Node item(int index) native;
22051
22052 @DomName('NamedNodeMap.removeNamedItem')
22053 @DocsEditable
22054 Node removeNamedItem(String name) native;
22055
22056 @DomName('NamedNodeMap.removeNamedItemNS')
22057 @DocsEditable
22058 Node removeNamedItemNS(String namespaceURI, String localName) native;
22059
22060 @DomName('NamedNodeMap.setNamedItem')
22061 @DocsEditable
22062 Node setNamedItem(Node node) native;
22063
22064 @DomName('NamedNodeMap.setNamedItemNS')
22065 @DocsEditable
22066 Node setNamedItemNS(Node node) native;
22067 }
22068 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22069 // for details. All rights reserved. Use of this source code is governed by a
22070 // BSD-style license that can be found in the LICENSE file.
22071
22072
22073 @DocsEditable
22074 @DomName('RGBColor')
22075 abstract class _RGBColor native "RGBColor" {
22076 }
22077 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
22078 // for details. All rights reserved. Use of this source code is governed by a
22079 // BSD-style license that can be found in the LICENSE file.
22080
22081
22082 // Omit RadioNodeList for dart2js. The Dart Form and FieldSet APIs don't
22083 // currently expose an API the returns RadioNodeList. The only use of a
22084 // RadioNodeList is to get the selected value and it will be cleaner to
22085 // introduce a different API for that purpose.
22086 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22087 // for details. All rights reserved. Use of this source code is governed by a
22088 // BSD-style license that can be found in the LICENSE file.
22089
22090
22091 @DocsEditable
22092 @DomName('Rect')
22093 abstract class _Rect native "Rect" {
22094 }
22095 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22096 // for details. All rights reserved. Use of this source code is governed by a
22097 // BSD-style license that can be found in the LICENSE file.
22098
22099
22100 @DocsEditable
22101 @DomName('SharedWorker')
22102 abstract class _SharedWorker extends AbstractWorker native "SharedWorker" {
22103
22104 @DomName('SharedWorker.SharedWorker')
22105 @DocsEditable
22106 factory _SharedWorker(String scriptURL, [String name]) {
22107 if (?name) {
22108 return _SharedWorker._create_1(scriptURL, name);
22109 }
22110 return _SharedWorker._create_2(scriptURL);
22111 }
22112 static _SharedWorker _create_1(scriptURL, name) => JS('_SharedWorker', 'new Sh aredWorker(#,#)', scriptURL, name);
22113 static _SharedWorker _create_2(scriptURL) => JS('_SharedWorker', 'new SharedWo rker(#)', scriptURL);
22114 }
22115 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22116 // for details. All rights reserved. Use of this source code is governed by a
22117 // BSD-style license that can be found in the LICENSE file.
22118
22119
22120 @DocsEditable
22121 @DomName('SharedWorkerContext')
22122 abstract class _SharedWorkerContext extends _WorkerContext native "SharedWorkerC ontext" {
22123 }
22124 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22125 // for details. All rights reserved. Use of this source code is governed by a
22126 // BSD-style license that can be found in the LICENSE file.
22127
22128
22129 @DocsEditable
22130 @DomName('SpeechInputResultList')
22131 class _SpeechInputResultList extends Object with ImmutableListMixin<SpeechInputR esult>, ListMixin<SpeechInputResult> implements JavaScriptIndexingBehavior, List <SpeechInputResult> native "SpeechInputResultList" {
22132
22133 @DomName('SpeechInputResultList.length')
22134 @DocsEditable
22135 int get length => JS("int", "#.length", this);
22136
22137 SpeechInputResult operator[](int index) => JS("SpeechInputResult", "#[#]", thi s, index);
22138
22139 void operator[]=(int index, SpeechInputResult value) {
22140 throw new UnsupportedError("Cannot assign element of immutable List.");
22141 }
22142 // -- start List<SpeechInputResult> mixins.
22143 // SpeechInputResult is the element type.
22144
22145
22146 void set length(int value) {
22147 throw new UnsupportedError("Cannot resize immutable List.");
22148 }
22149
22150 // -- end List<SpeechInputResult> mixins.
22151
22152 @DomName('SpeechInputResultList.item')
22153 @DocsEditable
22154 SpeechInputResult item(int index) native;
22155 }
22156 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22157 // for details. All rights reserved. Use of this source code is governed by a
22158 // BSD-style license that can be found in the LICENSE file.
22159
22160
22161 @DocsEditable
22162 @DomName('SpeechRecognitionResultList')
22163 class _SpeechRecognitionResultList extends Object with ListMixin<SpeechRecogniti onResult>, ImmutableListMixin<SpeechRecognitionResult> implements JavaScriptInde xingBehavior, List<SpeechRecognitionResult> native "SpeechRecognitionResultList" {
22164
22165 @DomName('SpeechRecognitionResultList.length')
22166 @DocsEditable
22167 int get length => JS("int", "#.length", this);
22168
22169 SpeechRecognitionResult operator[](int index) => JS("SpeechRecognitionResult", "#[#]", this, index);
22170
22171 void operator[]=(int index, SpeechRecognitionResult value) {
22172 throw new UnsupportedError("Cannot assign element of immutable List.");
22173 }
22174 // -- start List<SpeechRecognitionResult> mixins.
22175 // SpeechRecognitionResult is the element type.
22176
22177
22178 void set length(int value) {
22179 throw new UnsupportedError("Cannot resize immutable List.");
22180 }
22181
22182 // -- end List<SpeechRecognitionResult> mixins.
22183
22184 @DomName('SpeechRecognitionResultList.item')
22185 @DocsEditable
22186 SpeechRecognitionResult item(int index) native;
22187 }
22188 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22189 // for details. All rights reserved. Use of this source code is governed by a
22190 // BSD-style license that can be found in the LICENSE file.
22191
22192
22193 @DocsEditable
26079 @DomName('StyleSheetList') 22194 @DomName('StyleSheetList')
26080 class _StyleSheetList implements JavaScriptIndexingBehavior, List<StyleSheet> na tive "StyleSheetList" { 22195 class _StyleSheetList extends Object with ListMixin<StyleSheet>, ImmutableListMi xin<StyleSheet> implements JavaScriptIndexingBehavior, List<StyleSheet> native " StyleSheetList" {
26081 22196
26082 @DomName('StyleSheetList.length') 22197 @DomName('StyleSheetList.length')
26083 @DocsEditable 22198 @DocsEditable
26084 int get length => JS("int", "#.length", this); 22199 int get length => JS("int", "#.length", this);
26085 22200
26086 StyleSheet operator[](int index) => JS("StyleSheet", "#[#]", this, index); 22201 StyleSheet operator[](int index) => JS("StyleSheet", "#[#]", this, index);
26087 22202
26088 void operator[]=(int index, StyleSheet value) { 22203 void operator[]=(int index, StyleSheet value) {
26089 throw new UnsupportedError("Cannot assign element of immutable List."); 22204 throw new UnsupportedError("Cannot assign element of immutable List.");
26090 } 22205 }
26091 // -- start List<StyleSheet> mixins. 22206 // -- start List<StyleSheet> mixins.
26092 // StyleSheet is the element type. 22207 // StyleSheet is the element type.
26093 22208
26094 // From Iterable<StyleSheet>: 22209
26095 22210 void set length(int value) {
26096 Iterator<StyleSheet> get iterator { 22211 throw new UnsupportedError("Cannot resize immutable List.");
26097 // Note: NodeLists are not fixed size. And most probably length shouldn't
26098 // be cached in both iterator _and_ forEach method. For now caching it
26099 // for consistency.
26100 return new FixedSizeListIterator<StyleSheet>(this);
26101 }
26102
26103 StyleSheet reduce(StyleSheet combine(StyleSheet value, StyleSheet element)) {
26104 return IterableMixinWorkaround.reduce(this, combine);
26105 }
26106
26107 dynamic fold(dynamic initialValue,
26108 dynamic combine(dynamic previousValue, StyleSheet element)) {
26109 return IterableMixinWorkaround.fold(this, initialValue, combine);
26110 }
26111
26112 bool contains(StyleSheet element) => IterableMixinWorkaround.contains(this, el ement);
26113
26114 void forEach(void f(StyleSheet element)) => IterableMixinWorkaround.forEach(th is, f);
26115
26116 String join([String separator = ""]) =>
26117 IterableMixinWorkaround.joinList(this, separator);
26118
26119 Iterable map(f(StyleSheet element)) =>
26120 IterableMixinWorkaround.mapList(this, f);
26121
26122 Iterable<StyleSheet> where(bool f(StyleSheet element)) =>
26123 IterableMixinWorkaround.where(this, f);
26124
26125 Iterable expand(Iterable f(StyleSheet element)) =>
26126 IterableMixinWorkaround.expand(this, f);
26127
26128 bool every(bool f(StyleSheet element)) => IterableMixinWorkaround.every(this, f);
26129
26130 bool any(bool f(StyleSheet element)) => IterableMixinWorkaround.any(this, f);
26131
26132 List<StyleSheet> toList({ bool growable: true }) =>
26133 new List<StyleSheet>.from(this, growable: growable);
26134
26135 Set<StyleSheet> toSet() => new Set<StyleSheet>.from(this);
26136
26137 bool get isEmpty => this.length == 0;
26138
26139 Iterable<StyleSheet> take(int n) => IterableMixinWorkaround.takeList(this, n);
26140
26141 Iterable<StyleSheet> takeWhile(bool test(StyleSheet value)) {
26142 return IterableMixinWorkaround.takeWhile(this, test);
26143 }
26144
26145 Iterable<StyleSheet> skip(int n) => IterableMixinWorkaround.skipList(this, n);
26146
26147 Iterable<StyleSheet> skipWhile(bool test(StyleSheet value)) {
26148 return IterableMixinWorkaround.skipWhile(this, test);
26149 }
26150
26151 StyleSheet firstWhere(bool test(StyleSheet value), { StyleSheet orElse() }) {
26152 return IterableMixinWorkaround.firstWhere(this, test, orElse);
26153 }
26154
26155 StyleSheet lastWhere(bool test(StyleSheet value), {StyleSheet orElse()}) {
26156 return IterableMixinWorkaround.lastWhereList(this, test, orElse);
26157 }
26158
26159 StyleSheet singleWhere(bool test(StyleSheet value)) {
26160 return IterableMixinWorkaround.singleWhere(this, test);
26161 }
26162
26163 StyleSheet elementAt(int index) {
26164 return this[index];
26165 }
26166
26167 // From Collection<StyleSheet>:
26168
26169 void add(StyleSheet value) {
26170 throw new UnsupportedError("Cannot add to immutable List.");
26171 }
26172
26173 void addAll(Iterable<StyleSheet> iterable) {
26174 throw new UnsupportedError("Cannot add to immutable List.");
26175 }
26176
26177 // From List<StyleSheet>:
26178 void set length(int value) {
26179 throw new UnsupportedError("Cannot resize immutable List.");
26180 }
26181
26182 void clear() {
26183 throw new UnsupportedError("Cannot clear immutable List.");
26184 }
26185
26186 Iterable<StyleSheet> get reversed {
26187 return IterableMixinWorkaround.reversedList(this);
26188 }
26189
26190 void sort([int compare(StyleSheet a, StyleSheet b)]) {
26191 throw new UnsupportedError("Cannot sort immutable List.");
26192 }
26193
26194 int indexOf(StyleSheet element, [int start = 0]) =>
26195 Lists.indexOf(this, element, start, this.length);
26196
26197 int lastIndexOf(StyleSheet element, [int start]) {
26198 if (start == null) start = length - 1;
26199 return Lists.lastIndexOf(this, element, start);
26200 }
26201
26202 StyleSheet get first {
26203 if (this.length > 0) return this[0];
26204 throw new StateError("No elements");
26205 }
26206
26207 StyleSheet get last {
26208 if (this.length > 0) return this[this.length - 1];
26209 throw new StateError("No elements");
26210 }
26211
26212 StyleSheet get single {
26213 if (length == 1) return this[0];
26214 if (length == 0) throw new StateError("No elements");
26215 throw new StateError("More than one element");
26216 }
26217
26218 void insert(int index, StyleSheet element) {
26219 throw new UnsupportedError("Cannot add to immutable List.");
26220 }
26221
26222 void insertAll(int index, Iterable<StyleSheet> iterable) {
26223 throw new UnsupportedError("Cannot add to immutable List.");
26224 }
26225
26226 void setAll(int index, Iterable<StyleSheet> iterable) {
26227 throw new UnsupportedError("Cannot modify an immutable List.");
26228 }
26229
26230 StyleSheet removeAt(int pos) {
26231 throw new UnsupportedError("Cannot remove from immutable List.");
26232 }
26233
26234 StyleSheet removeLast() {
26235 throw new UnsupportedError("Cannot remove from immutable List.");
26236 }
26237
26238 bool remove(Object object) {
26239 throw new UnsupportedError("Cannot remove from immutable List.");
26240 }
26241
26242 void removeWhere(bool test(StyleSheet element)) {
26243 throw new UnsupportedError("Cannot remove from immutable List.");
26244 }
26245
26246 void retainWhere(bool test(StyleSheet element)) {
26247 throw new UnsupportedError("Cannot remove from immutable List.");
26248 }
26249
26250 void setRange(int start, int end, Iterable<StyleSheet> iterable, [int skipCoun t=0]) {
26251 throw new UnsupportedError("Cannot setRange on immutable List.");
26252 }
26253
26254 void removeRange(int start, int end) {
26255 throw new UnsupportedError("Cannot removeRange on immutable List.");
26256 }
26257
26258 void replaceRange(int start, int end, Iterable<StyleSheet> iterable) {
26259 throw new UnsupportedError("Cannot modify an immutable List.");
26260 }
26261
26262 void fillRange(int start, int end, [StyleSheet fillValue]) {
26263 throw new UnsupportedError("Cannot modify an immutable List.");
26264 }
26265
26266 Iterable<StyleSheet> getRange(int start, int end) =>
26267 IterableMixinWorkaround.getRangeList(this, start, end);
26268
26269 List<StyleSheet> sublist(int start, [int end]) {
26270 if (end == null) end = length;
26271 return Lists.getRange(this, start, end, <StyleSheet>[]);
26272 }
26273
26274 Map<int, StyleSheet> asMap() =>
26275 IterableMixinWorkaround.asMapList(this);
26276
26277 String toString() {
26278 StringBuffer buffer = new StringBuffer('[');
26279 buffer.writeAll(this, ', ');
26280 buffer.write(']');
26281 return buffer.toString();
26282 } 22212 }
26283 22213
26284 // -- end List<StyleSheet> mixins. 22214 // -- end List<StyleSheet> mixins.
26285 22215
26286 @DomName('StyleSheetList.item') 22216 @DomName('StyleSheetList.item')
26287 @DocsEditable 22217 @DocsEditable
26288 StyleSheet item(int index) native; 22218 StyleSheet item(int index) native;
26289 } 22219 }
26290 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 22220 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
26291 // for details. All rights reserved. Use of this source code is governed by a 22221 // for details. All rights reserved. Use of this source code is governed by a
(...skipping 839 matching lines...) Expand 10 before | Expand all | Expand 10 after
27131 23061
27132 String getEventType(EventTarget target) { 23062 String getEventType(EventTarget target) {
27133 return _eventTypeGetter(target); 23063 return _eventTypeGetter(target);
27134 } 23064 }
27135 } 23065 }
27136 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 23066 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
27137 // for details. All rights reserved. Use of this source code is governed by a 23067 // for details. All rights reserved. Use of this source code is governed by a
27138 // BSD-style license that can be found in the LICENSE file. 23068 // BSD-style license that can be found in the LICENSE file.
27139 23069
27140 23070
23071 abstract class ImmutableListMixin<E> implements List<E> {
23072 // From Iterable<$E>:
23073 Iterator<E> get iterator {
23074 // Note: NodeLists are not fixed size. And most probably length shouldn't
23075 // be cached in both iterator _and_ forEach method. For now caching it
23076 // for consistency.
23077 return new FixedSizeListIterator<E>(this);
23078 }
23079
23080 // From Collection<E>:
23081 void add(E value) {
23082 throw new UnsupportedError("Cannot add to immutable List.");
23083 }
23084
23085 void addAll(Iterable<E> iterable) {
23086 throw new UnsupportedError("Cannot add to immutable List.");
23087 }
23088
23089 // From List<E>:
23090 void sort([int compare(E a, E b)]) {
23091 throw new UnsupportedError("Cannot sort immutable List.");
23092 }
23093
23094 void insert(int index, E element) {
23095 throw new UnsupportedError("Cannot add to immutable List.");
23096 }
23097
23098 void insertAll(int index, Iterable<E> iterable) {
23099 throw new UnsupportedError("Cannot add to immutable List.");
23100 }
23101
23102 void setAll(int index, Iterable<E> iterable) {
23103 throw new UnsupportedError("Cannot modify an immutable List.");
23104 }
23105
23106 E removeAt(int pos) {
23107 throw new UnsupportedError("Cannot remove from immutable List.");
23108 }
23109
23110 E removeLast() {
23111 throw new UnsupportedError("Cannot remove from immutable List.");
23112 }
23113
23114 void remove(Object object) {
23115 throw new UnsupportedError("Cannot remove from immutable List.");
23116 }
23117
23118 void removeWhere(bool test(E element)) {
23119 throw new UnsupportedError("Cannot remove from immutable List.");
23120 }
23121
23122 void retainWhere(bool test(E element)) {
23123 throw new UnsupportedError("Cannot remove from immutable List.");
23124 }
23125
23126 void setRange(int start, int end, Iterable<E> iterable, [int skipCount]) {
23127 throw new UnsupportedError("Cannot setRange on immutable List.");
23128 }
23129
23130 void removeRange(int start, int end) {
23131 throw new UnsupportedError("Cannot removeRange on immutable List.");
23132 }
23133
23134 void replaceRange(int start, int end, Iterable<E> iterable) {
23135 throw new UnsupportedError("Cannot modify an immutable List.");
23136 }
23137
23138 void fillRange(int start, int end, [E fillValue]) {
23139 throw new UnsupportedError("Cannot modify an immutable List.");
23140 }
23141 }
23142 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
23143 // for details. All rights reserved. Use of this source code is governed by a
23144 // BSD-style license that can be found in the LICENSE file.
23145
23146
27141 /** 23147 /**
27142 * Internal class that does the actual calculations to determine keyCode and 23148 * Internal class that does the actual calculations to determine keyCode and
27143 * charCode for keydown, keypress, and keyup events for all browsers. 23149 * charCode for keydown, keypress, and keyup events for all browsers.
27144 */ 23150 */
27145 class _KeyboardEventHandler extends EventStreamProvider<KeyEvent> { 23151 class _KeyboardEventHandler extends EventStreamProvider<KeyEvent> {
27146 // This code inspired by Closure's KeyHandling library. 23152 // This code inspired by Closure's KeyHandling library.
27147 // http://closure-library.googlecode.com/svn/docs/closure_goog_events_keyhandl er.js.source.html 23153 // http://closure-library.googlecode.com/svn/docs/closure_goog_events_keyhandl er.js.source.html
27148 23154
27149 /** 23155 /**
27150 * The set of keys that have been pressed down without seeing their 23156 * The set of keys that have been pressed down without seeing their
(...skipping 2758 matching lines...) Expand 10 before | Expand all | Expand 10 after
29909 _position = nextPosition; 25915 _position = nextPosition;
29910 return true; 25916 return true;
29911 } 25917 }
29912 _current = null; 25918 _current = null;
29913 _position = _array.length; 25919 _position = _array.length;
29914 return false; 25920 return false;
29915 } 25921 }
29916 25922
29917 T get current => _current; 25923 T get current => _current;
29918 } 25924 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | tools/dom/scripts/systemhtml.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698