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

Unified Diff: client/html/src/ElementWrappingImplementation.dart

Issue 9270054: Make ElementList return ElementLists. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « client/html/src/Element.dart ('k') | client/html/src/NodeWrappingImplementation.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: client/html/src/ElementWrappingImplementation.dart
diff --git a/client/html/src/ElementWrappingImplementation.dart b/client/html/src/ElementWrappingImplementation.dart
index 8f9abb72c0912f01c9f612180b4ec7d5751087e5..734d19e2fc3e8f2e5cd9ded7ef8af7fb94aa6ea3 100644
--- a/client/html/src/ElementWrappingImplementation.dart
+++ b/client/html/src/ElementWrappingImplementation.dart
@@ -28,7 +28,8 @@ class _ChildrenElementList implements ElementList {
Collection map(f(Element element)) => _toList().map(f);
- Collection<Element> filter(bool f(Element element)) => _toList().filter(f);
+ ElementList filter(bool f(Element element)) =>
+ new _ElementList(_toList().filter(f));
bool every(bool f(Element element)) {
for(Element element in this) {
@@ -102,7 +103,8 @@ class _ChildrenElementList implements ElementList {
throw const NotImplementedException();
}
- List getRange(int start, int length) => Lists.getRange(this, start, length);
+ ElementList getRange(int start, int length) =>
+ new _ElementList(Lists.getRange(this, start, length));
int indexOf(Element element, [int start = 0]) {
return Lists.indexOf(this, element, start, this.length);
@@ -155,7 +157,8 @@ class FrozenElementList implements ElementList {
Collection map(f(Element element)) => _toList().map(f);
- Collection<Element> filter(bool f(Element element)) => _toList().filter(f);
+ ElementList filter(bool f(Element element)) =>
+ new _ElementList(_toList().filter(f));
bool every(bool f(Element element)) {
for(Element element in this) {
@@ -230,7 +233,8 @@ class FrozenElementList implements ElementList {
throw const UnsupportedOperationException('');
}
- List getRange(int start, int length) => Lists.getRange(this, start, length);
+ ElementList getRange(int start, int length) =>
+ new _ElementList(Lists.getRange(this, start, length));
int indexOf(Element element, [int start = 0]) =>
Lists.indexOf(this, element, start, this.length);
@@ -277,6 +281,16 @@ class FrozenElementListIterator implements Iterator<Element> {
bool hasNext() => _index < _list.length;
}
+class _ElementList extends _ListWrapper<Element> implements ElementList {
+ _ElementList(List<Element> list) : super(list);
+
+ ElementList filter(bool f(Element element)) =>
+ new _ElementList(super.filter(f));
+
+ ElementList getRange(int start, int length) =>
+ new _ElementList(super.getRange(start, length));
+}
+
class ElementAttributeMap implements Map<String, String> {
final _element;
« no previous file with comments | « client/html/src/Element.dart ('k') | client/html/src/NodeWrappingImplementation.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698