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

Side by Side Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 12089023: Don't use ReversedListView from outside core and collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 10 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
OLDNEW
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
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);
Lasse Reichstein Nielsen 2013/01/29 08:11:22 html library imports collections-dev.
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
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698