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

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

Issue 11413071: Deprecating Element.elements for Element.children. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Review feedback. 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 | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/html/templates/html/impl/impl_Element.darttemplate » ('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_DocumentFragment.darttemplate
diff --git a/sdk/lib/html/templates/html/impl/impl_DocumentFragment.darttemplate b/sdk/lib/html/templates/html/impl/impl_DocumentFragment.darttemplate
index 98185a47c1f14c9b70a6fa0d1777bbeb76d8c4b8..22ec7403bd93f6b1645233718460c84959fc0ab5 100644
--- a/sdk/lib/html/templates/html/impl/impl_DocumentFragment.darttemplate
+++ b/sdk/lib/html/templates/html/impl/impl_DocumentFragment.darttemplate
@@ -28,22 +28,30 @@ class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
factory $CLASSNAME.svg(String svgContent) =>
_$(CLASSNAME)FactoryProvider.createDocumentFragment_svg(svgContent);
- List<Element> _elements;
+ List<Element> get elements => this.children;
- List<Element> get elements {
- if (_elements == null) {
- _elements = new FilteredElementList(this);
+ // TODO: The type of value should be Collection<Element>. See http://b/5392897
+ void set elements(value) {
+ this.children = value;
+ }
+
+ // Native field is used only by Dart code so does not lead to instantiation
+ // of native classes
+ @Creates('Null')
+ List<Element> _children;
+ List<Element> get children {
+ if (_children == null) {
+ _children = new FilteredElementList(this);
}
- return _elements;
+ return _children;
}
- // TODO: The type of value should be Collection<Element>. See http://b/5392897
- void set elements(value) {
+ void set children(Collection<Element> value) {
// Copy list first since we don't want liveness during iteration.
List copy = new List.from(value);
- final elements = this.elements;
- elements.clear();
- elements.addAll(copy);
+ var children = this.children;
+ children.clear();
+ children.addAll(copy);
}
Element query(String selectors) => $dom_querySelector(selectors);
« no previous file with comments | « sdk/lib/html/dartium/html_dartium.dart ('k') | sdk/lib/html/templates/html/impl/impl_Element.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698