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

Unified Diff: sky/framework/fn.dart

Issue 984983004: Correctly allow components to return different top-level nodes during different renderings (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: remove test file Created 5 years, 9 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:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/framework/fn.dart
diff --git a/sky/framework/fn.dart b/sky/framework/fn.dart
index fc6ef99bbd974e84918e8c736dfef6b88fda846a..1811a705f272c90890aea66523766214d949b23c 100644
--- a/sky/framework/fn.dart
+++ b/sky/framework/fn.dart
@@ -615,8 +615,13 @@ abstract class Component extends Node {
_dirty = false;
- if (oldRendered != null && _rendered.runtimeType != oldRendered.runtimeType)
+ // TODO(rafaelw): This eagerly removes the old VDOM. It may be that a
Hixie 2015/03/06 21:32:52 Do you mean VDOM here, or DOM? _remove() seems to
rafaelw 2015/03/06 21:37:29 You are correct, it is actually both (concretely,
+ // new component was rendered that could re-use some of it. Consider
+ // syncing the new VDROM against the old one.
Hixie 2015/03/06 21:32:52 s/VDROM/VDOM/?
rafaelw 2015/03/06 21:37:29 Yeah, I fixed that before landing.
+ if (oldRendered != null && _rendered.runtimeType != oldRendered.runtimeType) {
+ oldRendered._remove();
oldRendered = null;
+ }
if (_rendered._sync(oldRendered, host, insertBefore)) {
_rendered = oldRendered; // retain stateful component
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698