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

Side by Side Diff: sdk/lib/html/html_common/css_class_set.dart

Issue 891583002: Add type annotations to some dart:html closures (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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') | tools/dom/src/CssClassSet.dart » ('j') | 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_common; 5 part of html_common;
6 6
7 abstract class CssClassSetImpl implements CssClassSet { 7 abstract class CssClassSetImpl implements CssClassSet {
8 8
9 String toString() { 9 String toString() {
10 return readClasses().join(' '); 10 return readClasses().join(' ');
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 readClasses().skipWhile(test); 186 readClasses().skipWhile(test);
187 String firstWhere(bool test(String value), { String orElse() }) => 187 String firstWhere(bool test(String value), { String orElse() }) =>
188 readClasses().firstWhere(test, orElse: orElse); 188 readClasses().firstWhere(test, orElse: orElse);
189 String lastWhere(bool test(String value), { String orElse()}) => 189 String lastWhere(bool test(String value), { String orElse()}) =>
190 readClasses().lastWhere(test, orElse: orElse); 190 readClasses().lastWhere(test, orElse: orElse);
191 String singleWhere(bool test(String value)) => 191 String singleWhere(bool test(String value)) =>
192 readClasses().singleWhere(test); 192 readClasses().singleWhere(test);
193 String elementAt(int index) => readClasses().elementAt(index); 193 String elementAt(int index) => readClasses().elementAt(index);
194 194
195 void clear() { 195 void clear() {
196 // TODO(sra): Do this without reading the classes.
196 modify((s) => s.clear()); 197 modify((s) => s.clear());
197 } 198 }
198 // interface Set - END 199 // interface Set - END
199 200
200 /** 201 /**
201 * Helper method used to modify the set of css classes on this element. 202 * Helper method used to modify the set of css classes on this element.
202 * 203 *
203 * f - callback with: 204 * f - callback with:
204 * s - a Set of all the css class name currently on this element. 205 * s - a Set of all the css class name currently on this element.
205 * 206 *
(...skipping 14 matching lines...) Expand all
220 */ 221 */
221 Set<String> readClasses(); 222 Set<String> readClasses();
222 223
223 /** 224 /**
224 * Join all the elements of a set into one string and write 225 * Join all the elements of a set into one string and write
225 * back to the element. 226 * back to the element.
226 * This is intended to be overridden by specific implementations. 227 * This is intended to be overridden by specific implementations.
227 */ 228 */
228 void writeClasses(Set<String> s); 229 void writeClasses(Set<String> s);
229 } 230 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | tools/dom/src/CssClassSet.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698