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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 library fn; 5 library fn;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 import 'dart:collection'; 8 import 'dart:collection';
9 import 'dart:sky' as sky; 9 import 'dart:sky' as sky;
10 import 'reflect.dart' as reflect; 10 import 'reflect.dart' as reflect;
(...skipping 597 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 _currentOrder = _order; 608 _currentOrder = _order;
609 _currentlyRendering = this; 609 _currentlyRendering = this;
610 _rendered = render(); 610 _rendered = render();
611 _currentlyRendering = null; 611 _currentlyRendering = null;
612 _currentOrder = lastOrder; 612 _currentOrder = lastOrder;
613 613
614 _rendered.events.addAll(events); 614 _rendered.events.addAll(events);
615 615
616 _dirty = false; 616 _dirty = false;
617 617
618 if (oldRendered != null && _rendered.runtimeType != oldRendered.runtimeType) 618 // 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,
619 // new component was rendered that could re-use some of it. Consider
620 // 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.
621 if (oldRendered != null && _rendered.runtimeType != oldRendered.runtimeType) {
622 oldRendered._remove();
619 oldRendered = null; 623 oldRendered = null;
624 }
620 625
621 if (_rendered._sync(oldRendered, host, insertBefore)) { 626 if (_rendered._sync(oldRendered, host, insertBefore)) {
622 _rendered = oldRendered; // retain stateful component 627 _rendered = oldRendered; // retain stateful component
623 } 628 }
624 _root = _rendered._root; 629 _root = _rendered._root;
625 assert(_rendered._root is sky.Node); 630 assert(_rendered._root is sky.Node);
626 631
627 if (mounting) { 632 if (mounting) {
628 didMount(); 633 didMount();
629 } 634 }
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
666 671
667 _sync(null, _host, null); 672 _sync(null, _host, null);
668 assert(_root is sky.Node); 673 assert(_root is sky.Node);
669 674
670 sw.stop(); 675 sw.stop();
671 if (_shouldLogRenderDuration) 676 if (_shouldLogRenderDuration)
672 print("Initial render: ${sw.elapsedMicroseconds} microseconds"); 677 print("Initial render: ${sw.elapsedMicroseconds} microseconds");
673 }); 678 });
674 } 679 }
675 } 680 }
OLDNEW
« 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