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