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

Unified Diff: tools/dom/src/CssClassSet.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 | « tests/html/element_classes_test.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/src/CssClassSet.dart
diff --git a/tools/dom/src/CssClassSet.dart b/tools/dom/src/CssClassSet.dart
index 58c1d6a8b06f301cb60a2c4c1293755b2d17e9d6..5d9a910ceac39a79297e179084579f2ff3abd23b 100644
--- a/tools/dom/src/CssClassSet.dart
+++ b/tools/dom/src/CssClassSet.dart
@@ -35,8 +35,13 @@ abstract class CssClassSet implements Set<String> {
*
* This is the Dart equivalent of jQuery's
* [addClass](http://api.jquery.com/addClass/).
+ *
+ * If this corresponds to one element. Returns `true` if [value] was added to
+ * the set, otherwise `false`.
+ *
+ * If this corresponds to many elements, `null` is always returned.
*/
- void add(String value);
+ bool add(String value);
/**
* Remove the class [value] from element, and return true on successful
@@ -111,7 +116,7 @@ class _MultiElementCssClassSet extends CssClassSetImpl {
* 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)) {
_elementCssClassSetIterable.forEach((e) => e.modify(f));
}
« no previous file with comments | « tests/html/element_classes_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698