| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 class AttributeClassSet extends CssClassSetImpl { | 7 class AttributeClassSet extends CssClassSetImpl { |
| 8 final Element _element; | 8 final Element _element; |
| 9 | 9 |
| 10 AttributeClassSet(this._element); | 10 AttributeClassSet(this._element); |
| 11 | 11 |
| 12 Set<String> readClasses() { | 12 Set<String> readClasses() { |
| 13 var classname = _element.attributes['class']; | 13 var classname = _element.attributes['class']; |
| 14 if (classname is AnimatedString) { | 14 if (classname is AnimatedString) { |
| 15 classname = classname.baseVal; | 15 classname = (classname as AnimatedString).baseVal; |
| 16 } | 16 } |
| 17 | 17 |
| 18 Set<String> s = new LinkedHashSet<String>(); | 18 Set<String> s = new LinkedHashSet<String>(); |
| 19 if (classname == null) { | 19 if (classname == null) { |
| 20 return s; | 20 return s; |
| 21 } | 21 } |
| 22 for (String name in classname.split(' ')) { | 22 for (String name in classname.split(' ')) { |
| 23 String trimmed = name.trim(); | 23 String trimmed = name.trim(); |
| 24 if (!trimmed.isEmpty) { | 24 if (!trimmed.isEmpty) { |
| 25 s.add(trimmed); | 25 s.add(trimmed); |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 return e is $CLASSNAME && !(e is UnknownElement); | 147 return e is $CLASSNAME && !(e is UnknownElement); |
| 148 } | 148 } |
| 149 | 149 |
| 150 $if JSINTEROP | 150 $if JSINTEROP |
| 151 set _svgClassName(AnimatedString value) => | 151 set _svgClassName(AnimatedString value) => |
| 152 _blink.BlinkSVGElement.instance.className_Setter_(this, value); | 152 _blink.BlinkSVGElement.instance.className_Setter_(this, value); |
| 153 | 153 |
| 154 $endif | 154 $endif |
| 155 $!MEMBERS | 155 $!MEMBERS |
| 156 } | 156 } |
| OLD | NEW |