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

Unified Diff: tools/dom/templates/html/impl/impl_Element.darttemplate

Issue 891583002: Add type annotations to some dart:html closures (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months 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 | « tools/dom/src/CssClassSet.dart ('k') | tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« no previous file with comments | « tools/dom/src/CssClassSet.dart ('k') | tools/dom/templates/html/impl/impl_XMLHttpRequest.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698