| 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 class _ChildrenElementList extends ListBase<Element> { | 7 class _ChildrenElementList extends ListBase<Element> { |
| 8 // Raw Element. | 8 // Raw Element. |
| 9 final Element _element; | 9 final Element _element; |
| 10 final HtmlCollection _childElements; | 10 final HtmlCollection _childElements; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 51 | 51 |
| 52 for (Element element in iterable) { | 52 for (Element element in iterable) { |
| 53 _element.append(element); | 53 _element.append(element); |
| 54 } | 54 } |
| 55 } | 55 } |
| 56 | 56 |
| 57 void sort([int compare(Element a, Element b)]) { | 57 void sort([int compare(Element a, Element b)]) { |
| 58 throw new UnsupportedError('Cannot sort element lists'); | 58 throw new UnsupportedError('Cannot sort element lists'); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void removeWhere(bool test(Element element)) { | |
| 62 _filter(test, false); | |
| 63 } | |
| 64 | |
| 65 void retainWhere(bool test(Element element)) { | |
| 66 _filter(test, true); | |
| 67 } | |
| 68 | |
| 69 void _filter(bool test(var element), bool retainMatching) { | |
| 70 List removed = []; | |
| 71 if (retainMatching) { | |
| 72 removed = _element.children.where((e) => !test(e)); | |
| 73 } else { | |
| 74 removed = _element.children.where(test); | |
| 75 } | |
| 76 for (var e in removed) e.remove(); | |
| 77 } | |
| 78 | |
| 79 void setRange(int start, int end, Iterable<Element> iterable, | 61 void setRange(int start, int end, Iterable<Element> iterable, |
| 80 [int skipCount = 0]) { | 62 [int skipCount = 0]) { |
| 81 throw new UnimplementedError(); | 63 throw new UnimplementedError(); |
| 82 } | 64 } |
| 83 | 65 |
| 84 void replaceRange(int start, int end, Iterable<Element> iterable) { | 66 void replaceRange(int start, int end, Iterable<Element> iterable) { |
| 85 throw new UnimplementedError(); | 67 throw new UnimplementedError(); |
| 86 } | 68 } |
| 87 | 69 |
| 88 void fillRange(int start, int end, [Element fillValue]) { | 70 void fillRange(int start, int end, [Element fillValue]) { |
| (...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1054 const ScrollAlignment._internal(this._value); | 1036 const ScrollAlignment._internal(this._value); |
| 1055 toString() => 'ScrollAlignment.$_value'; | 1037 toString() => 'ScrollAlignment.$_value'; |
| 1056 | 1038 |
| 1057 /// Attempt to align the element to the top of the scrollable area. | 1039 /// Attempt to align the element to the top of the scrollable area. |
| 1058 static const TOP = const ScrollAlignment._internal('TOP'); | 1040 static const TOP = const ScrollAlignment._internal('TOP'); |
| 1059 /// Attempt to center the element in the scrollable area. | 1041 /// Attempt to center the element in the scrollable area. |
| 1060 static const CENTER = const ScrollAlignment._internal('CENTER'); | 1042 static const CENTER = const ScrollAlignment._internal('CENTER'); |
| 1061 /// Attempt to align the element to the bottom of the scrollable area. | 1043 /// Attempt to align the element to the bottom of the scrollable area. |
| 1062 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); | 1044 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); |
| 1063 } | 1045 } |
| OLD | NEW |