| 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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 } else { | 331 } else { |
| 332 for (var node in newNodes) { | 332 for (var node in newNodes) { |
| 333 this.insertBefore(node, refChild); | 333 this.insertBefore(node, refChild); |
| 334 } | 334 } |
| 335 } | 335 } |
| 336 } | 336 } |
| 337 | 337 |
| 338 // Note that this may either be the locally set model or a cached value | 338 // Note that this may either be the locally set model or a cached value |
| 339 // of the inherited model. This is cached to minimize model change | 339 // of the inherited model. This is cached to minimize model change |
| 340 // notifications. | 340 // notifications. |
| 341 $if DART2JS |
| 342 @Creates('Null') |
| 343 $endif |
| 341 var _model; | 344 var _model; |
| 342 bool _hasLocalModel; | 345 bool _hasLocalModel; |
| 343 StreamController<Node> _modelChangedStream; | 346 StreamController<Node> _modelChangedStream; |
| 344 | 347 |
| 345 /** | 348 /** |
| 346 * The data model which is inherited through the tree. | 349 * The data model which is inherited through the tree. |
| 347 * | 350 * |
| 348 * Setting this will propagate the value to all descendant nodes. If the | 351 * Setting this will propagate the value to all descendant nodes. If the |
| 349 * model is not set on this node then it will be inherited from ancestor | 352 * model is not set on this node then it will be inherited from ancestor |
| 350 * nodes. | 353 * nodes. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 if (_modelChangedStream == null) { | 413 if (_modelChangedStream == null) { |
| 411 // Ensure the model is cached locally to minimize change notifications. | 414 // Ensure the model is cached locally to minimize change notifications. |
| 412 _model = model; | 415 _model = model; |
| 413 _modelChangedStream = new StreamController.broadcast(); | 416 _modelChangedStream = new StreamController.broadcast(); |
| 414 } | 417 } |
| 415 return _modelChangedStream.stream; | 418 return _modelChangedStream.stream; |
| 416 } | 419 } |
| 417 | 420 |
| 418 $!MEMBERS | 421 $!MEMBERS |
| 419 } | 422 } |
| OLD | NEW |