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

Side by Side 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 /** 7 /**
8 * Lazy implementation of the child nodes of an element that does not request 8 * Lazy implementation of the child nodes of an element that does not request
9 * the actual child nodes of an element until strictly necessary greatly 9 * the actual child nodes of an element until strictly necessary greatly
10 * improving performance for the typical cases where it is not required. 10 * improving performance for the typical cases where it is not required.
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 } 269 }
270 } 270 }
271 271
272 /** 272 /**
273 * Print out a String representation of this Node. 273 * Print out a String representation of this Node.
274 */ 274 */
275 String toString() { 275 String toString() {
276 String value = nodeValue; // Fetch DOM Node property once. 276 String value = nodeValue; // Fetch DOM Node property once.
277 return value == null ? super.toString() : value; 277 return value == null ? super.toString() : value;
278 } 278 }
279
280 $if JSINTEROP
281 List<Node> _childNodes;
282
283 /**
284 * A list of this node's children.
285 *
286 * ## Other resources
287 *
288 * * [Node.childNodes]
289 * (https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes)
290 * from MDN.
291 */
292 @DomName('Node.childNodes')
293 @DocsEditable()
294 List<Node> get childNodes {
295 if (_childNodes == null) {
296 window.console.log(">>> construct childNodes collection/list");
297 List<Node> nodes = new List<Node>();
298 var jsCollection = _blink.BlinkNode.instance.childNodes_Getter_(unwrap_js o(this));
299 var collectionLen = jsCollection['length'];
300 for (var i = 0; i < collectionLen; i++) {
301 nodes.add(wrap_jso(jsCollection.callMethod('item', [i])));
302 }
303 _childNodes = nodes;
304 }
305 return _childNodes;
306 }
307 $else
308 /**
309 * A list of this node's children.
310 *
311 * ## Other resources
312 *
313 * * [Node.childNodes]
314 * (https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes)
315 * from MDN.
316 */
317 @DomName('Node.childNodes')
318 @DocsEditable()
319 @Returns('NodeList')
320 @Creates('NodeList')
321 final List<Node> childNodes;
322
323 $endif
279 $!MEMBERS 324 $!MEMBERS
280 } 325 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698