| 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 6f752320501b4b58b42695a160de7e8cefe59e74..038f7f1197a3be5a40dfd81c12ff36422f0e6ebb 100644
|
| --- a/lib/html/templates/html/impl/impl_Element.darttemplate
|
| +++ b/lib/html/templates/html/impl/impl_Element.darttemplate
|
| @@ -21,6 +21,13 @@ 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);
|
| @@ -28,7 +35,7 @@ class _ChildrenElementList implements List {
|
| }
|
|
|
| List<Element> filter(bool f(Element element)) {
|
| - final output = [];
|
| + final output = <Element>[];
|
| forEach((Element element) {
|
| if (f(element)) {
|
| output.add(element);
|
| @@ -159,6 +166,13 @@ 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);
|
| @@ -174,7 +188,7 @@ class _FrozenElementList implements List {
|
| }
|
|
|
| List<Element> filter(bool f(Element element)) {
|
| - final out = [];
|
| + final out = <Element>[];
|
| for (Element el in this) {
|
| if (f(el)) out.add(el);
|
| }
|
| @@ -465,6 +479,8 @@ 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);
|
| }
|
|
|