| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 return _this.$dom_firstChild; | 50 return _this.$dom_firstChild; |
| 51 } | 51 } |
| 52 $endif | 52 $endif |
| 53 | 53 |
| 54 void add(Node value) { | 54 void add(Node value) { |
| 55 _this.append(value); | 55 _this.append(value); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void addAll(Iterable<Node> iterable) { | 58 void addAll(Iterable<Node> iterable) { |
| 59 if (iterable is _ChildNodeListLazy) { | 59 if (iterable is _ChildNodeListLazy) { |
| 60 if (!identical(iterable._this, _this)) { | 60 _ChildNodeListLazy otherList = iterable; |
| 61 if (!identical(otherList._this, _this)) { |
| 61 // Optimized route for copying between nodes. | 62 // Optimized route for copying between nodes. |
| 62 for (var i = 0, len = iterable.length; i < len; ++i) { | 63 for (var i = 0, len = otherList.length; i < len; ++i) { |
| 63 // Should use $dom_firstChild, Bug 8886. | 64 // Should use $dom_firstChild, Bug 8886. |
| 64 _this.append(iterable[0]); | 65 _this.append(otherList[0]); |
| 65 } | 66 } |
| 66 } | 67 } |
| 67 return; | 68 return; |
| 68 } | 69 } |
| 69 for (Node node in iterable) { | 70 for (Node node in iterable) { |
| 70 _this.append(node); | 71 _this.append(node); |
| 71 } | 72 } |
| 72 } | 73 } |
| 73 | 74 |
| 74 void insert(int index, Node node) { | 75 void insert(int index, Node node) { |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after 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 |