Index: tools/dom/templates/html/impl/impl_Element.darttemplate |
diff --git a/tools/dom/templates/html/impl/impl_Element.darttemplate b/tools/dom/templates/html/impl/impl_Element.darttemplate |
index 0fe41b01dc0cfcce5b96a9947e736582a0d02eb5..ca0e477c4016e1cf5912462438b24fc1234d5833 100644 |
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate |
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate |
@@ -297,6 +297,13 @@ class _FrozenElementList extends ListBase |
new _CssStyleDeclarationSet(this); |
void set classes(Iterable<String> value) { |
+ // TODO(sra): This might be faster for Sets: |
+ // |
+ // new _MultiElementCssClassSet(this).writeClasses(value) |
+ // |
+ // as the code below converts the Iterable[value] to a string multiple |
+ // times. Maybe |
+ |
_nodeList.forEach((e) => e.classes = value); |
} |
@@ -623,6 +630,8 @@ $(ANNOTATIONS)$(NATIVESPEC)abstract class $CLASSNAME$EXTENDS$IMPLEMENTS { |
CssClassSet get classes => new _ElementCssClassSet(this); |
void set classes(Iterable<String> value) { |
+ // TODO(sra): Do this without reading the classes in clear() and addAll(), |
+ // or writing the classes in clear(). |
CssClassSet classSet = classes; |
classSet.clear(); |
classSet.addAll(value); |