| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 Element addLast(Element value) => add(value); | 130 Element addLast(Element value) => add(value); |
| 131 | 131 |
| 132 Iterator<Element> get iterator => toList().iterator; | 132 Iterator<Element> get iterator => toList().iterator; |
| 133 | 133 |
| 134 void addAll(Iterable<Element> iterable) { | 134 void addAll(Iterable<Element> iterable) { |
| 135 for (Element element in iterable) { | 135 for (Element element in iterable) { |
| 136 _element.$dom_appendChild(element); | 136 _element.$dom_appendChild(element); |
| 137 } | 137 } |
| 138 } | 138 } |
| 139 | 139 |
| 140 List<Element> get reversed => | 140 List<Element> get reversed { |
| 141 new ReversedListView<Element>(this, 0, null); | 141 return IterableMixinWorkaround.reversedList(this); |
| 142 } |
| 142 | 143 |
| 143 void sort([int compare(Element a, Element b)]) { | 144 void sort([int compare(Element a, Element b)]) { |
| 144 throw new UnsupportedError('TODO(jacobr): should we impl?'); | 145 throw new UnsupportedError('TODO(jacobr): should we impl?'); |
| 145 } | 146 } |
| 146 | 147 |
| 147 dynamic reduce(dynamic initialValue, | 148 dynamic reduce(dynamic initialValue, |
| 148 dynamic combine(dynamic previousValue, Element element)) { | 149 dynamic combine(dynamic previousValue, Element element)) { |
| 149 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 150 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| 150 } | 151 } |
| 151 | 152 |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 void addLast(Element value) { | 356 void addLast(Element value) { |
| 356 throw new UnsupportedError(''); | 357 throw new UnsupportedError(''); |
| 357 } | 358 } |
| 358 | 359 |
| 359 Iterator<Element> get iterator => new _FrozenElementListIterator(this); | 360 Iterator<Element> get iterator => new _FrozenElementListIterator(this); |
| 360 | 361 |
| 361 void addAll(Iterable<Element> iterable) { | 362 void addAll(Iterable<Element> iterable) { |
| 362 throw new UnsupportedError(''); | 363 throw new UnsupportedError(''); |
| 363 } | 364 } |
| 364 | 365 |
| 365 List<Element> get reversed => | 366 List<Element> get reversed { |
| 366 new ReversedListView<Element>(this, 0, null); | 367 return IterableMixinWorkaround.reversedList(this); |
| 368 } |
| 367 | 369 |
| 368 void sort([int compare(Element a, Element b)]) { | 370 void sort([int compare(Element a, Element b)]) { |
| 369 throw new UnsupportedError(''); | 371 throw new UnsupportedError(''); |
| 370 } | 372 } |
| 371 | 373 |
| 372 dynamic reduce(dynamic initialValue, | 374 dynamic reduce(dynamic initialValue, |
| 373 dynamic combine(dynamic previousValue, Element element)) { | 375 dynamic combine(dynamic previousValue, Element element)) { |
| 374 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 376 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| 375 } | 377 } |
| 376 | 378 |
| (...skipping 661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1038 $if DART2JS | 1040 $if DART2JS |
| 1039 // Optimization to improve performance until the dart2js compiler inlines this | 1041 // Optimization to improve performance until the dart2js compiler inlines this |
| 1040 // method. | 1042 // method. |
| 1041 static dynamic createElement_tag(String tag) => | 1043 static dynamic createElement_tag(String tag) => |
| 1042 JS('Element', 'document.createElement(#)', tag); | 1044 JS('Element', 'document.createElement(#)', tag); |
| 1043 $else | 1045 $else |
| 1044 static Element createElement_tag(String tag) => | 1046 static Element createElement_tag(String tag) => |
| 1045 document.$dom_createElement(tag); | 1047 document.$dom_createElement(tag); |
| 1046 $endif | 1048 $endif |
| 1047 } | 1049 } |
| OLD | NEW |