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

Side by Side Diff: sky/sdk/lib/framework/rendering/object.dart

Issue 1151533006: We don't necessarily have a child, so debugDescribeChildren() needs to check for null. (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 | « 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 import '../node.dart'; 5 import '../node.dart';
6 import '../scheduler.dart' as scheduler; 6 import '../scheduler.dart' as scheduler;
7 import 'dart:math' as math; 7 import 'dart:math' as math;
8 import 'dart:sky' as sky; 8 import 'dart:sky' as sky;
9 9
10 class ParentData { 10 class ParentData {
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 adoptChild(_child); 258 adoptChild(_child);
259 } 259 }
260 void attachChildren() { 260 void attachChildren() {
261 if (_child != null) 261 if (_child != null)
262 _child.attach(); 262 _child.attach();
263 } 263 }
264 void detachChildren() { 264 void detachChildren() {
265 if (_child != null) 265 if (_child != null)
266 _child.detach(); 266 _child.detach();
267 } 267 }
268 String debugDescribeChildren(String prefix) => '${prefix}child: ${child.toStri ng(prefix)}'; 268 String debugDescribeChildren(String prefix) {
269 if (child != null)
270 return '${prefix}child: ${child.toString(prefix)}';
271 return '';
272 }
269 } 273 }
270 274
271 275
272 // GENERIC MIXIN FOR RENDER NODES WITH A LIST OF CHILDREN 276 // GENERIC MIXIN FOR RENDER NODES WITH A LIST OF CHILDREN
273 277
274 abstract class ContainerParentDataMixin<ChildType extends RenderObject> { 278 abstract class ContainerParentDataMixin<ChildType extends RenderObject> {
275 ChildType previousSibling; 279 ChildType previousSibling;
276 ChildType nextSibling; 280 ChildType nextSibling;
277 void detachSiblings() { 281 void detachSiblings() {
278 if (previousSibling != null) { 282 if (previousSibling != null) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 while (child != null) { 427 while (child != null) {
424 if (result != '') 428 if (result != '')
425 result += '\n'; 429 result += '\n';
426 result += '${prefix}child ${count}: ${child.toString(prefix)}'; 430 result += '${prefix}child ${count}: ${child.toString(prefix)}';
427 count += 1; 431 count += 1;
428 child = child.parentData.nextSibling; 432 child = child.parentData.nextSibling;
429 } 433 }
430 return result; 434 return result;
431 } 435 }
432 } 436 }
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