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

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

Issue 2875773003: Roll 50: Updated for push to origin/master. (Closed)
Patch Set: Roll 50: Updated to latest Created 3 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
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 /** 7 /**
8 * A set (union) of the CSS classes that are present in a set of elements. 8 * A set (union) of the CSS classes that are present in a set of elements.
9 * Implemented separately from _ElementCssClassSet for performance. 9 * Implemented separately from _ElementCssClassSet for performance.
10 */ 10 */
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 } 66 }
67 67
68 class _ElementCssClassSet extends CssClassSetImpl { 68 class _ElementCssClassSet extends CssClassSetImpl {
69 final Element _element; 69 final Element _element;
70 70
71 _ElementCssClassSet(this._element); 71 _ElementCssClassSet(this._element);
72 72
73 Set<String> readClasses() { 73 Set<String> readClasses() {
74 var s = new LinkedHashSet<String>(); 74 var s = new LinkedHashSet<String>();
75 var classname = _element.className; 75 var classname = _element.className;
76 if (classname is svg.AnimatedString) {
77 classname = classname.baseVal;
78 }
76 79
77 for (String name in classname.split(' ')) { 80 for (String name in classname.split(' ')) {
78 String trimmed = name.trim(); 81 String trimmed = name.trim();
79 if (!trimmed.isEmpty) { 82 if (!trimmed.isEmpty) {
80 s.add(trimmed); 83 s.add(trimmed);
81 } 84 }
82 } 85 }
83 return s; 86 return s;
84 } 87 }
85 88
86 void writeClasses(Set<String> s) { 89 void writeClasses(Set<String> s) {
87 _element.className = s.join(' '); 90 _element.className = s.join(' ');
88 } 91 }
89 } 92 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698