| OLD | NEW |
| 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 import 'dart:async'; | 5 import 'dart:async'; |
| 6 import 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'dart:mirrors'; | 7 import 'dart:mirrors'; |
| 8 import 'dart:sky' as sky; | 8 import 'dart:sky' as sky; |
| 9 | 9 |
| 10 import '../app/view.dart'; | 10 import '../app/view.dart'; |
| (...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 496 void _sync(Widget old, dynamic slot) { | 496 void _sync(Widget old, dynamic slot) { |
| 497 // TODO(abarth): We should split RenderObjectWrapper into two pieces so that | 497 // TODO(abarth): We should split RenderObjectWrapper into two pieces so that |
| 498 // RenderViewObject doesn't need to inherit all this code it | 498 // RenderViewObject doesn't need to inherit all this code it |
| 499 // doesn't need. | 499 // doesn't need. |
| 500 assert(parent != null || this is RenderViewWrapper); | 500 assert(parent != null || this is RenderViewWrapper); |
| 501 if (old == null) { | 501 if (old == null) { |
| 502 _root = createNode(); | 502 _root = createNode(); |
| 503 _ancestor = findAncestor(RenderObjectWrapper); | 503 _ancestor = findAncestor(RenderObjectWrapper); |
| 504 if (_ancestor is RenderObjectWrapper) | 504 if (_ancestor is RenderObjectWrapper) |
| 505 _ancestor.insert(this, slot); | 505 _ancestor.insert(this, slot); |
| 506 else | |
| 507 print("$this has no ancestor"); | |
| 508 } else { | 506 } else { |
| 509 _root = old.root; | 507 _root = old.root; |
| 510 _ancestor = old._ancestor; | 508 _ancestor = old._ancestor; |
| 511 } | 509 } |
| 512 assert(_root == root); // in case a subclass reintroduces it | 510 assert(_root == root); // in case a subclass reintroduces it |
| 513 assert(root != null); | 511 assert(root != null); |
| 514 assert(mounted); | 512 assert(mounted); |
| 515 _nodeMap[root] = this; | 513 _nodeMap[root] = this; |
| 516 syncRenderObject(old); | 514 syncRenderObject(old); |
| 517 } | 515 } |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 881 if (root.parent == null) { | 879 if (root.parent == null) { |
| 882 // we haven't attached it yet | 880 // we haven't attached it yet |
| 883 assert(_container.child == null); | 881 assert(_container.child == null); |
| 884 _container.child = root; | 882 _container.child = root; |
| 885 } | 883 } |
| 886 assert(root.parent == _container); | 884 assert(root.parent == _container); |
| 887 } | 885 } |
| 888 | 886 |
| 889 Widget build() => builder(); | 887 Widget build() => builder(); |
| 890 } | 888 } |
| OLD | NEW |