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

Side by Side Diff: pkg/third_party/html5lib/lib/src/css_class_set.dart

Issue 288103003: Change Set.toSet to always return a set with the same behavior. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Change .clone() to use .toSet(). Update docs. Created 6 years, 7 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 // TODO(jmesserly): everything in this file is copied straight from "dart:html". 5 // TODO(jmesserly): everything in this file is copied straight from "dart:html".
6 library html5lib.dom.src; 6 library html5lib.dom.src;
7 7
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'package:html5lib/dom.dart'; 9 import 'package:html5lib/dom.dart';
10 10
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 272
273 Set<String> intersection(Set<String> other) => 273 Set<String> intersection(Set<String> other) =>
274 readClasses().intersection(other); 274 readClasses().intersection(other);
275 275
276 Set<String> union(Set<String> other) => 276 Set<String> union(Set<String> other) =>
277 readClasses().union(other); 277 readClasses().union(other);
278 278
279 Set<String> difference(Set<String> other) => 279 Set<String> difference(Set<String> other) =>
280 readClasses().difference(other); 280 readClasses().difference(other);
281 281
282 Set<E> cloneEmpty() => new LinkedHashSet<String>();
Lasse Reichstein Nielsen 2014/05/19 07:30:05 @jmesserly: What does it mean that this is in pkg/
Jennifer Messerly 2014/05/19 17:44:42 it means it's under a different license (MIT) and
283
282 String get first => readClasses().first; 284 String get first => readClasses().first;
283 String get last => readClasses().last; 285 String get last => readClasses().last;
284 String get single => readClasses().single; 286 String get single => readClasses().single;
285 List<String> toList({ bool growable: true }) => 287 List<String> toList({ bool growable: true }) =>
286 readClasses().toList(growable: growable); 288 readClasses().toList(growable: growable);
287 Set<String> toSet() => readClasses().toSet(); 289 Set<String> toSet() => readClasses().toSet();
288 Iterable<String> take(int n) => readClasses().take(n); 290 Iterable<String> take(int n) => readClasses().take(n);
289 Iterable<String> takeWhile(bool test(String value)) => 291 Iterable<String> takeWhile(bool test(String value)) =>
290 readClasses().takeWhile(test); 292 readClasses().takeWhile(test);
291 Iterable<String> skip(int n) => readClasses().skip(n); 293 Iterable<String> skip(int n) => readClasses().skip(n);
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
327 */ 329 */
328 Set<String> readClasses(); 330 Set<String> readClasses();
329 331
330 /** 332 /**
331 * Join all the elements of a set into one string and write 333 * Join all the elements of a set into one string and write
332 * back to the element. 334 * back to the element.
333 * This is intended to be overridden by specific implementations. 335 * This is intended to be overridden by specific implementations.
334 */ 336 */
335 void writeClasses(Set<String> s); 337 void writeClasses(Set<String> s);
336 } 338 }
OLDNEW
« no previous file with comments | « pkg/collection/test/wrapper_test.dart ('k') | sdk/lib/_internal/compiler/implementation/helpers/expensive_set.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698