| OLD | NEW |
| 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 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 * A list of this node's children. | 284 * A list of this node's children. |
| 285 * | 285 * |
| 286 * ## Other resources | 286 * ## Other resources |
| 287 * | 287 * |
| 288 * * [Node.childNodes] | 288 * * [Node.childNodes] |
| 289 * (https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes) | 289 * (https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes) |
| 290 * from MDN. | 290 * from MDN. |
| 291 */ | 291 */ |
| 292 @DomName('Node.childNodes') | 292 @DomName('Node.childNodes') |
| 293 @DocsEditable() | 293 @DocsEditable() |
| 294 @Returns('NodeList') | |
| 295 @Creates('NodeList') | |
| 296 List<Node> get childNodes { | 294 List<Node> get childNodes { |
| 297 if (_childNodes == null) { | 295 if (_childNodes == null) { |
| 298 List<Node> nodes = new List<Node>(); | 296 List<Node> nodes = new List<Node>(); |
| 299 var jsCollection = _blink.BlinkNode.instance.childNodes_Getter_(unwrap_js
o(this)); | 297 var jsCollection = _blink.BlinkNode.instance.childNodes_Getter_(unwrap_js
o(this)); |
| 300 var collectionLen = jsCollection['length']; | 298 var collectionLen = jsCollection['length']; |
| 301 for (var i = 0; i < collectionLen; i++) { | 299 for (var i = 0; i < collectionLen; i++) { |
| 302 nodes.add(wrap_jso(jsCollection.callMethod('item', [i]))); | 300 nodes.add(wrap_jso(jsCollection.callMethod('item', [i]))); |
| 303 } | 301 } |
| 304 _childNodes = nodes; | 302 _childNodes = nodes; |
| 305 } | 303 } |
| 306 return _childNodes; | 304 return _childNodes; |
| 307 } | 305 } |
| 308 $else | 306 $else |
| 309 $if DARTIUM | 307 $if DARTIUM |
| 310 /** | 308 /** |
| 311 * A list of this node's children. | 309 * A list of this node's children. |
| 312 * | 310 * |
| 313 * ## Other resources | 311 * ## Other resources |
| 314 * | 312 * |
| 315 * * [Node.childNodes] | 313 * * [Node.childNodes] |
| 316 * (https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes) | 314 * (https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes) |
| 317 * from MDN. | 315 * from MDN. |
| 318 */ | 316 */ |
| 319 @DomName('Node.childNodes') | 317 @DomName('Node.childNodes') |
| 320 @DocsEditable() | 318 @DocsEditable() |
| 321 @Returns('NodeList') | |
| 322 @Creates('NodeList') | |
| 323 List<Node> get childNodes => _blink.BlinkNode.instance.childNodes_Getter_(this
); | 319 List<Node> get childNodes => _blink.BlinkNode.instance.childNodes_Getter_(this
); |
| 324 $else | 320 $else |
| 325 /** | 321 /** |
| 326 * A list of this node's children. | 322 * A list of this node's children. |
| 327 * | 323 * |
| 328 * ## Other resources | 324 * ## Other resources |
| 329 * | 325 * |
| 330 * * [Node.childNodes] | 326 * * [Node.childNodes] |
| 331 * (https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes) | 327 * (https://developer.mozilla.org/en-US/docs/Web/API/Node.childNodes) |
| 332 * from MDN. | 328 * from MDN. |
| 333 */ | 329 */ |
| 334 @DomName('Node.childNodes') | 330 @DomName('Node.childNodes') |
| 335 @DocsEditable() | 331 @DocsEditable() |
| 336 @Returns('NodeList') | 332 @Returns('NodeList') |
| 337 @Creates('NodeList') | 333 @Creates('NodeList') |
| 338 final List<Node> childNodes; | 334 final List<Node> childNodes; |
| 339 | 335 |
| 340 $endif | 336 $endif |
| 341 $endif | 337 $endif |
| 342 $!MEMBERS | 338 $!MEMBERS |
| 343 } | 339 } |
| OLD | NEW |