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 "dart:html_common"; |
6 | 6 |
7 /** | 7 /** |
8 * An indexable collection of a node's direct descendants in the document tree, | 8 * An indexable collection of a node's direct 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 */ |
11 class FilteredElementList extends ListBase<Element> implements NodeListWrapper { | 11 class FilteredElementList extends ListBase<Element> implements NodeListWrapper { |
12 final Node _node; | 12 final Node _node; |
13 final List<Node> _childNodes; | 13 final List<Node> _childNodes; |
14 | 14 |
15 /** | 15 /** |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 } | 142 } |
143 | 143 |
144 int get length => _iterable.length; | 144 int get length => _iterable.length; |
145 Element operator [](int index) => _iterable.elementAt(index); | 145 Element operator [](int index) => _iterable.elementAt(index); |
146 // This cannot use the iterator, because operations during iteration might | 146 // This cannot use the iterator, because operations during iteration might |
147 // modify the collection, e.g. addAll might append a node to another parent. | 147 // modify the collection, e.g. addAll might append a node to another parent. |
148 Iterator<Element> get iterator => _filtered.iterator; | 148 Iterator<Element> get iterator => _filtered.iterator; |
149 | 149 |
150 List<Node> get rawList => _node.childNodes; | 150 List<Node> get rawList => _node.childNodes; |
151 } | 151 } |
OLD | NEW |