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

Unified Diff: sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate

Issue 11398002: Splitting SVG types out of dart:html. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Minifying. Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate
diff --git a/sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate b/sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate
index aa9acfacd7de8e9c9503cb3602970b01e8c63073..7315823d2852fbea9711932b57598191c64e57d3 100644
--- a/sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate
+++ b/sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate
@@ -2,14 +2,27 @@
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
-part of html;
+part of svg;
-class _AttributeClassSet extends _CssClassSet {
- _AttributeClassSet(element) : super(element);
+class _AttributeClassSet extends CssClassSet {
+ final Element _element;
- String $dom_className() => _element.attributes['class'];
+ _AttributeClassSet(this._element);
- void _write(Set s) {
+ Set<String> readClasses() {
+ var classname = _element.attributes['class'];
+
+ Set<String> s = new Set<String>();
+ for (String name in classname.split(' ')) {
+ String trimmed = name.trim();
+ if (!trimmed.isEmpty) {
+ s.add(trimmed);
+ }
+ }
+ return s;
+ }
+
+ void writeClasses(Set s) {
_element.attributes['class'] = _formatSet(s);
}
}
@@ -27,7 +40,7 @@ class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
return _cssClassSet;
}
- List<Element> get elements => new _FilteredElementList(this);
+ List<Element> get elements => new FilteredElementList(this);
void set elements(Collection<Element> value) {
final elements = this.elements;

Powered by Google App Engine
This is Rietveld 408576698