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

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

Issue 1173403004: Changed to use JSInterop (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Re-gen'd somehow diffs stopped showing up in CL Created 5 years, 5 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
Index: tools/dom/templates/html/impl/impl_Node.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_Node.darttemplate b/tools/dom/templates/html/impl/impl_Node.darttemplate
index 166c34603b2628f9eec8965cb68625f3c97eb82e..4ebc8bea43dc2abadaa96fa490f7e147bd353cfa 100644
--- a/tools/dom/templates/html/impl/impl_Node.darttemplate
+++ b/tools/dom/templates/html/impl/impl_Node.darttemplate
@@ -276,5 +276,50 @@ $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS$IMPLEMENTS
String value = nodeValue; // Fetch DOM Node property once.
return value == null ? super.toString() : value;
}
+
+$if JSINTEROP
+ List<Node> _childNodes;
+
+ /**
+ * A list of this node's children.
+ *
+ * ## Other resources
+ *
+ * * [Node.childNodes]
+ * (https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes)
+ * from MDN.
+ */
+ @DomName('Node.childNodes')
+ @DocsEditable()
+ List<Node> get childNodes {
+ if (_childNodes == null) {
+ window.console.log(">>> construct childNodes collection/list");
+ List<Node> nodes = new List<Node>();
+ var jsCollection = _blink.BlinkNode.instance.childNodes_Getter_(unwrap_jso(this));
+ var collectionLen = jsCollection['length'];
+ for (var i = 0; i < collectionLen; i++) {
+ nodes.add(wrap_jso(jsCollection.callMethod('item', [i])));
+ }
+ _childNodes = nodes;
+ }
+ return _childNodes;
+ }
+$else
+ /**
+ * A list of this node's children.
+ *
+ * ## Other resources
+ *
+ * * [Node.childNodes]
+ * (https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes)
+ * from MDN.
+ */
+ @DomName('Node.childNodes')
+ @DocsEditable()
+ @Returns('NodeList')
+ @Creates('NodeList')
+ final List<Node> childNodes;
+
+$endif
$!MEMBERS
}

Powered by Google App Engine
This is Rietveld 408576698