OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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_common; | 5 part of html_common; |
6 | 6 |
7 /** | 7 /** |
8 * An indexable collection of a node's descendants in the document tree, | 8 * An indexable collection of a node's descendants in the document tree, |
9 * filtered so that only elements are in the collection. | 9 * filtered so that only elements are in the collection. |
10 */ | 10 */ |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 | 73 |
74 void setRange(int start, int end, Iterable<Element> iterable, | 74 void setRange(int start, int end, Iterable<Element> iterable, |
75 [int skipCount = 0]) { | 75 [int skipCount = 0]) { |
76 throw new UnimplementedError(); | 76 throw new UnimplementedError(); |
77 } | 77 } |
78 | 78 |
79 void removeRange(int start, int end) { | 79 void removeRange(int start, int end) { |
80 _filtered.sublist(start, end).forEach((el) => el.remove()); | 80 _filtered.sublist(start, end).forEach((el) => el.remove()); |
81 } | 81 } |
82 | 82 |
83 void insertRange(int start, int rangeLength, [initialValue = null]) { | |
84 throw new UnimplementedError(); | |
85 } | |
86 | |
87 void clear() { | 83 void clear() { |
88 // Currently, ElementList#clear clears even non-element nodes, so we follow | 84 // Currently, ElementList#clear clears even non-element nodes, so we follow |
89 // that behavior. | 85 // that behavior. |
90 _childNodes.clear(); | 86 _childNodes.clear(); |
91 } | 87 } |
92 | 88 |
93 Element removeLast() { | 89 Element removeLast() { |
94 final result = this.last; | 90 final result = this.last; |
95 if (result != null) { | 91 if (result != null) { |
96 result.remove(); | 92 result.remove(); |
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 Element get single => _filtered.single; | 189 Element get single => _filtered.single; |
194 | 190 |
195 Element min([int compare(Element a, Element b)]) => _filtered.min(compare); | 191 Element min([int compare(Element a, Element b)]) => _filtered.min(compare); |
196 | 192 |
197 Element max([int compare(Element a, Element b)]) => _filtered.max(compare); | 193 Element max([int compare(Element a, Element b)]) => _filtered.max(compare); |
198 | 194 |
199 Map<int, Element> asMap() { | 195 Map<int, Element> asMap() { |
200 return IterableMixinWorkaround.asMapList(this); | 196 return IterableMixinWorkaround.asMapList(this); |
201 } | 197 } |
202 } | 198 } |
OLD | NEW |