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

Unified Diff: sdk/lib/html/html_common/css_class_set.dart

Issue 26280002: Set.add returns true if item has been added, otherwise false (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: again Created 7 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
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/corelib/set_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/html_common/css_class_set.dart
diff --git a/sdk/lib/html/html_common/css_class_set.dart b/sdk/lib/html/html_common/css_class_set.dart
index 1e2dce72f800d62f4e7211bb921c7ff5c99e2424..a81497e401f08207a316f332de3962bba0dc4049 100644
--- a/sdk/lib/html/html_common/css_class_set.dart
+++ b/sdk/lib/html/html_common/css_class_set.dart
@@ -92,10 +92,10 @@ abstract class CssClassSetImpl implements CssClassSet {
* This is the Dart equivalent of jQuery's
* [addClass](http://api.jquery.com/addClass/).
*/
- void add(String value) {
+ bool add(String value) {
// TODO - figure out if we need to do any validation here
// or if the browser natively does enough.
- modify((s) => s.add(value));
+ return modify((s) => s.add(value));
}
/**
@@ -206,10 +206,11 @@ abstract class CssClassSetImpl implements CssClassSet {
* After f returns, the modified set is written to the
* className property of this element.
*/
- void modify( f(Set<String> s)) {
+ modify( f(Set<String> s)) {
Set<String> s = readClasses();
- f(s);
+ var ret = f(s);
writeClasses(s);
+ return ret;
}
/**
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tests/corelib/set_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698