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

Side by Side Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 12282045: Using an ordered set for Element.classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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
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 $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated 7 // TODO(jacobr): use _Lists.dart to remove some of the duplicated
8 // functionality. 8 // functionality.
9 class _ChildrenElementList implements List { 9 class _ChildrenElementList implements List {
10 // Raw Element. 10 // Raw Element.
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 Element get current => _current; 488 Element get current => _current;
489 } 489 }
490 490
491 class _ElementCssClassSet extends CssClassSet { 491 class _ElementCssClassSet extends CssClassSet {
492 492
493 final Element _element; 493 final Element _element;
494 494
495 _ElementCssClassSet(this._element); 495 _ElementCssClassSet(this._element);
496 496
497 Set<String> readClasses() { 497 Set<String> readClasses() {
498 var s = new Set<String>(); 498 var s = new LinkedHashSet<String>();
499 var classname = _element.$dom_className; 499 var classname = _element.$dom_className;
500 500
501 for (String name in classname.split(' ')) { 501 for (String name in classname.split(' ')) {
502 String trimmed = name.trim(); 502 String trimmed = name.trim();
503 if (!trimmed.isEmpty) { 503 if (!trimmed.isEmpty) {
504 s.add(trimmed); 504 s.add(trimmed);
505 } 505 }
506 } 506 }
507 return s; 507 return s;
508 } 508 }
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
1108 const ScrollAlignment._internal(this._value); 1108 const ScrollAlignment._internal(this._value);
1109 toString() => 'ScrollAlignment.$_value'; 1109 toString() => 'ScrollAlignment.$_value';
1110 1110
1111 /// Attempt to align the element to the top of the scrollable area. 1111 /// Attempt to align the element to the top of the scrollable area.
1112 static const TOP = const ScrollAlignment._internal('TOP'); 1112 static const TOP = const ScrollAlignment._internal('TOP');
1113 /// Attempt to center the element in the scrollable area. 1113 /// Attempt to center the element in the scrollable area.
1114 static const CENTER = const ScrollAlignment._internal('CENTER'); 1114 static const CENTER = const ScrollAlignment._internal('CENTER');
1115 /// Attempt to align the element to the bottom of the scrollable area. 1115 /// Attempt to align the element to the bottom of the scrollable area.
1116 static const BOTTOM = const ScrollAlignment._internal('BOTTOM'); 1116 static const BOTTOM = const ScrollAlignment._internal('BOTTOM');
1117 } 1117 }
OLDNEW
« no previous file with comments | « tests/html/element_classes_test.dart ('k') | tools/dom/templates/html/impl/impl_SVGElement.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698