Index: sdk/lib/html/templates/html/impl/impl_Element.darttemplate |
diff --git a/sdk/lib/html/templates/html/impl/impl_Element.darttemplate b/sdk/lib/html/templates/html/impl/impl_Element.darttemplate |
index cb6ba73c5ce4224fe212e17f0e5cb65186b757de..a41c4919ad96157df944ed3d774e74939367e12d 100644 |
--- a/sdk/lib/html/templates/html/impl/impl_Element.darttemplate |
+++ b/sdk/lib/html/templates/html/impl/impl_Element.darttemplate |
@@ -208,6 +208,14 @@ class _ChildrenElementList implements List { |
if (length > 1) throw new StateError("More than one element"); |
return first; |
} |
+ |
+ Element min([int compare(Element a, Element b)]) { |
+ return _Collections.minInList(this, compare); |
+ } |
+ |
+ Element max([int compare(Element a, Element b)]) { |
+ return _Collections.maxInList(this, compare); |
+ } |
} |
// TODO(jacobr): this is an inefficient implementation but it is hard to see |
@@ -368,6 +376,14 @@ class _FrozenElementList implements List { |
Element get last => _nodeList.last; |
Element get single => _nodeList.single; |
+ |
+ Element min([int compare(Element a, Element b)]) { |
+ return _Collections.minInList(this, compare); |
+ } |
+ |
+ Element max([int compare(Element a, Element b)]) { |
+ return _Collections.maxInList(this, compare); |
+ } |
} |
class _FrozenElementListIterator implements Iterator<Element> { |