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

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

Issue 14619013: Explicitly implementing some DOM iterable APIs for performance (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /// The Dart HTML library. 1 /// The Dart HTML library.
2 library dart.dom.html; 2 library dart.dom.html;
3 3
4 import 'dart:async'; 4 import 'dart:async';
5 import 'dart:collection'; 5 import 'dart:collection';
6 import 'dart:_collection-dev' hide Symbol; 6 import 'dart:_collection-dev' hide Symbol;
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 6812 matching lines...) Expand 10 before | Expand all | Expand 10 after
6823 6823
6824 6824
6825 @DocsEditable 6825 @DocsEditable
6826 @DomName('DOMStringList') 6826 @DomName('DOMStringList')
6827 class DomStringList extends Object with ListMixin<String>, ImmutableListMixin<St ring> implements JavaScriptIndexingBehavior, List<String> native "DOMStringList" { 6827 class DomStringList extends Object with ListMixin<String>, ImmutableListMixin<St ring> implements JavaScriptIndexingBehavior, List<String> native "DOMStringList" {
6828 6828
6829 @DomName('DOMStringList.length') 6829 @DomName('DOMStringList.length')
6830 @DocsEditable 6830 @DocsEditable
6831 int get length => JS("int", "#.length", this); 6831 int get length => JS("int", "#.length", this);
6832 6832
6833 String operator[](int index) => JS("String", "#[#]", this, index); 6833 String operator[](int index) {
6834 6834 if (JS("bool", "# >>> 0 !== # || # >= #", index,
6835 index, index, length))
6836 throw new RangeError.range(index, 0, length);
6837 return JS("String", "#[#]", this, index);
6838 }
6835 void operator[]=(int index, String value) { 6839 void operator[]=(int index, String value) {
6836 throw new UnsupportedError("Cannot assign element of immutable List."); 6840 throw new UnsupportedError("Cannot assign element of immutable List.");
6837 } 6841 }
6838 // -- start List<String> mixins. 6842 // -- start List<String> mixins.
6839 // String is the element type. 6843 // String is the element type.
6840 6844
6841 6845
6842 void set length(int value) { 6846 void set length(int value) {
6843 throw new UnsupportedError("Cannot resize immutable List."); 6847 throw new UnsupportedError("Cannot resize immutable List.");
6844 } 6848 }
6845 6849
6850 String get first {
6851 if (this.length > 0) {
6852 return JS('String', '#[0]', this);
6853 }
6854 throw new StateError("No elements");
6855 }
6856
6857 String get last {
6858 int len = this.length;
6859 if (len > 0) {
6860 return JS('String', '#[#]', this, len - 1);
6861 }
6862 throw new StateError("No elements");
6863 }
6864
6865 String get single {
6866 int len = this.length;
6867 if (len == 1) {
6868 return JS('String', '#[0]', this);
6869 }
6870 if (len == 0) throw new StateError("No elements");
6871 throw new StateError("More than one element");
6872 }
6873
6874 String elementAt(int index) => this[index];
6846 // -- end List<String> mixins. 6875 // -- end List<String> mixins.
6847 6876
6848 @DomName('DOMStringList.contains') 6877 @DomName('DOMStringList.contains')
6849 @DocsEditable 6878 @DocsEditable
6850 bool contains(String string) native; 6879 bool contains(String string) native;
6851 6880
6852 @DomName('DOMStringList.item') 6881 @DomName('DOMStringList.item')
6853 @DocsEditable 6882 @DocsEditable
6854 String item(int index) native; 6883 String item(int index) native;
6855 } 6884 }
(...skipping 2570 matching lines...) Expand 10 before | Expand all | Expand 10 after
9426 9455
9427 9456
9428 @DocsEditable 9457 @DocsEditable
9429 @DomName('FileList') 9458 @DomName('FileList')
9430 class FileList extends Object with ListMixin<File>, ImmutableListMixin<File> imp lements JavaScriptIndexingBehavior, List<File> native "FileList" { 9459 class FileList extends Object with ListMixin<File>, ImmutableListMixin<File> imp lements JavaScriptIndexingBehavior, List<File> native "FileList" {
9431 9460
9432 @DomName('FileList.length') 9461 @DomName('FileList.length')
9433 @DocsEditable 9462 @DocsEditable
9434 int get length => JS("int", "#.length", this); 9463 int get length => JS("int", "#.length", this);
9435 9464
9436 File operator[](int index) => JS("File", "#[#]", this, index); 9465 File operator[](int index) {
9437 9466 if (JS("bool", "# >>> 0 !== # || # >= #", index,
9467 index, index, length))
9468 throw new RangeError.range(index, 0, length);
9469 return JS("File", "#[#]", this, index);
9470 }
9438 void operator[]=(int index, File value) { 9471 void operator[]=(int index, File value) {
9439 throw new UnsupportedError("Cannot assign element of immutable List."); 9472 throw new UnsupportedError("Cannot assign element of immutable List.");
9440 } 9473 }
9441 // -- start List<File> mixins. 9474 // -- start List<File> mixins.
9442 // File is the element type. 9475 // File is the element type.
9443 9476
9444 9477
9445 void set length(int value) { 9478 void set length(int value) {
9446 throw new UnsupportedError("Cannot resize immutable List."); 9479 throw new UnsupportedError("Cannot resize immutable List.");
9447 } 9480 }
9448 9481
9482 File get first {
9483 if (this.length > 0) {
9484 return JS('File', '#[0]', this);
9485 }
9486 throw new StateError("No elements");
9487 }
9488
9489 File get last {
9490 int len = this.length;
9491 if (len > 0) {
9492 return JS('File', '#[#]', this, len - 1);
9493 }
9494 throw new StateError("No elements");
9495 }
9496
9497 File get single {
9498 int len = this.length;
9499 if (len == 1) {
9500 return JS('File', '#[0]', this);
9501 }
9502 if (len == 0) throw new StateError("No elements");
9503 throw new StateError("More than one element");
9504 }
9505
9506 File elementAt(int index) => this[index];
9449 // -- end List<File> mixins. 9507 // -- end List<File> mixins.
9450 9508
9451 @DomName('FileList.item') 9509 @DomName('FileList.item')
9452 @DocsEditable 9510 @DocsEditable
9453 File item(int index) native; 9511 File item(int index) native;
9454 } 9512 }
9455 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 9513 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
9456 // for details. All rights reserved. Use of this source code is governed by a 9514 // for details. All rights reserved. Use of this source code is governed by a
9457 // BSD-style license that can be found in the LICENSE file. 9515 // BSD-style license that can be found in the LICENSE file.
9458 9516
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after
10223 10281
10224 10282
10225 @DocsEditable 10283 @DocsEditable
10226 @DomName('HTMLAllCollection') 10284 @DomName('HTMLAllCollection')
10227 class HtmlAllCollection extends Object with ListMixin<Node>, ImmutableListMixin< Node> implements JavaScriptIndexingBehavior, List<Node> native "HTMLAllCollectio n" { 10285 class HtmlAllCollection extends Object with ListMixin<Node>, ImmutableListMixin< Node> implements JavaScriptIndexingBehavior, List<Node> native "HTMLAllCollectio n" {
10228 10286
10229 @DomName('HTMLAllCollection.length') 10287 @DomName('HTMLAllCollection.length')
10230 @DocsEditable 10288 @DocsEditable
10231 int get length => JS("int", "#.length", this); 10289 int get length => JS("int", "#.length", this);
10232 10290
10233 Node operator[](int index) => JS("Node", "#[#]", this, index); 10291 Node operator[](int index) {
10234 10292 if (JS("bool", "# >>> 0 !== # || # >= #", index,
10293 index, index, length))
10294 throw new RangeError.range(index, 0, length);
10295 return JS("Node", "#[#]", this, index);
10296 }
10235 void operator[]=(int index, Node value) { 10297 void operator[]=(int index, Node value) {
10236 throw new UnsupportedError("Cannot assign element of immutable List."); 10298 throw new UnsupportedError("Cannot assign element of immutable List.");
10237 } 10299 }
10238 // -- start List<Node> mixins. 10300 // -- start List<Node> mixins.
10239 // Node is the element type. 10301 // Node is the element type.
10240 10302
10241 10303
10242 void set length(int value) { 10304 void set length(int value) {
10243 throw new UnsupportedError("Cannot resize immutable List."); 10305 throw new UnsupportedError("Cannot resize immutable List.");
10244 } 10306 }
10245 10307
10308 Node get first {
10309 if (this.length > 0) {
10310 return JS('Node', '#[0]', this);
10311 }
10312 throw new StateError("No elements");
10313 }
10314
10315 Node get last {
10316 int len = this.length;
10317 if (len > 0) {
10318 return JS('Node', '#[#]', this, len - 1);
10319 }
10320 throw new StateError("No elements");
10321 }
10322
10323 Node get single {
10324 int len = this.length;
10325 if (len == 1) {
10326 return JS('Node', '#[0]', this);
10327 }
10328 if (len == 0) throw new StateError("No elements");
10329 throw new StateError("More than one element");
10330 }
10331
10332 Node elementAt(int index) => this[index];
10246 // -- end List<Node> mixins. 10333 // -- end List<Node> mixins.
10247 10334
10248 @DomName('HTMLAllCollection.item') 10335 @DomName('HTMLAllCollection.item')
10249 @DocsEditable 10336 @DocsEditable
10250 Node item(int index) native; 10337 Node item(int index) native;
10251 10338
10252 @DomName('HTMLAllCollection.namedItem') 10339 @DomName('HTMLAllCollection.namedItem')
10253 @DocsEditable 10340 @DocsEditable
10254 Node namedItem(String name) native; 10341 Node namedItem(String name) native;
10255 10342
10256 @DomName('HTMLAllCollection.tags') 10343 @DomName('HTMLAllCollection.tags')
10257 @DocsEditable 10344 @DocsEditable
10258 @Returns('NodeList') 10345 @Returns('NodeList')
10259 @Creates('NodeList') 10346 @Creates('NodeList')
10260 List<Node> tags(String name) native; 10347 List<Node> tags(String name) native;
10261 } 10348 }
10262 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 10349 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
10263 // for details. All rights reserved. Use of this source code is governed by a 10350 // for details. All rights reserved. Use of this source code is governed by a
10264 // BSD-style license that can be found in the LICENSE file. 10351 // BSD-style license that can be found in the LICENSE file.
10265 10352
10266 10353
10267 @DocsEditable 10354 @DocsEditable
10268 @DomName('HTMLCollection') 10355 @DomName('HTMLCollection')
10269 class HtmlCollection extends Object with ListMixin<Node>, ImmutableListMixin<Nod e> implements JavaScriptIndexingBehavior, List<Node> native "HTMLCollection" { 10356 class HtmlCollection extends Object with ListMixin<Node>, ImmutableListMixin<Nod e> implements JavaScriptIndexingBehavior, List<Node> native "HTMLCollection" {
10270 10357
10271 @DomName('HTMLCollection.length') 10358 @DomName('HTMLCollection.length')
10272 @DocsEditable 10359 @DocsEditable
10273 int get length => JS("int", "#.length", this); 10360 int get length => JS("int", "#.length", this);
10274 10361
10275 Node operator[](int index) => JS("Node", "#[#]", this, index); 10362 Node operator[](int index) {
10276 10363 if (JS("bool", "# >>> 0 !== # || # >= #", index,
10364 index, index, length))
10365 throw new RangeError.range(index, 0, length);
10366 return JS("Node", "#[#]", this, index);
10367 }
10277 void operator[]=(int index, Node value) { 10368 void operator[]=(int index, Node value) {
10278 throw new UnsupportedError("Cannot assign element of immutable List."); 10369 throw new UnsupportedError("Cannot assign element of immutable List.");
10279 } 10370 }
10280 // -- start List<Node> mixins. 10371 // -- start List<Node> mixins.
10281 // Node is the element type. 10372 // Node is the element type.
10282 10373
10283 10374
10284 void set length(int value) { 10375 void set length(int value) {
10285 throw new UnsupportedError("Cannot resize immutable List."); 10376 throw new UnsupportedError("Cannot resize immutable List.");
10286 } 10377 }
10287 10378
10379 Node get first {
10380 if (this.length > 0) {
10381 return JS('Node', '#[0]', this);
10382 }
10383 throw new StateError("No elements");
10384 }
10385
10386 Node get last {
10387 int len = this.length;
10388 if (len > 0) {
10389 return JS('Node', '#[#]', this, len - 1);
10390 }
10391 throw new StateError("No elements");
10392 }
10393
10394 Node get single {
10395 int len = this.length;
10396 if (len == 1) {
10397 return JS('Node', '#[0]', this);
10398 }
10399 if (len == 0) throw new StateError("No elements");
10400 throw new StateError("More than one element");
10401 }
10402
10403 Node elementAt(int index) => this[index];
10288 // -- end List<Node> mixins. 10404 // -- end List<Node> mixins.
10289 10405
10290 @DomName('HTMLCollection.item') 10406 @DomName('HTMLCollection.item')
10291 @DocsEditable 10407 @DocsEditable
10292 Node item(int index) native; 10408 Node item(int index) native;
10293 10409
10294 @DomName('HTMLCollection.namedItem') 10410 @DomName('HTMLCollection.namedItem')
10295 @DocsEditable 10411 @DocsEditable
10296 Node namedItem(String name) native; 10412 Node namedItem(String name) native;
10297 } 10413 }
(...skipping 3506 matching lines...) Expand 10 before | Expand all | Expand 10 after
13804 13920
13805 13921
13806 @DocsEditable 13922 @DocsEditable
13807 @DomName('MimeTypeArray') 13923 @DomName('MimeTypeArray')
13808 class MimeTypeArray extends Object with ListMixin<MimeType>, ImmutableListMixin< MimeType> implements JavaScriptIndexingBehavior, List<MimeType> native "MimeType Array" { 13924 class MimeTypeArray extends Object with ListMixin<MimeType>, ImmutableListMixin< MimeType> implements JavaScriptIndexingBehavior, List<MimeType> native "MimeType Array" {
13809 13925
13810 @DomName('MimeTypeArray.length') 13926 @DomName('MimeTypeArray.length')
13811 @DocsEditable 13927 @DocsEditable
13812 int get length => JS("int", "#.length", this); 13928 int get length => JS("int", "#.length", this);
13813 13929
13814 MimeType operator[](int index) => JS("MimeType", "#[#]", this, index); 13930 MimeType operator[](int index) {
13815 13931 if (JS("bool", "# >>> 0 !== # || # >= #", index,
13932 index, index, length))
13933 throw new RangeError.range(index, 0, length);
13934 return JS("MimeType", "#[#]", this, index);
13935 }
13816 void operator[]=(int index, MimeType value) { 13936 void operator[]=(int index, MimeType value) {
13817 throw new UnsupportedError("Cannot assign element of immutable List."); 13937 throw new UnsupportedError("Cannot assign element of immutable List.");
13818 } 13938 }
13819 // -- start List<MimeType> mixins. 13939 // -- start List<MimeType> mixins.
13820 // MimeType is the element type. 13940 // MimeType is the element type.
13821 13941
13822 13942
13823 void set length(int value) { 13943 void set length(int value) {
13824 throw new UnsupportedError("Cannot resize immutable List."); 13944 throw new UnsupportedError("Cannot resize immutable List.");
13825 } 13945 }
13826 13946
13947 MimeType get first {
13948 if (this.length > 0) {
13949 return JS('MimeType', '#[0]', this);
13950 }
13951 throw new StateError("No elements");
13952 }
13953
13954 MimeType get last {
13955 int len = this.length;
13956 if (len > 0) {
13957 return JS('MimeType', '#[#]', this, len - 1);
13958 }
13959 throw new StateError("No elements");
13960 }
13961
13962 MimeType get single {
13963 int len = this.length;
13964 if (len == 1) {
13965 return JS('MimeType', '#[0]', this);
13966 }
13967 if (len == 0) throw new StateError("No elements");
13968 throw new StateError("More than one element");
13969 }
13970
13971 MimeType elementAt(int index) => this[index];
13827 // -- end List<MimeType> mixins. 13972 // -- end List<MimeType> mixins.
13828 13973
13829 @DomName('MimeTypeArray.item') 13974 @DomName('MimeTypeArray.item')
13830 @DocsEditable 13975 @DocsEditable
13831 MimeType item(int index) native; 13976 MimeType item(int index) native;
13832 13977
13833 @DomName('MimeTypeArray.namedItem') 13978 @DomName('MimeTypeArray.namedItem')
13834 @DocsEditable 13979 @DocsEditable
13835 MimeType namedItem(String name) native; 13980 MimeType namedItem(String name) native;
13836 } 13981 }
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
15011 15156
15012 15157
15013 @DocsEditable 15158 @DocsEditable
15014 @DomName('NodeList') 15159 @DomName('NodeList')
15015 class NodeList extends Object with ListMixin<Node>, ImmutableListMixin<Node> imp lements JavaScriptIndexingBehavior, List<Node> native "NodeList,RadioNodeList" { 15160 class NodeList extends Object with ListMixin<Node>, ImmutableListMixin<Node> imp lements JavaScriptIndexingBehavior, List<Node> native "NodeList,RadioNodeList" {
15016 15161
15017 @DomName('NodeList.length') 15162 @DomName('NodeList.length')
15018 @DocsEditable 15163 @DocsEditable
15019 int get length => JS("int", "#.length", this); 15164 int get length => JS("int", "#.length", this);
15020 15165
15021 Node operator[](int index) => JS("Node", "#[#]", this, index); 15166 Node operator[](int index) {
15022 15167 if (JS("bool", "# >>> 0 !== # || # >= #", index,
15168 index, index, length))
15169 throw new RangeError.range(index, 0, length);
15170 return JS("Node", "#[#]", this, index);
15171 }
15023 void operator[]=(int index, Node value) { 15172 void operator[]=(int index, Node value) {
15024 throw new UnsupportedError("Cannot assign element of immutable List."); 15173 throw new UnsupportedError("Cannot assign element of immutable List.");
15025 } 15174 }
15026 // -- start List<Node> mixins. 15175 // -- start List<Node> mixins.
15027 // Node is the element type. 15176 // Node is the element type.
15028 15177
15029 15178
15030 void set length(int value) { 15179 void set length(int value) {
15031 throw new UnsupportedError("Cannot resize immutable List."); 15180 throw new UnsupportedError("Cannot resize immutable List.");
15032 } 15181 }
15033 15182
15183 Node get first {
15184 if (this.length > 0) {
15185 return JS('Node', '#[0]', this);
15186 }
15187 throw new StateError("No elements");
15188 }
15189
15190 Node get last {
15191 int len = this.length;
15192 if (len > 0) {
15193 return JS('Node', '#[#]', this, len - 1);
15194 }
15195 throw new StateError("No elements");
15196 }
15197
15198 Node get single {
15199 int len = this.length;
15200 if (len == 1) {
15201 return JS('Node', '#[0]', this);
15202 }
15203 if (len == 0) throw new StateError("No elements");
15204 throw new StateError("More than one element");
15205 }
15206
15207 Node elementAt(int index) => this[index];
15034 // -- end List<Node> mixins. 15208 // -- end List<Node> mixins.
15035 15209
15036 @JSName('item') 15210 @JSName('item')
15037 @DomName('NodeList.item') 15211 @DomName('NodeList.item')
15038 @DocsEditable 15212 @DocsEditable
15039 Node _item(int index) native; 15213 Node _item(int index) native;
15040 } 15214 }
15041 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 15215 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
15042 // for details. All rights reserved. Use of this source code is governed by a 15216 // for details. All rights reserved. Use of this source code is governed by a
15043 // BSD-style license that can be found in the LICENSE file. 15217 // BSD-style license that can be found in the LICENSE file.
(...skipping 948 matching lines...) Expand 10 before | Expand all | Expand 10 after
15992 16166
15993 16167
15994 @DocsEditable 16168 @DocsEditable
15995 @DomName('PluginArray') 16169 @DomName('PluginArray')
15996 class PluginArray extends Object with ListMixin<Plugin>, ImmutableListMixin<Plug in> implements JavaScriptIndexingBehavior, List<Plugin> native "PluginArray" { 16170 class PluginArray extends Object with ListMixin<Plugin>, ImmutableListMixin<Plug in> implements JavaScriptIndexingBehavior, List<Plugin> native "PluginArray" {
15997 16171
15998 @DomName('PluginArray.length') 16172 @DomName('PluginArray.length')
15999 @DocsEditable 16173 @DocsEditable
16000 int get length => JS("int", "#.length", this); 16174 int get length => JS("int", "#.length", this);
16001 16175
16002 Plugin operator[](int index) => JS("Plugin", "#[#]", this, index); 16176 Plugin operator[](int index) {
16003 16177 if (JS("bool", "# >>> 0 !== # || # >= #", index,
16178 index, index, length))
16179 throw new RangeError.range(index, 0, length);
16180 return JS("Plugin", "#[#]", this, index);
16181 }
16004 void operator[]=(int index, Plugin value) { 16182 void operator[]=(int index, Plugin value) {
16005 throw new UnsupportedError("Cannot assign element of immutable List."); 16183 throw new UnsupportedError("Cannot assign element of immutable List.");
16006 } 16184 }
16007 // -- start List<Plugin> mixins. 16185 // -- start List<Plugin> mixins.
16008 // Plugin is the element type. 16186 // Plugin is the element type.
16009 16187
16010 16188
16011 void set length(int value) { 16189 void set length(int value) {
16012 throw new UnsupportedError("Cannot resize immutable List."); 16190 throw new UnsupportedError("Cannot resize immutable List.");
16013 } 16191 }
16014 16192
16193 Plugin get first {
16194 if (this.length > 0) {
16195 return JS('Plugin', '#[0]', this);
16196 }
16197 throw new StateError("No elements");
16198 }
16199
16200 Plugin get last {
16201 int len = this.length;
16202 if (len > 0) {
16203 return JS('Plugin', '#[#]', this, len - 1);
16204 }
16205 throw new StateError("No elements");
16206 }
16207
16208 Plugin get single {
16209 int len = this.length;
16210 if (len == 1) {
16211 return JS('Plugin', '#[0]', this);
16212 }
16213 if (len == 0) throw new StateError("No elements");
16214 throw new StateError("More than one element");
16215 }
16216
16217 Plugin elementAt(int index) => this[index];
16015 // -- end List<Plugin> mixins. 16218 // -- end List<Plugin> mixins.
16016 16219
16017 @DomName('PluginArray.item') 16220 @DomName('PluginArray.item')
16018 @DocsEditable 16221 @DocsEditable
16019 Plugin item(int index) native; 16222 Plugin item(int index) native;
16020 16223
16021 @DomName('PluginArray.namedItem') 16224 @DomName('PluginArray.namedItem')
16022 @DocsEditable 16225 @DocsEditable
16023 Plugin namedItem(String name) native; 16226 Plugin namedItem(String name) native;
16024 16227
(...skipping 1622 matching lines...) Expand 10 before | Expand all | Expand 10 after
17647 17850
17648 17851
17649 @DocsEditable 17852 @DocsEditable
17650 @DomName('SourceBufferList') 17853 @DomName('SourceBufferList')
17651 class SourceBufferList extends EventTarget with ListMixin<SourceBuffer>, Immutab leListMixin<SourceBuffer> implements JavaScriptIndexingBehavior, List<SourceBuff er> native "SourceBufferList" { 17854 class SourceBufferList extends EventTarget with ListMixin<SourceBuffer>, Immutab leListMixin<SourceBuffer> implements JavaScriptIndexingBehavior, List<SourceBuff er> native "SourceBufferList" {
17652 17855
17653 @DomName('SourceBufferList.length') 17856 @DomName('SourceBufferList.length')
17654 @DocsEditable 17857 @DocsEditable
17655 int get length => JS("int", "#.length", this); 17858 int get length => JS("int", "#.length", this);
17656 17859
17657 SourceBuffer operator[](int index) => JS("SourceBuffer", "#[#]", this, index); 17860 SourceBuffer operator[](int index) {
17658 17861 if (JS("bool", "# >>> 0 !== # || # >= #", index,
17862 index, index, length))
17863 throw new RangeError.range(index, 0, length);
17864 return JS("SourceBuffer", "#[#]", this, index);
17865 }
17659 void operator[]=(int index, SourceBuffer value) { 17866 void operator[]=(int index, SourceBuffer value) {
17660 throw new UnsupportedError("Cannot assign element of immutable List."); 17867 throw new UnsupportedError("Cannot assign element of immutable List.");
17661 } 17868 }
17662 // -- start List<SourceBuffer> mixins. 17869 // -- start List<SourceBuffer> mixins.
17663 // SourceBuffer is the element type. 17870 // SourceBuffer is the element type.
17664 17871
17665 17872
17666 void set length(int value) { 17873 void set length(int value) {
17667 throw new UnsupportedError("Cannot resize immutable List."); 17874 throw new UnsupportedError("Cannot resize immutable List.");
17668 } 17875 }
17669 17876
17877 SourceBuffer get first {
17878 if (this.length > 0) {
17879 return JS('SourceBuffer', '#[0]', this);
17880 }
17881 throw new StateError("No elements");
17882 }
17883
17884 SourceBuffer get last {
17885 int len = this.length;
17886 if (len > 0) {
17887 return JS('SourceBuffer', '#[#]', this, len - 1);
17888 }
17889 throw new StateError("No elements");
17890 }
17891
17892 SourceBuffer get single {
17893 int len = this.length;
17894 if (len == 1) {
17895 return JS('SourceBuffer', '#[0]', this);
17896 }
17897 if (len == 0) throw new StateError("No elements");
17898 throw new StateError("More than one element");
17899 }
17900
17901 SourceBuffer elementAt(int index) => this[index];
17670 // -- end List<SourceBuffer> mixins. 17902 // -- end List<SourceBuffer> mixins.
17671 17903
17672 @JSName('addEventListener') 17904 @JSName('addEventListener')
17673 @DomName('SourceBufferList.addEventListener') 17905 @DomName('SourceBufferList.addEventListener')
17674 @DocsEditable 17906 @DocsEditable
17675 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 17907 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
17676 17908
17677 @DomName('SourceBufferList.dispatchEvent') 17909 @DomName('SourceBufferList.dispatchEvent')
17678 @DocsEditable 17910 @DocsEditable
17679 bool dispatchEvent(Event event) native; 17911 bool dispatchEvent(Event event) native;
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
17762 @DocsEditable 17994 @DocsEditable
17763 factory SpeechGrammarList() { 17995 factory SpeechGrammarList() {
17764 return SpeechGrammarList._create_1(); 17996 return SpeechGrammarList._create_1();
17765 } 17997 }
17766 static SpeechGrammarList _create_1() => JS('SpeechGrammarList', 'new SpeechGra mmarList()'); 17998 static SpeechGrammarList _create_1() => JS('SpeechGrammarList', 'new SpeechGra mmarList()');
17767 17999
17768 @DomName('SpeechGrammarList.length') 18000 @DomName('SpeechGrammarList.length')
17769 @DocsEditable 18001 @DocsEditable
17770 int get length => JS("int", "#.length", this); 18002 int get length => JS("int", "#.length", this);
17771 18003
17772 SpeechGrammar operator[](int index) => JS("SpeechGrammar", "#[#]", this, index ); 18004 SpeechGrammar operator[](int index) {
17773 18005 if (JS("bool", "# >>> 0 !== # || # >= #", index,
18006 index, index, length))
18007 throw new RangeError.range(index, 0, length);
18008 return JS("SpeechGrammar", "#[#]", this, index);
18009 }
17774 void operator[]=(int index, SpeechGrammar value) { 18010 void operator[]=(int index, SpeechGrammar value) {
17775 throw new UnsupportedError("Cannot assign element of immutable List."); 18011 throw new UnsupportedError("Cannot assign element of immutable List.");
17776 } 18012 }
17777 // -- start List<SpeechGrammar> mixins. 18013 // -- start List<SpeechGrammar> mixins.
17778 // SpeechGrammar is the element type. 18014 // SpeechGrammar is the element type.
17779 18015
17780 18016
17781 void set length(int value) { 18017 void set length(int value) {
17782 throw new UnsupportedError("Cannot resize immutable List."); 18018 throw new UnsupportedError("Cannot resize immutable List.");
17783 } 18019 }
17784 18020
18021 SpeechGrammar get first {
18022 if (this.length > 0) {
18023 return JS('SpeechGrammar', '#[0]', this);
18024 }
18025 throw new StateError("No elements");
18026 }
18027
18028 SpeechGrammar get last {
18029 int len = this.length;
18030 if (len > 0) {
18031 return JS('SpeechGrammar', '#[#]', this, len - 1);
18032 }
18033 throw new StateError("No elements");
18034 }
18035
18036 SpeechGrammar get single {
18037 int len = this.length;
18038 if (len == 1) {
18039 return JS('SpeechGrammar', '#[0]', this);
18040 }
18041 if (len == 0) throw new StateError("No elements");
18042 throw new StateError("More than one element");
18043 }
18044
18045 SpeechGrammar elementAt(int index) => this[index];
17785 // -- end List<SpeechGrammar> mixins. 18046 // -- end List<SpeechGrammar> mixins.
17786 18047
17787 @DomName('SpeechGrammarList.addFromString') 18048 @DomName('SpeechGrammarList.addFromString')
17788 @DocsEditable 18049 @DocsEditable
17789 void addFromString(String string, [num weight]) native; 18050 void addFromString(String string, [num weight]) native;
17790 18051
17791 @DomName('SpeechGrammarList.addFromUri') 18052 @DomName('SpeechGrammarList.addFromUri')
17792 @DocsEditable 18053 @DocsEditable
17793 void addFromUri(String src, [num weight]) native; 18054 void addFromUri(String src, [num weight]) native;
17794 18055
(...skipping 1405 matching lines...) Expand 10 before | Expand all | Expand 10 after
19200 19461
19201 19462
19202 @DocsEditable 19463 @DocsEditable
19203 @DomName('TextTrackCueList') 19464 @DomName('TextTrackCueList')
19204 class TextTrackCueList extends Object with ListMixin<TextTrackCue>, ImmutableLis tMixin<TextTrackCue> implements List<TextTrackCue>, JavaScriptIndexingBehavior n ative "TextTrackCueList" { 19465 class TextTrackCueList extends Object with ListMixin<TextTrackCue>, ImmutableLis tMixin<TextTrackCue> implements List<TextTrackCue>, JavaScriptIndexingBehavior n ative "TextTrackCueList" {
19205 19466
19206 @DomName('TextTrackCueList.length') 19467 @DomName('TextTrackCueList.length')
19207 @DocsEditable 19468 @DocsEditable
19208 int get length => JS("int", "#.length", this); 19469 int get length => JS("int", "#.length", this);
19209 19470
19210 TextTrackCue operator[](int index) => JS("TextTrackCue", "#[#]", this, index); 19471 TextTrackCue operator[](int index) {
19211 19472 if (JS("bool", "# >>> 0 !== # || # >= #", index,
19473 index, index, length))
19474 throw new RangeError.range(index, 0, length);
19475 return JS("TextTrackCue", "#[#]", this, index);
19476 }
19212 void operator[]=(int index, TextTrackCue value) { 19477 void operator[]=(int index, TextTrackCue value) {
19213 throw new UnsupportedError("Cannot assign element of immutable List."); 19478 throw new UnsupportedError("Cannot assign element of immutable List.");
19214 } 19479 }
19215 // -- start List<TextTrackCue> mixins. 19480 // -- start List<TextTrackCue> mixins.
19216 // TextTrackCue is the element type. 19481 // TextTrackCue is the element type.
19217 19482
19218 19483
19219 void set length(int value) { 19484 void set length(int value) {
19220 throw new UnsupportedError("Cannot resize immutable List."); 19485 throw new UnsupportedError("Cannot resize immutable List.");
19221 } 19486 }
19222 19487
19488 TextTrackCue get first {
19489 if (this.length > 0) {
19490 return JS('TextTrackCue', '#[0]', this);
19491 }
19492 throw new StateError("No elements");
19493 }
19494
19495 TextTrackCue get last {
19496 int len = this.length;
19497 if (len > 0) {
19498 return JS('TextTrackCue', '#[#]', this, len - 1);
19499 }
19500 throw new StateError("No elements");
19501 }
19502
19503 TextTrackCue get single {
19504 int len = this.length;
19505 if (len == 1) {
19506 return JS('TextTrackCue', '#[0]', this);
19507 }
19508 if (len == 0) throw new StateError("No elements");
19509 throw new StateError("More than one element");
19510 }
19511
19512 TextTrackCue elementAt(int index) => this[index];
19223 // -- end List<TextTrackCue> mixins. 19513 // -- end List<TextTrackCue> mixins.
19224 19514
19225 @DomName('TextTrackCueList.getCueById') 19515 @DomName('TextTrackCueList.getCueById')
19226 @DocsEditable 19516 @DocsEditable
19227 TextTrackCue getCueById(String id) native; 19517 TextTrackCue getCueById(String id) native;
19228 19518
19229 @DomName('TextTrackCueList.item') 19519 @DomName('TextTrackCueList.item')
19230 @DocsEditable 19520 @DocsEditable
19231 TextTrackCue item(int index) native; 19521 TextTrackCue item(int index) native;
19232 } 19522 }
19233 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 19523 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
19234 // for details. All rights reserved. Use of this source code is governed by a 19524 // for details. All rights reserved. Use of this source code is governed by a
19235 // BSD-style license that can be found in the LICENSE file. 19525 // BSD-style license that can be found in the LICENSE file.
19236 19526
19237 19527
19238 @DocsEditable 19528 @DocsEditable
19239 @DomName('TextTrackList') 19529 @DomName('TextTrackList')
19240 class TextTrackList extends EventTarget with ListMixin<TextTrack>, ImmutableList Mixin<TextTrack> implements JavaScriptIndexingBehavior, List<TextTrack> native " TextTrackList" { 19530 class TextTrackList extends EventTarget with ListMixin<TextTrack>, ImmutableList Mixin<TextTrack> implements JavaScriptIndexingBehavior, List<TextTrack> native " TextTrackList" {
19241 19531
19242 @DomName('TextTrackList.addtrackEvent') 19532 @DomName('TextTrackList.addtrackEvent')
19243 @DocsEditable 19533 @DocsEditable
19244 static const EventStreamProvider<TrackEvent> addTrackEvent = const EventStream Provider<TrackEvent>('addtrack'); 19534 static const EventStreamProvider<TrackEvent> addTrackEvent = const EventStream Provider<TrackEvent>('addtrack');
19245 19535
19246 @DomName('TextTrackList.length') 19536 @DomName('TextTrackList.length')
19247 @DocsEditable 19537 @DocsEditable
19248 int get length => JS("int", "#.length", this); 19538 int get length => JS("int", "#.length", this);
19249 19539
19250 TextTrack operator[](int index) => JS("TextTrack", "#[#]", this, index); 19540 TextTrack operator[](int index) {
19251 19541 if (JS("bool", "# >>> 0 !== # || # >= #", index,
19542 index, index, length))
19543 throw new RangeError.range(index, 0, length);
19544 return JS("TextTrack", "#[#]", this, index);
19545 }
19252 void operator[]=(int index, TextTrack value) { 19546 void operator[]=(int index, TextTrack value) {
19253 throw new UnsupportedError("Cannot assign element of immutable List."); 19547 throw new UnsupportedError("Cannot assign element of immutable List.");
19254 } 19548 }
19255 // -- start List<TextTrack> mixins. 19549 // -- start List<TextTrack> mixins.
19256 // TextTrack is the element type. 19550 // TextTrack is the element type.
19257 19551
19258 19552
19259 void set length(int value) { 19553 void set length(int value) {
19260 throw new UnsupportedError("Cannot resize immutable List."); 19554 throw new UnsupportedError("Cannot resize immutable List.");
19261 } 19555 }
19262 19556
19557 TextTrack get first {
19558 if (this.length > 0) {
19559 return JS('TextTrack', '#[0]', this);
19560 }
19561 throw new StateError("No elements");
19562 }
19563
19564 TextTrack get last {
19565 int len = this.length;
19566 if (len > 0) {
19567 return JS('TextTrack', '#[#]', this, len - 1);
19568 }
19569 throw new StateError("No elements");
19570 }
19571
19572 TextTrack get single {
19573 int len = this.length;
19574 if (len == 1) {
19575 return JS('TextTrack', '#[0]', this);
19576 }
19577 if (len == 0) throw new StateError("No elements");
19578 throw new StateError("More than one element");
19579 }
19580
19581 TextTrack elementAt(int index) => this[index];
19263 // -- end List<TextTrack> mixins. 19582 // -- end List<TextTrack> mixins.
19264 19583
19265 @JSName('addEventListener') 19584 @JSName('addEventListener')
19266 @DomName('TextTrackList.addEventListener') 19585 @DomName('TextTrackList.addEventListener')
19267 @DocsEditable 19586 @DocsEditable
19268 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native; 19587 void $dom_addEventListener(String type, EventListener listener, [bool useCaptu re]) native;
19269 19588
19270 @DomName('TextTrackList.dispatchEvent') 19589 @DomName('TextTrackList.dispatchEvent')
19271 @DocsEditable 19590 @DocsEditable
19272 bool dispatchEvent(Event evt) native; 19591 bool dispatchEvent(Event evt) native;
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
19506 /// with touch enabled. See dartbug.com/8314. 19825 /// with touch enabled. See dartbug.com/8314.
19507 factory TouchList() => document.$dom_createTouchList(); 19826 factory TouchList() => document.$dom_createTouchList();
19508 19827
19509 /// Checks if this type is supported on the current platform. 19828 /// Checks if this type is supported on the current platform.
19510 static bool get supported => JS('bool', '!!document.createTouchList'); 19829 static bool get supported => JS('bool', '!!document.createTouchList');
19511 19830
19512 @DomName('TouchList.length') 19831 @DomName('TouchList.length')
19513 @DocsEditable 19832 @DocsEditable
19514 int get length => JS("int", "#.length", this); 19833 int get length => JS("int", "#.length", this);
19515 19834
19516 Touch operator[](int index) => JS("Touch", "#[#]", this, index); 19835 Touch operator[](int index) {
19517 19836 if (JS("bool", "# >>> 0 !== # || # >= #", index,
19837 index, index, length))
19838 throw new RangeError.range(index, 0, length);
19839 return JS("Touch", "#[#]", this, index);
19840 }
19518 void operator[]=(int index, Touch value) { 19841 void operator[]=(int index, Touch value) {
19519 throw new UnsupportedError("Cannot assign element of immutable List."); 19842 throw new UnsupportedError("Cannot assign element of immutable List.");
19520 } 19843 }
19521 // -- start List<Touch> mixins. 19844 // -- start List<Touch> mixins.
19522 // Touch is the element type. 19845 // Touch is the element type.
19523 19846
19524 19847
19525 void set length(int value) { 19848 void set length(int value) {
19526 throw new UnsupportedError("Cannot resize immutable List."); 19849 throw new UnsupportedError("Cannot resize immutable List.");
19527 } 19850 }
19528 19851
19852 Touch get first {
19853 if (this.length > 0) {
19854 return JS('Touch', '#[0]', this);
19855 }
19856 throw new StateError("No elements");
19857 }
19858
19859 Touch get last {
19860 int len = this.length;
19861 if (len > 0) {
19862 return JS('Touch', '#[#]', this, len - 1);
19863 }
19864 throw new StateError("No elements");
19865 }
19866
19867 Touch get single {
19868 int len = this.length;
19869 if (len == 1) {
19870 return JS('Touch', '#[0]', this);
19871 }
19872 if (len == 0) throw new StateError("No elements");
19873 throw new StateError("More than one element");
19874 }
19875
19876 Touch elementAt(int index) => this[index];
19529 // -- end List<Touch> mixins. 19877 // -- end List<Touch> mixins.
19530 19878
19531 @DomName('TouchList.item') 19879 @DomName('TouchList.item')
19532 @DocsEditable 19880 @DocsEditable
19533 Touch item(int index) native; 19881 Touch item(int index) native;
19534 19882
19535 } 19883 }
19536 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 19884 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
19537 // for details. All rights reserved. Use of this source code is governed by a 19885 // for details. All rights reserved. Use of this source code is governed by a
19538 // BSD-style license that can be found in the LICENSE file. 19886 // BSD-style license that can be found in the LICENSE file.
(...skipping 2255 matching lines...) Expand 10 before | Expand all | Expand 10 after
21794 22142
21795 22143
21796 @DocsEditable 22144 @DocsEditable
21797 @DomName('ClientRectList') 22145 @DomName('ClientRectList')
21798 class _ClientRectList extends Object with ListMixin<Rect>, ImmutableListMixin<Re ct> implements JavaScriptIndexingBehavior, List<Rect> native "ClientRectList" { 22146 class _ClientRectList extends Object with ListMixin<Rect>, ImmutableListMixin<Re ct> implements JavaScriptIndexingBehavior, List<Rect> native "ClientRectList" {
21799 22147
21800 @DomName('ClientRectList.length') 22148 @DomName('ClientRectList.length')
21801 @DocsEditable 22149 @DocsEditable
21802 int get length => JS("int", "#.length", this); 22150 int get length => JS("int", "#.length", this);
21803 22151
21804 Rect operator[](int index) => JS("Rect", "#[#]", this, index); 22152 Rect operator[](int index) {
21805 22153 if (JS("bool", "# >>> 0 !== # || # >= #", index,
22154 index, index, length))
22155 throw new RangeError.range(index, 0, length);
22156 return JS("Rect", "#[#]", this, index);
22157 }
21806 void operator[]=(int index, Rect value) { 22158 void operator[]=(int index, Rect value) {
21807 throw new UnsupportedError("Cannot assign element of immutable List."); 22159 throw new UnsupportedError("Cannot assign element of immutable List.");
21808 } 22160 }
21809 // -- start List<Rect> mixins. 22161 // -- start List<Rect> mixins.
21810 // Rect is the element type. 22162 // Rect is the element type.
21811 22163
21812 22164
21813 void set length(int value) { 22165 void set length(int value) {
21814 throw new UnsupportedError("Cannot resize immutable List."); 22166 throw new UnsupportedError("Cannot resize immutable List.");
21815 } 22167 }
21816 22168
22169 Rect get first {
22170 if (this.length > 0) {
22171 return JS('Rect', '#[0]', this);
22172 }
22173 throw new StateError("No elements");
22174 }
22175
22176 Rect get last {
22177 int len = this.length;
22178 if (len > 0) {
22179 return JS('Rect', '#[#]', this, len - 1);
22180 }
22181 throw new StateError("No elements");
22182 }
22183
22184 Rect get single {
22185 int len = this.length;
22186 if (len == 1) {
22187 return JS('Rect', '#[0]', this);
22188 }
22189 if (len == 0) throw new StateError("No elements");
22190 throw new StateError("More than one element");
22191 }
22192
22193 Rect elementAt(int index) => this[index];
21817 // -- end List<Rect> mixins. 22194 // -- end List<Rect> mixins.
21818 22195
21819 @DomName('ClientRectList.item') 22196 @DomName('ClientRectList.item')
21820 @DocsEditable 22197 @DocsEditable
21821 Rect item(int index) native; 22198 Rect item(int index) native;
21822 } 22199 }
21823 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 22200 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21824 // for details. All rights reserved. Use of this source code is governed by a 22201 // for details. All rights reserved. Use of this source code is governed by a
21825 // BSD-style license that can be found in the LICENSE file. 22202 // BSD-style license that can be found in the LICENSE file.
21826 22203
21827 22204
21828 @DocsEditable 22205 @DocsEditable
21829 @DomName('Counter') 22206 @DomName('Counter')
21830 abstract class _Counter native "Counter" { 22207 abstract class _Counter native "Counter" {
21831 } 22208 }
21832 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 22209 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21833 // for details. All rights reserved. Use of this source code is governed by a 22210 // for details. All rights reserved. Use of this source code is governed by a
21834 // BSD-style license that can be found in the LICENSE file. 22211 // BSD-style license that can be found in the LICENSE file.
21835 22212
21836 22213
21837 @DocsEditable 22214 @DocsEditable
21838 @DomName('CSSRuleList') 22215 @DomName('CSSRuleList')
21839 class _CssRuleList extends Object with ListMixin<CssRule>, ImmutableListMixin<Cs sRule> implements JavaScriptIndexingBehavior, List<CssRule> native "CSSRuleList" { 22216 class _CssRuleList extends Object with ListMixin<CssRule>, ImmutableListMixin<Cs sRule> implements JavaScriptIndexingBehavior, List<CssRule> native "CSSRuleList" {
21840 22217
21841 @DomName('CSSRuleList.length') 22218 @DomName('CSSRuleList.length')
21842 @DocsEditable 22219 @DocsEditable
21843 int get length => JS("int", "#.length", this); 22220 int get length => JS("int", "#.length", this);
21844 22221
21845 CssRule operator[](int index) => JS("CssRule", "#[#]", this, index); 22222 CssRule operator[](int index) {
21846 22223 if (JS("bool", "# >>> 0 !== # || # >= #", index,
22224 index, index, length))
22225 throw new RangeError.range(index, 0, length);
22226 return JS("CssRule", "#[#]", this, index);
22227 }
21847 void operator[]=(int index, CssRule value) { 22228 void operator[]=(int index, CssRule value) {
21848 throw new UnsupportedError("Cannot assign element of immutable List."); 22229 throw new UnsupportedError("Cannot assign element of immutable List.");
21849 } 22230 }
21850 // -- start List<CssRule> mixins. 22231 // -- start List<CssRule> mixins.
21851 // CssRule is the element type. 22232 // CssRule is the element type.
21852 22233
21853 22234
21854 void set length(int value) { 22235 void set length(int value) {
21855 throw new UnsupportedError("Cannot resize immutable List."); 22236 throw new UnsupportedError("Cannot resize immutable List.");
21856 } 22237 }
21857 22238
22239 CssRule get first {
22240 if (this.length > 0) {
22241 return JS('CssRule', '#[0]', this);
22242 }
22243 throw new StateError("No elements");
22244 }
22245
22246 CssRule get last {
22247 int len = this.length;
22248 if (len > 0) {
22249 return JS('CssRule', '#[#]', this, len - 1);
22250 }
22251 throw new StateError("No elements");
22252 }
22253
22254 CssRule get single {
22255 int len = this.length;
22256 if (len == 1) {
22257 return JS('CssRule', '#[0]', this);
22258 }
22259 if (len == 0) throw new StateError("No elements");
22260 throw new StateError("More than one element");
22261 }
22262
22263 CssRule elementAt(int index) => this[index];
21858 // -- end List<CssRule> mixins. 22264 // -- end List<CssRule> mixins.
21859 22265
21860 @DomName('CSSRuleList.item') 22266 @DomName('CSSRuleList.item')
21861 @DocsEditable 22267 @DocsEditable
21862 CssRule item(int index) native; 22268 CssRule item(int index) native;
21863 } 22269 }
21864 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 22270 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21865 // for details. All rights reserved. Use of this source code is governed by a 22271 // for details. All rights reserved. Use of this source code is governed by a
21866 // BSD-style license that can be found in the LICENSE file. 22272 // BSD-style license that can be found in the LICENSE file.
21867 22273
21868 22274
21869 @DocsEditable 22275 @DocsEditable
21870 @DomName('CSSValueList') 22276 @DomName('CSSValueList')
21871 class _CssValueList extends _CSSValue with ListMixin<_CSSValue>, ImmutableListMi xin<_CSSValue> implements JavaScriptIndexingBehavior, List<_CSSValue> native "CS SValueList" { 22277 class _CssValueList extends _CSSValue with ListMixin<_CSSValue>, ImmutableListMi xin<_CSSValue> implements JavaScriptIndexingBehavior, List<_CSSValue> native "CS SValueList" {
21872 22278
21873 @DomName('CSSValueList.length') 22279 @DomName('CSSValueList.length')
21874 @DocsEditable 22280 @DocsEditable
21875 int get length => JS("int", "#.length", this); 22281 int get length => JS("int", "#.length", this);
21876 22282
21877 _CSSValue operator[](int index) => JS("_CSSValue", "#[#]", this, index); 22283 _CSSValue operator[](int index) {
21878 22284 if (JS("bool", "# >>> 0 !== # || # >= #", index,
22285 index, index, length))
22286 throw new RangeError.range(index, 0, length);
22287 return JS("_CSSValue", "#[#]", this, index);
22288 }
21879 void operator[]=(int index, _CSSValue value) { 22289 void operator[]=(int index, _CSSValue value) {
21880 throw new UnsupportedError("Cannot assign element of immutable List."); 22290 throw new UnsupportedError("Cannot assign element of immutable List.");
21881 } 22291 }
21882 // -- start List<_CSSValue> mixins. 22292 // -- start List<_CSSValue> mixins.
21883 // _CSSValue is the element type. 22293 // _CSSValue is the element type.
21884 22294
21885 22295
21886 void set length(int value) { 22296 void set length(int value) {
21887 throw new UnsupportedError("Cannot resize immutable List."); 22297 throw new UnsupportedError("Cannot resize immutable List.");
21888 } 22298 }
21889 22299
22300 _CSSValue get first {
22301 if (this.length > 0) {
22302 return JS('_CSSValue', '#[0]', this);
22303 }
22304 throw new StateError("No elements");
22305 }
22306
22307 _CSSValue get last {
22308 int len = this.length;
22309 if (len > 0) {
22310 return JS('_CSSValue', '#[#]', this, len - 1);
22311 }
22312 throw new StateError("No elements");
22313 }
22314
22315 _CSSValue get single {
22316 int len = this.length;
22317 if (len == 1) {
22318 return JS('_CSSValue', '#[0]', this);
22319 }
22320 if (len == 0) throw new StateError("No elements");
22321 throw new StateError("More than one element");
22322 }
22323
22324 _CSSValue elementAt(int index) => this[index];
21890 // -- end List<_CSSValue> mixins. 22325 // -- end List<_CSSValue> mixins.
21891 22326
21892 @DomName('CSSValueList.item') 22327 @DomName('CSSValueList.item')
21893 @DocsEditable 22328 @DocsEditable
21894 _CSSValue item(int index) native; 22329 _CSSValue item(int index) native;
21895 } 22330 }
21896 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 22331 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
21897 // for details. All rights reserved. Use of this source code is governed by a 22332 // for details. All rights reserved. Use of this source code is governed by a
21898 // BSD-style license that can be found in the LICENSE file. 22333 // BSD-style license that can be found in the LICENSE file.
21899 22334
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
21988 22423
21989 22424
21990 @DocsEditable 22425 @DocsEditable
21991 @DomName('EntryArray') 22426 @DomName('EntryArray')
21992 class _EntryArray extends Object with ListMixin<Entry>, ImmutableListMixin<Entry > implements JavaScriptIndexingBehavior, List<Entry> native "EntryArray" { 22427 class _EntryArray extends Object with ListMixin<Entry>, ImmutableListMixin<Entry > implements JavaScriptIndexingBehavior, List<Entry> native "EntryArray" {
21993 22428
21994 @DomName('EntryArray.length') 22429 @DomName('EntryArray.length')
21995 @DocsEditable 22430 @DocsEditable
21996 int get length => JS("int", "#.length", this); 22431 int get length => JS("int", "#.length", this);
21997 22432
21998 Entry operator[](int index) => JS("Entry", "#[#]", this, index); 22433 Entry operator[](int index) {
21999 22434 if (JS("bool", "# >>> 0 !== # || # >= #", index,
22435 index, index, length))
22436 throw new RangeError.range(index, 0, length);
22437 return JS("Entry", "#[#]", this, index);
22438 }
22000 void operator[]=(int index, Entry value) { 22439 void operator[]=(int index, Entry value) {
22001 throw new UnsupportedError("Cannot assign element of immutable List."); 22440 throw new UnsupportedError("Cannot assign element of immutable List.");
22002 } 22441 }
22003 // -- start List<Entry> mixins. 22442 // -- start List<Entry> mixins.
22004 // Entry is the element type. 22443 // Entry is the element type.
22005 22444
22006 22445
22007 void set length(int value) { 22446 void set length(int value) {
22008 throw new UnsupportedError("Cannot resize immutable List."); 22447 throw new UnsupportedError("Cannot resize immutable List.");
22009 } 22448 }
22010 22449
22450 Entry get first {
22451 if (this.length > 0) {
22452 return JS('Entry', '#[0]', this);
22453 }
22454 throw new StateError("No elements");
22455 }
22456
22457 Entry get last {
22458 int len = this.length;
22459 if (len > 0) {
22460 return JS('Entry', '#[#]', this, len - 1);
22461 }
22462 throw new StateError("No elements");
22463 }
22464
22465 Entry get single {
22466 int len = this.length;
22467 if (len == 1) {
22468 return JS('Entry', '#[0]', this);
22469 }
22470 if (len == 0) throw new StateError("No elements");
22471 throw new StateError("More than one element");
22472 }
22473
22474 Entry elementAt(int index) => this[index];
22011 // -- end List<Entry> mixins. 22475 // -- end List<Entry> mixins.
22012 22476
22013 @DomName('EntryArray.item') 22477 @DomName('EntryArray.item')
22014 @DocsEditable 22478 @DocsEditable
22015 Entry item(int index) native; 22479 Entry item(int index) native;
22016 } 22480 }
22017 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 22481 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22018 // for details. All rights reserved. Use of this source code is governed by a 22482 // for details. All rights reserved. Use of this source code is governed by a
22019 // BSD-style license that can be found in the LICENSE file. 22483 // BSD-style license that can be found in the LICENSE file.
22020 22484
22021 22485
22022 @DocsEditable 22486 @DocsEditable
22023 @DomName('EntryArraySync') 22487 @DomName('EntryArraySync')
22024 class _EntryArraySync extends Object with ListMixin<_EntrySync>, ImmutableListMi xin<_EntrySync> implements JavaScriptIndexingBehavior, List<_EntrySync> native " EntryArraySync" { 22488 class _EntryArraySync extends Object with ListMixin<_EntrySync>, ImmutableListMi xin<_EntrySync> implements JavaScriptIndexingBehavior, List<_EntrySync> native " EntryArraySync" {
22025 22489
22026 @DomName('EntryArraySync.length') 22490 @DomName('EntryArraySync.length')
22027 @DocsEditable 22491 @DocsEditable
22028 int get length => JS("int", "#.length", this); 22492 int get length => JS("int", "#.length", this);
22029 22493
22030 _EntrySync operator[](int index) => JS("_EntrySync", "#[#]", this, index); 22494 _EntrySync operator[](int index) {
22031 22495 if (JS("bool", "# >>> 0 !== # || # >= #", index,
22496 index, index, length))
22497 throw new RangeError.range(index, 0, length);
22498 return JS("_EntrySync", "#[#]", this, index);
22499 }
22032 void operator[]=(int index, _EntrySync value) { 22500 void operator[]=(int index, _EntrySync value) {
22033 throw new UnsupportedError("Cannot assign element of immutable List."); 22501 throw new UnsupportedError("Cannot assign element of immutable List.");
22034 } 22502 }
22035 // -- start List<_EntrySync> mixins. 22503 // -- start List<_EntrySync> mixins.
22036 // _EntrySync is the element type. 22504 // _EntrySync is the element type.
22037 22505
22038 22506
22039 void set length(int value) { 22507 void set length(int value) {
22040 throw new UnsupportedError("Cannot resize immutable List."); 22508 throw new UnsupportedError("Cannot resize immutable List.");
22041 } 22509 }
22042 22510
22511 _EntrySync get first {
22512 if (this.length > 0) {
22513 return JS('_EntrySync', '#[0]', this);
22514 }
22515 throw new StateError("No elements");
22516 }
22517
22518 _EntrySync get last {
22519 int len = this.length;
22520 if (len > 0) {
22521 return JS('_EntrySync', '#[#]', this, len - 1);
22522 }
22523 throw new StateError("No elements");
22524 }
22525
22526 _EntrySync get single {
22527 int len = this.length;
22528 if (len == 1) {
22529 return JS('_EntrySync', '#[0]', this);
22530 }
22531 if (len == 0) throw new StateError("No elements");
22532 throw new StateError("More than one element");
22533 }
22534
22535 _EntrySync elementAt(int index) => this[index];
22043 // -- end List<_EntrySync> mixins. 22536 // -- end List<_EntrySync> mixins.
22044 22537
22045 @DomName('EntryArraySync.item') 22538 @DomName('EntryArraySync.item')
22046 @DocsEditable 22539 @DocsEditable
22047 _EntrySync item(int index) native; 22540 _EntrySync item(int index) native;
22048 } 22541 }
22049 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 22542 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22050 // for details. All rights reserved. Use of this source code is governed by a 22543 // for details. All rights reserved. Use of this source code is governed by a
22051 // BSD-style license that can be found in the LICENSE file. 22544 // BSD-style license that can be found in the LICENSE file.
22052 22545
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
22095 22588
22096 22589
22097 @DocsEditable 22590 @DocsEditable
22098 @DomName('GamepadList') 22591 @DomName('GamepadList')
22099 class _GamepadList extends Object with ListMixin<Gamepad>, ImmutableListMixin<Ga mepad> implements JavaScriptIndexingBehavior, List<Gamepad> native "GamepadList" { 22592 class _GamepadList extends Object with ListMixin<Gamepad>, ImmutableListMixin<Ga mepad> implements JavaScriptIndexingBehavior, List<Gamepad> native "GamepadList" {
22100 22593
22101 @DomName('GamepadList.length') 22594 @DomName('GamepadList.length')
22102 @DocsEditable 22595 @DocsEditable
22103 int get length => JS("int", "#.length", this); 22596 int get length => JS("int", "#.length", this);
22104 22597
22105 Gamepad operator[](int index) => JS("Gamepad", "#[#]", this, index); 22598 Gamepad operator[](int index) {
22106 22599 if (JS("bool", "# >>> 0 !== # || # >= #", index,
22600 index, index, length))
22601 throw new RangeError.range(index, 0, length);
22602 return JS("Gamepad", "#[#]", this, index);
22603 }
22107 void operator[]=(int index, Gamepad value) { 22604 void operator[]=(int index, Gamepad value) {
22108 throw new UnsupportedError("Cannot assign element of immutable List."); 22605 throw new UnsupportedError("Cannot assign element of immutable List.");
22109 } 22606 }
22110 // -- start List<Gamepad> mixins. 22607 // -- start List<Gamepad> mixins.
22111 // Gamepad is the element type. 22608 // Gamepad is the element type.
22112 22609
22113 22610
22114 void set length(int value) { 22611 void set length(int value) {
22115 throw new UnsupportedError("Cannot resize immutable List."); 22612 throw new UnsupportedError("Cannot resize immutable List.");
22116 } 22613 }
22117 22614
22615 Gamepad get first {
22616 if (this.length > 0) {
22617 return JS('Gamepad', '#[0]', this);
22618 }
22619 throw new StateError("No elements");
22620 }
22621
22622 Gamepad get last {
22623 int len = this.length;
22624 if (len > 0) {
22625 return JS('Gamepad', '#[#]', this, len - 1);
22626 }
22627 throw new StateError("No elements");
22628 }
22629
22630 Gamepad get single {
22631 int len = this.length;
22632 if (len == 1) {
22633 return JS('Gamepad', '#[0]', this);
22634 }
22635 if (len == 0) throw new StateError("No elements");
22636 throw new StateError("More than one element");
22637 }
22638
22639 Gamepad elementAt(int index) => this[index];
22118 // -- end List<Gamepad> mixins. 22640 // -- end List<Gamepad> mixins.
22119 22641
22120 @DomName('GamepadList.item') 22642 @DomName('GamepadList.item')
22121 @DocsEditable 22643 @DocsEditable
22122 Gamepad item(int index) native; 22644 Gamepad item(int index) native;
22123 } 22645 }
22124 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 22646 // 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 22647 // 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. 22648 // BSD-style license that can be found in the LICENSE file.
22127 22649
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
22190 22712
22191 22713
22192 @DocsEditable 22714 @DocsEditable
22193 @DomName('NamedNodeMap') 22715 @DomName('NamedNodeMap')
22194 class _NamedNodeMap extends Object with ListMixin<Node>, ImmutableListMixin<Node > implements JavaScriptIndexingBehavior, List<Node> native "NamedNodeMap" { 22716 class _NamedNodeMap extends Object with ListMixin<Node>, ImmutableListMixin<Node > implements JavaScriptIndexingBehavior, List<Node> native "NamedNodeMap" {
22195 22717
22196 @DomName('NamedNodeMap.length') 22718 @DomName('NamedNodeMap.length')
22197 @DocsEditable 22719 @DocsEditable
22198 int get length => JS("int", "#.length", this); 22720 int get length => JS("int", "#.length", this);
22199 22721
22200 Node operator[](int index) => JS("Node", "#[#]", this, index); 22722 Node operator[](int index) {
22201 22723 if (JS("bool", "# >>> 0 !== # || # >= #", index,
22724 index, index, length))
22725 throw new RangeError.range(index, 0, length);
22726 return JS("Node", "#[#]", this, index);
22727 }
22202 void operator[]=(int index, Node value) { 22728 void operator[]=(int index, Node value) {
22203 throw new UnsupportedError("Cannot assign element of immutable List."); 22729 throw new UnsupportedError("Cannot assign element of immutable List.");
22204 } 22730 }
22205 // -- start List<Node> mixins. 22731 // -- start List<Node> mixins.
22206 // Node is the element type. 22732 // Node is the element type.
22207 22733
22208 22734
22209 void set length(int value) { 22735 void set length(int value) {
22210 throw new UnsupportedError("Cannot resize immutable List."); 22736 throw new UnsupportedError("Cannot resize immutable List.");
22211 } 22737 }
22212 22738
22739 Node get first {
22740 if (this.length > 0) {
22741 return JS('Node', '#[0]', this);
22742 }
22743 throw new StateError("No elements");
22744 }
22745
22746 Node get last {
22747 int len = this.length;
22748 if (len > 0) {
22749 return JS('Node', '#[#]', this, len - 1);
22750 }
22751 throw new StateError("No elements");
22752 }
22753
22754 Node get single {
22755 int len = this.length;
22756 if (len == 1) {
22757 return JS('Node', '#[0]', this);
22758 }
22759 if (len == 0) throw new StateError("No elements");
22760 throw new StateError("More than one element");
22761 }
22762
22763 Node elementAt(int index) => this[index];
22213 // -- end List<Node> mixins. 22764 // -- end List<Node> mixins.
22214 22765
22215 @DomName('NamedNodeMap.getNamedItem') 22766 @DomName('NamedNodeMap.getNamedItem')
22216 @DocsEditable 22767 @DocsEditable
22217 Node getNamedItem(String name) native; 22768 Node getNamedItem(String name) native;
22218 22769
22219 @DomName('NamedNodeMap.getNamedItemNS') 22770 @DomName('NamedNodeMap.getNamedItemNS')
22220 @DocsEditable 22771 @DocsEditable
22221 Node getNamedItemNS(String namespaceURI, String localName) native; 22772 Node getNamedItemNS(String namespaceURI, String localName) native;
22222 22773
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
22311 22862
22312 22863
22313 @DocsEditable 22864 @DocsEditable
22314 @DomName('SpeechInputResultList') 22865 @DomName('SpeechInputResultList')
22315 class _SpeechInputResultList extends Object with ListMixin<SpeechInputResult>, I mmutableListMixin<SpeechInputResult> implements JavaScriptIndexingBehavior, List <SpeechInputResult> native "SpeechInputResultList" { 22866 class _SpeechInputResultList extends Object with ListMixin<SpeechInputResult>, I mmutableListMixin<SpeechInputResult> implements JavaScriptIndexingBehavior, List <SpeechInputResult> native "SpeechInputResultList" {
22316 22867
22317 @DomName('SpeechInputResultList.length') 22868 @DomName('SpeechInputResultList.length')
22318 @DocsEditable 22869 @DocsEditable
22319 int get length => JS("int", "#.length", this); 22870 int get length => JS("int", "#.length", this);
22320 22871
22321 SpeechInputResult operator[](int index) => JS("SpeechInputResult", "#[#]", thi s, index); 22872 SpeechInputResult operator[](int index) {
22322 22873 if (JS("bool", "# >>> 0 !== # || # >= #", index,
22874 index, index, length))
22875 throw new RangeError.range(index, 0, length);
22876 return JS("SpeechInputResult", "#[#]", this, index);
22877 }
22323 void operator[]=(int index, SpeechInputResult value) { 22878 void operator[]=(int index, SpeechInputResult value) {
22324 throw new UnsupportedError("Cannot assign element of immutable List."); 22879 throw new UnsupportedError("Cannot assign element of immutable List.");
22325 } 22880 }
22326 // -- start List<SpeechInputResult> mixins. 22881 // -- start List<SpeechInputResult> mixins.
22327 // SpeechInputResult is the element type. 22882 // SpeechInputResult is the element type.
22328 22883
22329 22884
22330 void set length(int value) { 22885 void set length(int value) {
22331 throw new UnsupportedError("Cannot resize immutable List."); 22886 throw new UnsupportedError("Cannot resize immutable List.");
22332 } 22887 }
22333 22888
22889 SpeechInputResult get first {
22890 if (this.length > 0) {
22891 return JS('SpeechInputResult', '#[0]', this);
22892 }
22893 throw new StateError("No elements");
22894 }
22895
22896 SpeechInputResult get last {
22897 int len = this.length;
22898 if (len > 0) {
22899 return JS('SpeechInputResult', '#[#]', this, len - 1);
22900 }
22901 throw new StateError("No elements");
22902 }
22903
22904 SpeechInputResult get single {
22905 int len = this.length;
22906 if (len == 1) {
22907 return JS('SpeechInputResult', '#[0]', this);
22908 }
22909 if (len == 0) throw new StateError("No elements");
22910 throw new StateError("More than one element");
22911 }
22912
22913 SpeechInputResult elementAt(int index) => this[index];
22334 // -- end List<SpeechInputResult> mixins. 22914 // -- end List<SpeechInputResult> mixins.
22335 22915
22336 @DomName('SpeechInputResultList.item') 22916 @DomName('SpeechInputResultList.item')
22337 @DocsEditable 22917 @DocsEditable
22338 SpeechInputResult item(int index) native; 22918 SpeechInputResult item(int index) native;
22339 } 22919 }
22340 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 22920 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22341 // for details. All rights reserved. Use of this source code is governed by a 22921 // for details. All rights reserved. Use of this source code is governed by a
22342 // BSD-style license that can be found in the LICENSE file. 22922 // BSD-style license that can be found in the LICENSE file.
22343 22923
22344 22924
22345 @DocsEditable 22925 @DocsEditable
22346 @DomName('SpeechRecognitionResultList') 22926 @DomName('SpeechRecognitionResultList')
22347 class _SpeechRecognitionResultList extends Object with ListMixin<SpeechRecogniti onResult>, ImmutableListMixin<SpeechRecognitionResult> implements JavaScriptInde xingBehavior, List<SpeechRecognitionResult> native "SpeechRecognitionResultList" { 22927 class _SpeechRecognitionResultList extends Object with ListMixin<SpeechRecogniti onResult>, ImmutableListMixin<SpeechRecognitionResult> implements JavaScriptInde xingBehavior, List<SpeechRecognitionResult> native "SpeechRecognitionResultList" {
22348 22928
22349 @DomName('SpeechRecognitionResultList.length') 22929 @DomName('SpeechRecognitionResultList.length')
22350 @DocsEditable 22930 @DocsEditable
22351 int get length => JS("int", "#.length", this); 22931 int get length => JS("int", "#.length", this);
22352 22932
22353 SpeechRecognitionResult operator[](int index) => JS("SpeechRecognitionResult", "#[#]", this, index); 22933 SpeechRecognitionResult operator[](int index) {
22354 22934 if (JS("bool", "# >>> 0 !== # || # >= #", index,
22935 index, index, length))
22936 throw new RangeError.range(index, 0, length);
22937 return JS("SpeechRecognitionResult", "#[#]", this, index);
22938 }
22355 void operator[]=(int index, SpeechRecognitionResult value) { 22939 void operator[]=(int index, SpeechRecognitionResult value) {
22356 throw new UnsupportedError("Cannot assign element of immutable List."); 22940 throw new UnsupportedError("Cannot assign element of immutable List.");
22357 } 22941 }
22358 // -- start List<SpeechRecognitionResult> mixins. 22942 // -- start List<SpeechRecognitionResult> mixins.
22359 // SpeechRecognitionResult is the element type. 22943 // SpeechRecognitionResult is the element type.
22360 22944
22361 22945
22362 void set length(int value) { 22946 void set length(int value) {
22363 throw new UnsupportedError("Cannot resize immutable List."); 22947 throw new UnsupportedError("Cannot resize immutable List.");
22364 } 22948 }
22365 22949
22950 SpeechRecognitionResult get first {
22951 if (this.length > 0) {
22952 return JS('SpeechRecognitionResult', '#[0]', this);
22953 }
22954 throw new StateError("No elements");
22955 }
22956
22957 SpeechRecognitionResult get last {
22958 int len = this.length;
22959 if (len > 0) {
22960 return JS('SpeechRecognitionResult', '#[#]', this, len - 1);
22961 }
22962 throw new StateError("No elements");
22963 }
22964
22965 SpeechRecognitionResult get single {
22966 int len = this.length;
22967 if (len == 1) {
22968 return JS('SpeechRecognitionResult', '#[0]', this);
22969 }
22970 if (len == 0) throw new StateError("No elements");
22971 throw new StateError("More than one element");
22972 }
22973
22974 SpeechRecognitionResult elementAt(int index) => this[index];
22366 // -- end List<SpeechRecognitionResult> mixins. 22975 // -- end List<SpeechRecognitionResult> mixins.
22367 22976
22368 @DomName('SpeechRecognitionResultList.item') 22977 @DomName('SpeechRecognitionResultList.item')
22369 @DocsEditable 22978 @DocsEditable
22370 SpeechRecognitionResult item(int index) native; 22979 SpeechRecognitionResult item(int index) native;
22371 } 22980 }
22372 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 22981 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22373 // for details. All rights reserved. Use of this source code is governed by a 22982 // for details. All rights reserved. Use of this source code is governed by a
22374 // BSD-style license that can be found in the LICENSE file. 22983 // BSD-style license that can be found in the LICENSE file.
22375 22984
22376 22985
22377 @DocsEditable 22986 @DocsEditable
22378 @DomName('StyleSheetList') 22987 @DomName('StyleSheetList')
22379 class _StyleSheetList extends Object with ListMixin<StyleSheet>, ImmutableListMi xin<StyleSheet> implements JavaScriptIndexingBehavior, List<StyleSheet> native " StyleSheetList" { 22988 class _StyleSheetList extends Object with ListMixin<StyleSheet>, ImmutableListMi xin<StyleSheet> implements JavaScriptIndexingBehavior, List<StyleSheet> native " StyleSheetList" {
22380 22989
22381 @DomName('StyleSheetList.length') 22990 @DomName('StyleSheetList.length')
22382 @DocsEditable 22991 @DocsEditable
22383 int get length => JS("int", "#.length", this); 22992 int get length => JS("int", "#.length", this);
22384 22993
22385 StyleSheet operator[](int index) => JS("StyleSheet", "#[#]", this, index); 22994 StyleSheet operator[](int index) {
22386 22995 if (JS("bool", "# >>> 0 !== # || # >= #", index,
22996 index, index, length))
22997 throw new RangeError.range(index, 0, length);
22998 return JS("StyleSheet", "#[#]", this, index);
22999 }
22387 void operator[]=(int index, StyleSheet value) { 23000 void operator[]=(int index, StyleSheet value) {
22388 throw new UnsupportedError("Cannot assign element of immutable List."); 23001 throw new UnsupportedError("Cannot assign element of immutable List.");
22389 } 23002 }
22390 // -- start List<StyleSheet> mixins. 23003 // -- start List<StyleSheet> mixins.
22391 // StyleSheet is the element type. 23004 // StyleSheet is the element type.
22392 23005
22393 23006
22394 void set length(int value) { 23007 void set length(int value) {
22395 throw new UnsupportedError("Cannot resize immutable List."); 23008 throw new UnsupportedError("Cannot resize immutable List.");
22396 } 23009 }
22397 23010
23011 StyleSheet get first {
23012 if (this.length > 0) {
23013 return JS('StyleSheet', '#[0]', this);
23014 }
23015 throw new StateError("No elements");
23016 }
23017
23018 StyleSheet get last {
23019 int len = this.length;
23020 if (len > 0) {
23021 return JS('StyleSheet', '#[#]', this, len - 1);
23022 }
23023 throw new StateError("No elements");
23024 }
23025
23026 StyleSheet get single {
23027 int len = this.length;
23028 if (len == 1) {
23029 return JS('StyleSheet', '#[0]', this);
23030 }
23031 if (len == 0) throw new StateError("No elements");
23032 throw new StateError("More than one element");
23033 }
23034
23035 StyleSheet elementAt(int index) => this[index];
22398 // -- end List<StyleSheet> mixins. 23036 // -- end List<StyleSheet> mixins.
22399 23037
22400 @DomName('StyleSheetList.item') 23038 @DomName('StyleSheetList.item')
22401 @DocsEditable 23039 @DocsEditable
22402 StyleSheet item(int index) native; 23040 StyleSheet item(int index) native;
22403 } 23041 }
22404 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 23042 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
22405 // for details. All rights reserved. Use of this source code is governed by a 23043 // for details. All rights reserved. Use of this source code is governed by a
22406 // BSD-style license that can be found in the LICENSE file. 23044 // BSD-style license that can be found in the LICENSE file.
22407 23045
(...skipping 4527 matching lines...) Expand 10 before | Expand all | Expand 10 after
26935 _position = nextPosition; 27573 _position = nextPosition;
26936 return true; 27574 return true;
26937 } 27575 }
26938 _current = null; 27576 _current = null;
26939 _position = _array.length; 27577 _position = _array.length;
26940 return false; 27578 return false;
26941 } 27579 }
26942 27580
26943 T get current => _current; 27581 T get current => _current;
26944 } 27582 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/html/dartium/html_dartium.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698