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

Side by Side Diff: tools/dom/src/CssClassSet.dart

Issue 12493014: Fix CssClassSet methods to accept Set, not Collection. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 9 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of html; 5 part of html;
6 6
7 abstract class CssClassSet implements Set<String> { 7 abstract class CssClassSet implements Set<String> {
8 8
9 String toString() { 9 String toString() {
10 return readClasses().join(' '); 10 return readClasses().join(' ');
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
101 void retainWhere(bool test(String name)) { 101 void retainWhere(bool test(String name)) {
102 _modify((s) => s.retainWhere(test)); 102 _modify((s) => s.retainWhere(test));
103 } 103 }
104 104
105 bool isSubsetOf(Collection<String> collection) => 105 bool isSubsetOf(Collection<String> collection) =>
106 readClasses().isSubsetOf(collection); 106 readClasses().isSubsetOf(collection);
107 107
108 bool containsAll(Iterable<String> collection) => 108 bool containsAll(Iterable<String> collection) =>
109 readClasses().containsAll(collection); 109 readClasses().containsAll(collection);
110 110
111 Set<String> intersection(Collection<String> other) => 111 Set<String> intersection(Set<String> other) =>
112 readClasses().intersection(other); 112 readClasses().intersection(other);
113 113
114 Set<String> union(Collection<String> other) => 114 Set<String> union(Set<String> other) =>
115 readClasses().union(other); 115 readClasses().union(other);
116 116
117 Set<String> difference(Collection<String> other) => 117 Set<String> difference(Set<String> other) =>
118 readClasses().difference(other); 118 readClasses().difference(other);
119 119
120 String get first => readClasses().first; 120 String get first => readClasses().first;
121 String get last => readClasses().last; 121 String get last => readClasses().last;
122 String get single => readClasses().single; 122 String get single => readClasses().single;
123 List<String> toList({ bool growable: true }) => 123 List<String> toList({ bool growable: true }) =>
124 readClasses().toList(growable: growable); 124 readClasses().toList(growable: growable);
125 Set<String> toSet() => readClasses().toSet(); 125 Set<String> toSet() => readClasses().toSet();
126 String min([int compare(String a, String b)]) => 126 String min([int compare(String a, String b)]) =>
127 readClasses().min(compare); 127 readClasses().min(compare);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 */ 168 */
169 Set<String> readClasses(); 169 Set<String> readClasses();
170 170
171 /** 171 /**
172 * Join all the elements of a set into one string and write 172 * Join all the elements of a set into one string and write
173 * back to the element. 173 * back to the element.
174 * This is intended to be overridden by specific implementations. 174 * This is intended to be overridden by specific implementations.
175 */ 175 */
176 void writeClasses(Set<String> s); 176 void writeClasses(Set<String> s);
177 } 177 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698