| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 part of html; | 5 part of html; |
| 6 | 6 |
| 7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated | 7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated |
| 8 // functionality. | 8 // functionality. |
| 9 class _ChildrenElementList implements List { | 9 class _ChildrenElementList implements List { |
| 10 // Raw Element. | 10 // Raw Element. |
| (...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 return _Collections.minInList(this, compare); | 381 return _Collections.minInList(this, compare); |
| 382 } | 382 } |
| 383 | 383 |
| 384 Element max([int compare(Element a, Element b)]) { | 384 Element max([int compare(Element a, Element b)]) { |
| 385 return _Collections.maxInList(this, compare); | 385 return _Collections.maxInList(this, compare); |
| 386 } | 386 } |
| 387 } | 387 } |
| 388 | 388 |
| 389 class _FrozenElementListIterator implements Iterator<Element> { | 389 class _FrozenElementListIterator implements Iterator<Element> { |
| 390 final _FrozenElementList _list; | 390 final _FrozenElementList _list; |
| 391 int _index = 0; | 391 int _index = -1; |
| 392 Element _current; | 392 Element _current; |
| 393 | 393 |
| 394 _FrozenElementListIterator(this._list); | 394 _FrozenElementListIterator(this._list); |
| 395 | 395 |
| 396 /** | 396 /** |
| 397 * Moves to the next element. Returns true if the iterator is positioned | 397 * Moves to the next element. Returns true if the iterator is positioned |
| 398 * at an element. Returns false if it is positioned after the last element. | 398 * at an element. Returns false if it is positioned after the last element. |
| 399 */ | 399 */ |
| 400 bool moveNext() { | 400 bool moveNext() { |
| 401 int nextIndex = _index + 1; | 401 int nextIndex = _index + 1; |
| (...skipping 479 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 $if DART2JS | 881 $if DART2JS |
| 882 // Optimization to improve performance until the dart2js compiler inlines this | 882 // Optimization to improve performance until the dart2js compiler inlines this |
| 883 // method. | 883 // method. |
| 884 static dynamic createElement_tag(String tag) => | 884 static dynamic createElement_tag(String tag) => |
| 885 JS('Element', 'document.createElement(#)', tag); | 885 JS('Element', 'document.createElement(#)', tag); |
| 886 $else | 886 $else |
| 887 static Element createElement_tag(String tag) => | 887 static Element createElement_tag(String tag) => |
| 888 document.$dom_createElement(tag); | 888 document.$dom_createElement(tag); |
| 889 $endif | 889 $endif |
| 890 } | 890 } |
| OLD | NEW |