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

Unified Diff: packages/html/lib/src/css_class_set.dart

Issue 2990843002: Removed fixed dependencies (Closed)
Patch Set: Created 3 years, 5 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 | « packages/html/lib/parser.dart ('k') | packages/html/lib/src/encoding_parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: packages/html/lib/src/css_class_set.dart
diff --git a/packages/html/lib/src/css_class_set.dart b/packages/html/lib/src/css_class_set.dart
index 2e131a53810d390f0de777d125d7ac83f6d4c76f..ddc1612d4ecc256e7282604649962c1693cf7683 100644
--- a/packages/html/lib/src/css_class_set.dart
+++ b/packages/html/lib/src/css_class_set.dart
@@ -55,7 +55,7 @@ abstract class CssClassSet implements Set<String> {
* This is the Dart equivalent of jQuery's
* [hasClass](http://api.jquery.com/hasClass/).
*/
- bool contains(String value);
+ bool contains(Object value);
/**
* Add the class [value] to element.
@@ -93,7 +93,7 @@ abstract class CssClassSet implements Set<String> {
* This is the Dart equivalent of jQuery's
* [removeClass](http://api.jquery.com/removeClass/).
*/
- void removeAll(Iterable<String> iterable);
+ void removeAll(Iterable<Object> iterable);
/**
* Toggles all classes specified in [iterable] on element.
@@ -151,11 +151,11 @@ abstract class CssClassSetImpl implements CssClassSet {
String join([String separator = ""]) => readClasses().join(separator);
- Iterable map(f(String element)) => readClasses().map(f);
+ Iterable/*<T>*/ map/*<T>*/(/*=T*/ f(String e)) => readClasses().map(f);
Iterable<String> where(bool f(String element)) => readClasses().where(f);
- Iterable expand(Iterable f(String element)) => readClasses().expand(f);
+ Iterable/*<T>*/ expand/*<T>*/(Iterable/*<T>*/ f(String element)) => readClasses().expand(f);
bool every(bool f(String element)) => readClasses().every(f);
@@ -171,8 +171,8 @@ abstract class CssClassSetImpl implements CssClassSet {
return readClasses().reduce(combine);
}
- dynamic fold(dynamic initialValue,
- dynamic combine(dynamic previousValue, String element)) {
+ dynamic/*=T*/ fold/*<T>*/(var/*=T*/ initialValue,
+ dynamic/*=T*/ combine(var/*=T*/ previousValue, String element)) {
return readClasses().fold(initialValue, combine);
}
// interface Collection - END
@@ -184,10 +184,10 @@ abstract class CssClassSetImpl implements CssClassSet {
* This is the Dart equivalent of jQuery's
* [hasClass](http://api.jquery.com/hasClass/).
*/
- bool contains(String value) => readClasses().contains(value);
+ bool contains(Object value) => readClasses().contains(value);
/** Lookup from the Set interface. Not interesting for a String set. */
- String lookup(String value) => contains(value) ? value : null;
+ String lookup(Object value) => contains(value) ? value as String : null;
/**
* Add the class [value] to element.
@@ -233,7 +233,7 @@ abstract class CssClassSetImpl implements CssClassSet {
* This is the Dart equivalent of jQuery's
* [removeClass](http://api.jquery.com/removeClass/).
*/
- void removeAll(Iterable<String> iterable) {
+ void removeAll(Iterable<Object> iterable) {
modify((s) => s.removeAll(iterable));
}
@@ -251,7 +251,7 @@ abstract class CssClassSetImpl implements CssClassSet {
iterable.forEach((e) => toggle(e, shouldAdd));
}
- void retainAll(Iterable<String> iterable) {
+ void retainAll(Iterable<Object> iterable) {
modify((s) => s.retainAll(iterable));
}
@@ -263,15 +263,15 @@ abstract class CssClassSetImpl implements CssClassSet {
modify((s) => s.retainWhere(test));
}
- bool containsAll(Iterable<String> collection) =>
+ bool containsAll(Iterable<Object> collection) =>
readClasses().containsAll(collection);
- Set<String> intersection(Set<String> other) =>
+ Set<String> intersection(Set<Object> other) =>
readClasses().intersection(other);
Set<String> union(Set<String> other) => readClasses().union(other);
- Set<String> difference(Set<String> other) => readClasses().difference(other);
+ Set<String> difference(Set<Object> other) => readClasses().difference(other);
String get first => readClasses().first;
String get last => readClasses().last;
@@ -285,9 +285,9 @@ abstract class CssClassSetImpl implements CssClassSet {
Iterable<String> skip(int n) => readClasses().skip(n);
Iterable<String> skipWhile(bool test(String value)) =>
readClasses().skipWhile(test);
- dynamic firstWhere(bool test(String value), {Object orElse()}) =>
+ String firstWhere(bool test(String value), {String orElse()}) =>
readClasses().firstWhere(test, orElse: orElse);
- dynamic lastWhere(bool test(String value), {Object orElse()}) =>
+ String lastWhere(bool test(String value), {String orElse()}) =>
readClasses().lastWhere(test, orElse: orElse);
String singleWhere(bool test(String value)) =>
readClasses().singleWhere(test);
« no previous file with comments | « packages/html/lib/parser.dart ('k') | packages/html/lib/src/encoding_parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698