| 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 $LIBRARYNAME; | 5 part of $LIBRARYNAME; |
| 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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 Element addLast(Element value) => add(value); | 138 Element addLast(Element value) => add(value); |
| 139 | 139 |
| 140 Iterator<Element> get iterator => toList().iterator; | 140 Iterator<Element> get iterator => toList().iterator; |
| 141 | 141 |
| 142 void addAll(Iterable<Element> iterable) { | 142 void addAll(Iterable<Element> iterable) { |
| 143 for (Element element in iterable) { | 143 for (Element element in iterable) { |
| 144 _element.$dom_appendChild(element); | 144 _element.$dom_appendChild(element); |
| 145 } | 145 } |
| 146 } | 146 } |
| 147 | 147 |
| 148 List<Element> get reversed { | 148 Iterable<Element> get reversed { |
| 149 return IterableMixinWorkaround.reversedList(this); | 149 return IterableMixinWorkaround.reversedList(this); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void sort([int compare(Element a, Element b)]) { | 152 void sort([int compare(Element a, Element b)]) { |
| 153 throw new UnsupportedError('TODO(jacobr): should we impl?'); | 153 throw new UnsupportedError('TODO(jacobr): should we impl?'); |
| 154 } | 154 } |
| 155 | 155 |
| 156 dynamic reduce(dynamic initialValue, | 156 dynamic reduce(dynamic initialValue, |
| 157 dynamic combine(dynamic previousValue, Element element)) { | 157 dynamic combine(dynamic previousValue, Element element)) { |
| 158 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 158 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| (...skipping 213 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 372 void addLast(Element value) { | 372 void addLast(Element value) { |
| 373 throw new UnsupportedError(''); | 373 throw new UnsupportedError(''); |
| 374 } | 374 } |
| 375 | 375 |
| 376 Iterator<Element> get iterator => new _FrozenElementListIterator(this); | 376 Iterator<Element> get iterator => new _FrozenElementListIterator(this); |
| 377 | 377 |
| 378 void addAll(Iterable<Element> iterable) { | 378 void addAll(Iterable<Element> iterable) { |
| 379 throw new UnsupportedError(''); | 379 throw new UnsupportedError(''); |
| 380 } | 380 } |
| 381 | 381 |
| 382 List<Element> get reversed { | 382 Iterable<Element> get reversed { |
| 383 return IterableMixinWorkaround.reversedList(this); | 383 return IterableMixinWorkaround.reversedList(this); |
| 384 } | 384 } |
| 385 | 385 |
| 386 void sort([int compare(Element a, Element b)]) { | 386 void sort([int compare(Element a, Element b)]) { |
| 387 throw new UnsupportedError(''); | 387 throw new UnsupportedError(''); |
| 388 } | 388 } |
| 389 | 389 |
| 390 dynamic reduce(dynamic initialValue, | 390 dynamic reduce(dynamic initialValue, |
| 391 dynamic combine(dynamic previousValue, Element element)) { | 391 dynamic combine(dynamic previousValue, Element element)) { |
| 392 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 392 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| (...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 // Optimization to improve performance until the dart2js compiler inlines this | 1057 // Optimization to improve performance until the dart2js compiler inlines this |
| 1058 // method. | 1058 // method. |
| 1059 static dynamic createElement_tag(String tag) => | 1059 static dynamic createElement_tag(String tag) => |
| 1060 // Firefox may return a JS function for some types (Embed, Object). | 1060 // Firefox may return a JS function for some types (Embed, Object). |
| 1061 JS('Element|=Object', 'document.createElement(#)', tag); | 1061 JS('Element|=Object', 'document.createElement(#)', tag); |
| 1062 $else | 1062 $else |
| 1063 static Element createElement_tag(String tag) => | 1063 static Element createElement_tag(String tag) => |
| 1064 document.$dom_createElement(tag); | 1064 document.$dom_createElement(tag); |
| 1065 $endif | 1065 $endif |
| 1066 } | 1066 } |
| OLD | NEW |