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

Unified Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 11931034: Add methods to Collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Also on DoubleLinkedQueue. Created 7 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
Index: tools/dom/templates/html/impl/impl_Element.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate
index 024a891adaf86102af49fcf7f540b3e5f392d421..faa3377cf34f3cf7004a470e9d299fddcf5e642e 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -116,10 +116,10 @@ class _ChildrenElementList implements List {
_element.$dom_replaceChild(value, _childElements[index]);
}
- void set length(int newLength) {
- // TODO(jacobr): remove children when length is reduced.
- throw new UnsupportedError('');
- }
+ void set length(int newLength) {
+ // TODO(jacobr): remove children when length is reduced.
+ throw new UnsupportedError('');
+ }
Element add(Element value) {
_element.$dom_appendChild(value);
@@ -149,6 +149,31 @@ class _ChildrenElementList implements List {
throw new UnimplementedError();
}
+ void remove(Object object) {
+ if (object is Element) {
+ Element element = object;
+ if (identical(element.parentNode, this)) {
+ _element.$dom_removeChild(element);
+ }
+ }
+ }
+
+ void removeAll(Iterable elements) {
+ Collections.removeAll(this, elements);
+ }
+
+ void retainAll(Iterable elements) {
+ Collections.retainAll(this, elements);
+ }
+
+ void removeMatching(bool test(Element element)) {
+ Collections.removeMatching(this, test);
+ }
+
+ void retainMatching(bool test(Element element)) {
+ Collections.retainMatching(this, test);
+ }
+
void removeRange(int start, int rangeLength) {
throw new UnimplementedError();
}
@@ -374,6 +399,26 @@ class _FrozenElementList implements List {
throw new UnsupportedError('');
}
+ void remove(Object element) {
+ throw new UnsupportedError('');
+ }
+
+ void removeAll(Iterable elements) {
+ throw new UnsupportedError('');
+ }
+
+ void retainAll(Iterable elements) {
+ throw new UnsupportedError('');
+ }
+
+ void removeMatching(bool test(Element element)) {
+ throw new UnsupportedError('');
+ }
+
+ void retainMatching(bool test(Element element)) {
+ throw new UnsupportedError('');
+ }
+
Element get first => _nodeList.first;
Element get last => _nodeList.last;

Powered by Google App Engine
This is Rietveld 408576698