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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 _this.$dom_appendChild(iterable[0]); | 77 _this.$dom_appendChild(iterable[0]); |
78 } | 78 } |
79 } | 79 } |
80 return; | 80 return; |
81 } | 81 } |
82 for (Node node in iterable) { | 82 for (Node node in iterable) { |
83 _this.$dom_appendChild(node); | 83 _this.$dom_appendChild(node); |
84 } | 84 } |
85 } | 85 } |
86 | 86 |
| 87 void insert(int index, Node node) { |
| 88 if (index < 0 || index > length) { |
| 89 throw new RangeError.range(index, 0, length); |
| 90 } |
| 91 if (index == length) { |
| 92 _this.$dom_appendChild(node); |
| 93 } else { |
| 94 this_.insertBefore(node, this[index]); |
| 95 } |
| 96 } |
| 97 |
87 Node removeLast() { | 98 Node removeLast() { |
88 final result = last; | 99 final result = last; |
89 if (result != null) { | 100 if (result != null) { |
90 _this.$dom_removeChild(result); | 101 _this.$dom_removeChild(result); |
91 } | 102 } |
92 return result; | 103 return result; |
93 } | 104 } |
94 | 105 |
95 Node removeAt(int index) { | 106 Node removeAt(int index) { |
96 var result = this[index]; | 107 var result = this[index]; |
(...skipping 217 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
314 } | 325 } |
315 } else { | 326 } else { |
316 for (var node in newNodes) { | 327 for (var node in newNodes) { |
317 this.insertBefore(node, refChild); | 328 this.insertBefore(node, refChild); |
318 } | 329 } |
319 } | 330 } |
320 } | 331 } |
321 | 332 |
322 $!MEMBERS | 333 $!MEMBERS |
323 } | 334 } |
OLD | NEW |