Skip to content

Commit 864b64f

Browse files
committed
1 parent e072ae3 commit 864b64f

33 files changed

+1226
-1071
lines changed

sdk/lib/html/dart2js/html_dart2js.dart

Lines changed: 364 additions & 346 deletions
Large diffs are not rendered by default.

sdk/lib/html/dartium/html_dartium.dart

Lines changed: 344 additions & 301 deletions
Large diffs are not rendered by default.

sdk/lib/html/html_common/css_class_set.dart

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,13 @@ abstract class CssClassSetImpl implements CssClassSet {
5656

5757
String join([String separator = ""]) => readClasses().join(separator);
5858

59-
Iterable map(f(String element)) => readClasses().map(f);
59+
Iterable/*<T>*/ map/*<T>*/(/*=T*/ f(String e)) =>
60+
readClasses().map/*<T>*/(f);
6061

6162
Iterable<String> where(bool f(String element)) => readClasses().where(f);
6263

63-
Iterable expand(Iterable f(String element)) => readClasses().expand(f);
64+
Iterable/*<T>*/ expand/*<T>*/(Iterable/*<T>*/ f(String element)) =>
65+
readClasses().expand/*<T>*/(f);
6466

6567
bool every(bool f(String element)) => readClasses().every(f);
6668

@@ -76,10 +78,11 @@ abstract class CssClassSetImpl implements CssClassSet {
7678
return readClasses().reduce(combine);
7779
}
7880

79-
dynamic fold(dynamic initialValue,
80-
dynamic combine(dynamic previousValue, String element)) {
81-
return readClasses().fold(initialValue, combine);
81+
dynamic/*=T*/ fold/*<T>*/(var/*=T*/ initialValue,
82+
dynamic/*=T*/ combine(var/*=T*/ previousValue, String element)) {
83+
return readClasses().fold/*<T>*/(initialValue, combine);
8284
}
85+
8386
// interface Collection - END
8487

8588
// interface Set - BEGIN
@@ -145,7 +148,7 @@ abstract class CssClassSetImpl implements CssClassSet {
145148
* [removeClass](http://api.jquery.com/removeClass/).
146149
*/
147150
void removeAll(Iterable<Object> iterable) {
148-
modify((s) => s.removeAll(iterable.map(_validateToken)));
151+
modify((s) => s.removeAll(iterable));
149152
}
150153

151154
/**
@@ -183,7 +186,7 @@ abstract class CssClassSetImpl implements CssClassSet {
183186
Set<String> union(Set<String> other) =>
184187
readClasses().union(other);
185188

186-
Set<String> difference(Set<String> other) =>
189+
Set<String> difference(Set<Object> other) =>
187190
readClasses().difference(other);
188191

189192
String get first => readClasses().first;
@@ -221,7 +224,7 @@ abstract class CssClassSetImpl implements CssClassSet {
221224
* After f returns, the modified set is written to the
222225
* className property of this element.
223226
*/
224-
modify( f(Set<String> s)) {
227+
modify(f(Set<String> s)) {
225228
Set<String> s = readClasses();
226229
var ret = f(s);
227230
writeClasses(s);

sdk/lib/html/html_common/filtered_element_list.dart

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ class FilteredElementList extends ListBase<Element> implements NodeListWrapper {
2626

2727
// We can't memoize this, since it's possible that children will be messed
2828
// with externally to this class.
29-
//
30-
// We can't use where directly because the types don't agree and there's
31-
// no way to cast it, so take advantage of being in the SDK to construct
32-
// a WhereIterable directly. Even so it has to be of dynamic.
3329
Iterable<Element> get _iterable =>
34-
new WhereIterable(_childNodes, (n) => n is Element);
30+
_childNodes.where((n) => n is Element).map/*<Element>*/((n) => n as Element);
3531
List<Element> get _filtered =>
3632
new List<Element>.from(_iterable, growable: false);
3733

0 commit comments

Comments
 (0)