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

Side by Side Diff: sky/sdk/lib/widgets/widget.dart

Issue 1191443009: Introduce a LeafRenderObjectWrapper abstract class so that RenderObjectWrappers that are leaves don… (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 6 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 | « sky/sdk/lib/widgets/basic.dart ('k') | 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 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 531 matching lines...) Expand 10 before | Expand all | Expand 10 after
542 } 542 }
543 543
544 void detachRoot() { 544 void detachRoot() {
545 assert(_ancestor != null); 545 assert(_ancestor != null);
546 assert(root != null); 546 assert(root != null);
547 _ancestor.detachChildRoot(this); 547 _ancestor.detachChildRoot(this);
548 } 548 }
549 549
550 } 550 }
551 551
552 abstract class LeafRenderObjectWrapper extends RenderObjectWrapper {
553
554 LeafRenderObjectWrapper({ String key }) : super(key: key);
555
556 void insertChildRoot(RenderObjectWrapper child, dynamic slot) {
557 assert(false);
558 }
559
560 void detachChildRoot(RenderObjectWrapper child) {
561 assert(false);
562 }
563
564 }
565
552 abstract class OneChildRenderObjectWrapper extends RenderObjectWrapper { 566 abstract class OneChildRenderObjectWrapper extends RenderObjectWrapper {
553 567
554 OneChildRenderObjectWrapper({ String key, Widget child }) 568 OneChildRenderObjectWrapper({ String key, Widget child })
555 : _child = child, super(key: key); 569 : _child = child, super(key: key);
556 570
557 Widget _child; 571 Widget _child;
558 Widget get child => _child; 572 Widget get child => _child;
559 573
560 void syncRenderObject(RenderObjectWrapper old) { 574 void syncRenderObject(RenderObjectWrapper old) {
561 super.syncRenderObject(old); 575 super.syncRenderObject(old);
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 if (root.parent == null) { 894 if (root.parent == null) {
881 // we haven't attached it yet 895 // we haven't attached it yet
882 assert(_container.child == null); 896 assert(_container.child == null);
883 _container.child = root; 897 _container.child = root;
884 } 898 }
885 assert(root.parent == _container); 899 assert(root.parent == _container);
886 } 900 }
887 901
888 Widget build() => builder(); 902 Widget build() => builder();
889 } 903 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/widgets/basic.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698