| 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 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 } | 58 } |
| 59 | 59 |
| 60 String join([String separator]) { | 60 String join([String separator]) { |
| 61 return IterableMixinWorkaround.joinList(this, separator); | 61 return IterableMixinWorkaround.joinList(this, separator); |
| 62 } | 62 } |
| 63 | 63 |
| 64 Iterable map(f(Element element)) { | 64 Iterable map(f(Element element)) { |
| 65 return IterableMixinWorkaround.mapList(this, f); | 65 return IterableMixinWorkaround.mapList(this, f); |
| 66 } | 66 } |
| 67 | 67 |
| 68 List mappedBy(f(Element element)) { | |
| 69 return IterableMixinWorkaround.mappedByList(this, f); | |
| 70 } | |
| 71 | |
| 72 Iterable<Element> where(bool f(Element element)) { | 68 Iterable<Element> where(bool f(Element element)) { |
| 73 return IterableMixinWorkaround.where(this, f); | 69 return IterableMixinWorkaround.where(this, f); |
| 74 } | 70 } |
| 75 | 71 |
| 76 Iterable expand(Iterable f(Element element)) { | 72 Iterable expand(Iterable f(Element element)) { |
| 77 return IterableMixinWorkaround.expand(this, f); | 73 return IterableMixinWorkaround.expand(this, f); |
| 78 } | 74 } |
| 79 | 75 |
| 80 bool get isEmpty { | 76 bool get isEmpty { |
| 81 return _element.$dom_firstElementChild == null; | 77 return _element.$dom_firstElementChild == null; |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 void addAll(Iterable<Element> iterable) { | 138 void addAll(Iterable<Element> iterable) { |
| 143 if (iterable is _ChildNodeListLazy) { | 139 if (iterable is _ChildNodeListLazy) { |
| 144 iterable = new List.from(iterable); | 140 iterable = new List.from(iterable); |
| 145 } | 141 } |
| 146 | 142 |
| 147 for (Element element in iterable) { | 143 for (Element element in iterable) { |
| 148 _element.$dom_appendChild(element); | 144 _element.$dom_appendChild(element); |
| 149 } | 145 } |
| 150 } | 146 } |
| 151 | 147 |
| 152 List<Element> get reversed { | 148 Iterable<Element> get reversed { |
| 153 return IterableMixinWorkaround.reversedList(this); | 149 return IterableMixinWorkaround.reversedList(this); |
| 154 } | 150 } |
| 155 | 151 |
| 156 void sort([int compare(Element a, Element b)]) { | 152 void sort([int compare(Element a, Element b)]) { |
| 157 throw new UnsupportedError('TODO(jacobr): should we impl?'); | 153 throw new UnsupportedError('TODO(jacobr): should we impl?'); |
| 158 } | 154 } |
| 159 | 155 |
| 160 dynamic reduce(dynamic initialValue, | 156 dynamic reduce(dynamic initialValue, |
| 161 dynamic combine(dynamic previousValue, Element element)) { | 157 dynamic combine(dynamic previousValue, Element element)) { |
| 162 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 158 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 } | 279 } |
| 284 | 280 |
| 285 String join([String separator]) { | 281 String join([String separator]) { |
| 286 return IterableMixinWorkaround.joinList(this, separator); | 282 return IterableMixinWorkaround.joinList(this, separator); |
| 287 } | 283 } |
| 288 | 284 |
| 289 Iterable map(f(Element element)) { | 285 Iterable map(f(Element element)) { |
| 290 return IterableMixinWorkaround.mapList(this, f); | 286 return IterableMixinWorkaround.mapList(this, f); |
| 291 } | 287 } |
| 292 | 288 |
| 293 List mappedBy(f(Element element)) { | |
| 294 return IterableMixinWorkaround.mappedByList(this, f); | |
| 295 } | |
| 296 | |
| 297 Iterable<Element> where(bool f(Element element)) { | 289 Iterable<Element> where(bool f(Element element)) { |
| 298 return IterableMixinWorkaround.where(this, f); | 290 return IterableMixinWorkaround.where(this, f); |
| 299 } | 291 } |
| 300 | 292 |
| 301 Iterable expand(Iterable f(Element element)) { | 293 Iterable expand(Iterable f(Element element)) { |
| 302 return IterableMixinWorkaround.expand(this, f); | 294 return IterableMixinWorkaround.expand(this, f); |
| 303 } | 295 } |
| 304 | 296 |
| 305 bool every(bool f(Element element)) { | 297 bool every(bool f(Element element)) { |
| 306 for(Element element in this) { | 298 for(Element element in this) { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 void addLast(Element value) { | 368 void addLast(Element value) { |
| 377 throw new UnsupportedError(''); | 369 throw new UnsupportedError(''); |
| 378 } | 370 } |
| 379 | 371 |
| 380 Iterator<Element> get iterator => new _FrozenElementListIterator(this); | 372 Iterator<Element> get iterator => new _FrozenElementListIterator(this); |
| 381 | 373 |
| 382 void addAll(Iterable<Element> iterable) { | 374 void addAll(Iterable<Element> iterable) { |
| 383 throw new UnsupportedError(''); | 375 throw new UnsupportedError(''); |
| 384 } | 376 } |
| 385 | 377 |
| 386 List<Element> get reversed { | 378 Iterable<Element> get reversed { |
| 387 return IterableMixinWorkaround.reversedList(this); | 379 return IterableMixinWorkaround.reversedList(this); |
| 388 } | 380 } |
| 389 | 381 |
| 390 void sort([int compare(Element a, Element b)]) { | 382 void sort([int compare(Element a, Element b)]) { |
| 391 throw new UnsupportedError(''); | 383 throw new UnsupportedError(''); |
| 392 } | 384 } |
| 393 | 385 |
| 394 dynamic reduce(dynamic initialValue, | 386 dynamic reduce(dynamic initialValue, |
| 395 dynamic combine(dynamic previousValue, Element element)) { | 387 dynamic combine(dynamic previousValue, Element element)) { |
| 396 return IterableMixinWorkaround.reduce(this, initialValue, combine); | 388 return IterableMixinWorkaround.reduce(this, initialValue, combine); |
| (...skipping 719 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1116 const ScrollAlignment._internal(this._value); | 1108 const ScrollAlignment._internal(this._value); |
| 1117 toString() => 'ScrollAlignment.$_value'; | 1109 toString() => 'ScrollAlignment.$_value'; |
| 1118 | 1110 |
| 1119 /// Attempt to align the element to the top of the scrollable area. | 1111 /// Attempt to align the element to the top of the scrollable area. |
| 1120 static const TOP = const ScrollAlignment._internal('TOP'); | 1112 static const TOP = const ScrollAlignment._internal('TOP'); |
| 1121 /// Attempt to center the element in the scrollable area. | 1113 /// Attempt to center the element in the scrollable area. |
| 1122 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1114 static const CENTER = const ScrollAlignment._internal('CENTER'); |
| 1123 /// Attempt to align the element to the bottom of the scrollable area. | 1115 /// Attempt to align the element to the bottom of the scrollable area. |
| 1124 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1116 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
| 1125 } | 1117 } |
| OLD | NEW |