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..f263b294eb1ee2a1759c6c2be4387c5ea4c61773 100644 |
--- a/tools/dom/templates/html/impl/impl_Element.darttemplate |
+++ b/tools/dom/templates/html/impl/impl_Element.darttemplate |
@@ -297,6 +297,12 @@ 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 compute the string and set className here. |
_nodeList.forEach((e) => e.classes = value); |
} |
@@ -623,6 +629,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); |