| 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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 } | 56 } |
| 57 | 57 |
| 58 Node max([int compare(Node a, Node b)]) { | 58 Node max([int compare(Node a, Node b)]) { |
| 59 return IterableMixinWorkaround.max(this, compare); | 59 return IterableMixinWorkaround.max(this, compare); |
| 60 } | 60 } |
| 61 | 61 |
| 62 void add(Node value) { | 62 void add(Node value) { |
| 63 _this.append(value); | 63 _this.append(value); |
| 64 } | 64 } |
| 65 | 65 |
| 66 void addLast(Node value) { | |
| 67 _this.append(value); | |
| 68 } | |
| 69 | |
| 70 | |
| 71 void addAll(Iterable<Node> iterable) { | 66 void addAll(Iterable<Node> iterable) { |
| 72 if (iterable is _ChildNodeListLazy) { | 67 if (iterable is _ChildNodeListLazy) { |
| 73 if (!identical(iterable._this, _this)) { | 68 if (!identical(iterable._this, _this)) { |
| 74 // Optimized route for copying between nodes. | 69 // Optimized route for copying between nodes. |
| 75 for (var i = 0, len = iterable.length; i < len; ++i) { | 70 for (var i = 0, len = iterable.length; i < len; ++i) { |
| 76 // Should use $dom_firstChild, Bug 8886. | 71 // Should use $dom_firstChild, Bug 8886. |
| 77 _this.append(iterable[0]); | 72 _this.append(iterable[0]); |
| 78 } | 73 } |
| 79 } | 74 } |
| 80 return; | 75 return; |
| (...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 if (_modelChangedStream == null) { | 408 if (_modelChangedStream == null) { |
| 414 // Ensure the model is cached locally to minimize change notifications. | 409 // Ensure the model is cached locally to minimize change notifications. |
| 415 _model = model; | 410 _model = model; |
| 416 _modelChangedStream = new StreamController.broadcast(); | 411 _modelChangedStream = new StreamController.broadcast(); |
| 417 } | 412 } |
| 418 return _modelChangedStream.stream; | 413 return _modelChangedStream.stream; |
| 419 } | 414 } |
| 420 | 415 |
| 421 $!MEMBERS | 416 $!MEMBERS |
| 422 } | 417 } |
| OLD | NEW |