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

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

Issue 11358249: Fixing SVGElement.classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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
« no previous file with comments | « no previous file | sdk/lib/svg/dart2js/svg_dart2js.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 7315823d2852fbea9711932b57598191c64e57d3..077a8077cae10f650bf2cd971fbae57613e2a7e7 100644
--- a/sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate
+++ b/sdk/lib/html/templates/html/impl/impl_SVGElement.darttemplate
@@ -13,6 +13,9 @@ class _AttributeClassSet extends CssClassSet {
var classname = _element.attributes['class'];
Set<String> s = new Set<String>();
+ if (classname == null) {
+ return s;
+ }
for (String name in classname.split(' ')) {
String trimmed = name.trim();
if (!trimmed.isEmpty) {
@@ -23,7 +26,8 @@ class _AttributeClassSet extends CssClassSet {
}
void writeClasses(Set s) {
- _element.attributes['class'] = _formatSet(s);
Emily Fortuna 2012/11/14 23:33:24 wow, did this just not work before? I can't find _
blois 2012/11/14 23:37:19 I would have broken this with some refactoring tha
+ List list = new List.from(s);
+ _element.attributes['class'] = Strings.join(list, ' ');
}
}
@@ -33,9 +37,10 @@ class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
factory $CLASSNAME.svg(String svg) =>
_$(CLASSNAME)FactoryProvider.create$(CLASSNAME)_svg(svg);
+ _AttributeClassSet _cssClassSet;
CssClassSet get classes {
if (_cssClassSet == null) {
- _cssClassSet = new _AttributeClassSet(_ptr);
+ _cssClassSet = new _AttributeClassSet(this);
}
return _cssClassSet;
}
« no previous file with comments | « no previous file | sdk/lib/svg/dart2js/svg_dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698