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

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: Address comments. 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
« no previous file with comments | « tools/dom/src/CssClassSet.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1d5626cf0c51f650828a260b65d58d0873375495..3cc72d0a2734c6d6af2272be7b3d224c376fbd02 100644
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate
@@ -117,10 +117,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);
@@ -150,6 +150,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();
}
@@ -376,6 +401,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;
« no previous file with comments | « tools/dom/src/CssClassSet.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698