| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 | 223 |
| 224 /** | 224 /** |
| 225 * Inserts all of the nodes into this node directly before refChild. | 225 * Inserts all of the nodes into this node directly before refChild. |
| 226 * | 226 * |
| 227 * See also: | 227 * See also: |
| 228 * | 228 * |
| 229 * * [insertBefore] | 229 * * [insertBefore] |
| 230 */ | 230 */ |
| 231 Node insertAllBefore(Iterable<Node> newNodes, Node refChild) { | 231 Node insertAllBefore(Iterable<Node> newNodes, Node refChild) { |
| 232 if (newNodes is _ChildNodeListLazy) { | 232 if (newNodes is _ChildNodeListLazy) { |
| 233 if (identical(newNodes._this, this)) { | 233 _ChildNodeListLazy otherList = newNodes; |
| 234 if (identical(otherList._this, this)) { |
| 234 throw new ArgumentError(newNodes); | 235 throw new ArgumentError(newNodes); |
| 235 } | 236 } |
| 236 | 237 |
| 237 // Optimized route for copying between nodes. | 238 // Optimized route for copying between nodes. |
| 238 for (var i = 0, len = newNodes.length; i < len; ++i) { | 239 for (var i = 0, len = otherList.length; i < len; ++i) { |
| 239 // Should use $dom_firstChild, Bug 8886. | 240 // Should use $dom_firstChild, Bug 8886. |
| 240 this.insertBefore(newNodes[0], refChild); | 241 this.insertBefore(otherList[0], refChild); |
| 241 } | 242 } |
| 242 } else { | 243 } else { |
| 243 for (var node in newNodes) { | 244 for (var node in newNodes) { |
| 244 this.insertBefore(node, refChild); | 245 this.insertBefore(node, refChild); |
| 245 } | 246 } |
| 246 } | 247 } |
| 247 } | 248 } |
| 248 | 249 |
| 249 /** | 250 /** |
| 250 * Print out a String representation of this Node. | 251 * Print out a String representation of this Node. |
| (...skipping 22 matching lines...) Expand all Loading... |
| 273 TemplateInstance _templateInstance; | 274 TemplateInstance _templateInstance; |
| 274 | 275 |
| 275 /** Gets the template instance that instantiated this node, if any. */ | 276 /** Gets the template instance that instantiated this node, if any. */ |
| 276 @Experimental | 277 @Experimental |
| 277 TemplateInstance get templateInstance => | 278 TemplateInstance get templateInstance => |
| 278 _templateInstance != null ? _templateInstance : | 279 _templateInstance != null ? _templateInstance : |
| 279 (parent != null ? parent.templateInstance : null); | 280 (parent != null ? parent.templateInstance : null); |
| 280 | 281 |
| 281 $!MEMBERS | 282 $!MEMBERS |
| 282 } | 283 } |
| OLD | NEW |