Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1131)

Unified Diff: sdk/lib/html/dartium/html_dartium.dart

Side-by-side diff isn't available for this file because of its large size.
Issue 14200026: Fix bad html library. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
Download patch
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/html/dartium/html_dartium.dart
diff --git a/sdk/lib/html/dartium/html_dartium.dart b/sdk/lib/html/dartium/html_dartium.dart
index e61206e48baaf61cd1c0412331d64a1a5f172c09..f62c4ac11af0ab242d4aef15f38fcd8a04290590 100644
--- a/sdk/lib/html/dartium/html_dartium.dart
+++ b/sdk/lib/html/dartium/html_dartium.dart
@@ -18702,7 +18702,7 @@ class Node extends EventTarget {
// notifications.
var _model;
bool _hasLocalModel;
- StreamController<Node> _modelChangedStream;
+ Set<StreamController<Node>> _modelChangedStreams;
/**
* The data model which is inherited through the tree.
@@ -18719,7 +18719,7 @@ class Node extends EventTarget {
@Experimental
get model {
// If we have a change handler then we've cached the model locally.
- if (_modelChangedStream != null) {
+ if (!_modelChangedStreams.isEmpty) {
return _model;
}
// Otherwise start looking up the tree.
@@ -18739,8 +18739,8 @@ class Node extends EventTarget {
_ModelTreeObserver.initialize();
if (changed) {
- if (_modelChangedStream != null) {
- _modelChangedStream.add(this);
+ if (!_modelChangedStreams.isEmpty) {
+ _modelChangedStreams.toList().forEach((stream) => stream.add(this));
}
// Propagate new model to all descendants.
_ModelTreeObserver.propagateModel(this, value, false);
@@ -18769,12 +18769,11 @@ class Node extends EventTarget {
* Get a stream of models, whenever the model changes.
*/
Stream<Node> get onModelChanged {
- if (_modelChangedStream == null) {
- // Ensure the model is cached locally to minimize change notifications.
- _model = model;
- _modelChangedStream = new StreamController();
- }
- return _modelChangedStream.stream;
+ var result;
+ result = new StreamController(
+ onListen: () { _modelChangedStreams.add(result); },
+ onCancel: () { _modelChangedStreams.remove(result); });
+ return result;
}
/**
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | tools/dom/templates/html/impl/impl_Node.darttemplate » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698