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

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

Issue 9210006: Revert "Add tests for Element#elements." (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/release/htmlimpl.dart ('k') | client/html/src/Lists.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 a10b510fb39e63c0527ff1aa4a16d585c90a7799..38b82dff028c94a10426cd2c1c21c7c9095387d1 100644
--- a/client/html/src/ElementWrappingImplementation.dart
+++ b/client/html/src/ElementWrappingImplementation.dart
@@ -24,11 +24,29 @@ class _ChildrenElementList implements ElementList {
return LevelDom.wrapElement(_element.firstElementChild);
}
- void forEach(void f(Element element)) => _toList().forEach(f);
+ void forEach(void f(Element element)) {
+ for (var element in _childElements) {
+ f(LevelDom.wrapElement(element));
+ }
+ }
- Collection map(f(Element element)) => _toList().map(f);
+ Collection map(f(Element element)) {
+ List output = new List();
+ forEach((Element element) {
+ output.add(f(element));
+ });
+ return output;
+ }
- Collection<Element> filter(bool f(Element element)) => _toList().filter(f);
+ Collection<Element> filter(bool f(Element element)) {
+ List<Element> output = new List<Element>();
+ forEach((Element element) {
+ if (f(element)) {
+ output.add(element);
+ }
+ });
+ return output;
+ }
bool every(bool f(Element element)) {
for(Element element in this) {
@@ -49,7 +67,7 @@ class _ChildrenElementList implements ElementList {
}
bool isEmpty() {
- return _element.firstElementChild === null;
+ return _element.firstElementChild !== null;
}
int get length() {
@@ -92,25 +110,29 @@ class _ChildrenElementList implements ElementList {
throw 'Not impl yet. todo(jacobr)';
}
- void setRange(int start, int length, List from, [int startFrom = 0]) =>
- Lists.setRange(this, start, length, from, startFrom);
+ void setRange(int start, int length, List from, [int startFrom = 0]) {
+ throw const NotImplementedException();
+ }
- void removeRange(int start, int length) =>
- Lists.removeRange(this, start, length, (i) => this[i].remove());
+ void removeRange(int start, int length) {
+ throw const NotImplementedException();
+ }
void insertRange(int start, int length, [initialValue = null]) {
throw const NotImplementedException();
}
- List getRange(int start, int length) => Lists.getRange(this, start, length);
+ List getRange(int start, int length) {
+ throw const NotImplementedException();
+ }
int indexOf(Element element, [int start = 0]) {
- return Lists.indexOf(this, element, start, this.length);
+ return _Lists.indexOf(this, element, start, this.length);
}
int lastIndexOf(Element element, [int start = null]) {
if (start === null) start = length - 1;
- return Lists.lastIndexOf(this, element, start);
+ return _Lists.lastIndexOf(this, element, start);
}
void clear() {
« no previous file with comments | « client/html/release/htmlimpl.dart ('k') | client/html/src/Lists.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698