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

Side by Side Diff: sky/framework/fn.dart

Issue 1050153002: [Effen] fix _ensureDepth to work on root of tree, oops (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 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:
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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
87 void _sync(UINode old, sky.ParentNode host, sky.Node insertBefore); 87 void _sync(UINode old, sky.ParentNode host, sky.Node insertBefore);
88 88
89 void _remove() { 89 void _remove() {
90 _defunct = true; 90 _defunct = true;
91 _root = null; 91 _root = null;
92 } 92 }
93 93
94 int _nodeDepth; 94 int _nodeDepth;
95 void _ensureDepth() { 95 void _ensureDepth() {
96 if (_nodeDepth == null) { 96 if (_nodeDepth == null) {
97 _parent.ensureDepth(); 97 if (_parent != null) {
98 _nodeDepth = _parent._nodeDepth + 1; 98 _parent.ensureDepth();
99 _nodeDepth = _parent._nodeDepth + 1;
100 } else {
101 _nodeDepth = 0;
102 }
99 } 103 }
100 } 104 }
101 105
102 void _trace(String message) { 106 void _trace(String message) {
103 if (!_shouldTrace) 107 if (!_shouldTrace)
104 return; 108 return;
105 109
106 _ensureDepth(); 110 _ensureDepth();
107 print((' ' * _nodeDepth) + message); 111 print((' ' * _nodeDepth) + message);
108 } 112 }
(...skipping 780 matching lines...) Expand 10 before | Expand all | Expand 10 after
889 893
890 abstract class App extends Component { 894 abstract class App extends Component {
891 sky.Node _host; 895 sky.Node _host;
892 896
893 App() : super(stateful: true) { 897 App() : super(stateful: true) {
894 _host = sky.document.createElement('div'); 898 _host = sky.document.createElement('div');
895 sky.document.appendChild(_host); 899 sky.document.appendChild(_host);
896 _scheduleComponentForRender(this); 900 _scheduleComponentForRender(this);
897 } 901 }
898 } 902 }
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