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

Unified Diff: lib/html/templates/html/impl/impl_Element.darttemplate

Issue 11186045: Revert "Add "contains" method to Collection." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 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: lib/html/templates/html/impl/impl_Element.darttemplate
diff --git a/lib/html/templates/html/impl/impl_Element.darttemplate b/lib/html/templates/html/impl/impl_Element.darttemplate
index de3956431f62e286ddeb673156fd78a6e81e52be..6f752320501b4b58b42695a160de7e8cefe59e74 100644
--- a/lib/html/templates/html/impl/impl_Element.darttemplate
+++ b/lib/html/templates/html/impl/impl_Element.darttemplate
@@ -21,13 +21,6 @@ class _ChildrenElementList implements List {
return output;
}
- bool contains(Element element) {
- for (_ElementImpl child in _childElements) {
- if (child == element) return true;
- }
- return false;
- }
-
void forEach(void f(Element element)) {
for (_ElementImpl element in _childElements) {
f(element);
@@ -35,7 +28,7 @@ class _ChildrenElementList implements List {
}
List<Element> filter(bool f(Element element)) {
- final output = <Element>[];
+ final output = [];
forEach((Element element) {
if (f(element)) {
output.add(element);
@@ -166,13 +159,6 @@ class _FrozenElementList implements List {
return _nodeList[0];
}
- bool contains(Element element) {
- for (Element el in this) {
- if (el == element) return true;
- }
- return false;
- }
-
void forEach(void f(Element element)) {
for (Element el in this) {
f(el);
@@ -188,7 +174,7 @@ class _FrozenElementList implements List {
}
List<Element> filter(bool f(Element element)) {
- final out = <Element>[];
+ final out = [];
for (Element el in this) {
if (f(el)) out.add(el);
}
@@ -479,8 +465,6 @@ class _CssClassSet implements CSSClassSet {
// interface Iterable - END
// interface Collection - BEGIN
- bool contains(String element) => _read().contains(element);
-
void forEach(void f(String element)) {
_read().forEach(f);
}
@@ -502,6 +486,8 @@ class _CssClassSet implements CSSClassSet {
// interface Collection - END
// interface Set - BEGIN
+ bool contains(String value) => _read().contains(value);
+
void add(String value) {
// TODO - figure out if we need to do any validation here
// or if the browser natively does enough
« no previous file with comments | « lib/html/templates/html/impl/impl_DocumentFragment.darttemplate ('k') | lib/html/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698