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

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

Issue 1221473002: Corrected a childCount assert (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 5 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 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 import 'dart:sky' show Point, Size, Rect, Color, Paint, Path; 7 import 'dart:sky' show Point, Size, Rect, Color, Paint, Path;
8 8
9 import '../base/hit_test.dart'; 9 import '../base/hit_test.dart';
10 import '../base/node.dart'; 10 import '../base/node.dart';
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
446 void addAll(List<ChildType> children) { 446 void addAll(List<ChildType> children) {
447 if (children != null) 447 if (children != null)
448 for (ChildType child in children) 448 for (ChildType child in children)
449 add(child); 449 add(child);
450 } 450 }
451 void _removeFromChildList(ChildType child) { 451 void _removeFromChildList(ChildType child) {
452 assert(child.parentData is ParentDataType); 452 assert(child.parentData is ParentDataType);
453 assert(_debugUltimatePreviousSiblingOf(child, equals: _firstChild)); 453 assert(_debugUltimatePreviousSiblingOf(child, equals: _firstChild));
454 assert(_debugUltimateNextSiblingOf(child, equals: _lastChild)); 454 assert(_debugUltimateNextSiblingOf(child, equals: _lastChild));
455 _childCount -= 1; 455 _childCount -= 1;
456 assert(_childCount > 0); 456 assert(_childCount >= 0);
457 if (child.parentData.previousSibling == null) { 457 if (child.parentData.previousSibling == null) {
458 assert(_firstChild == child); 458 assert(_firstChild == child);
459 _firstChild = child.parentData.nextSibling; 459 _firstChild = child.parentData.nextSibling;
460 } else { 460 } else {
461 assert(child.parentData.previousSibling.parentData is ParentDataType); 461 assert(child.parentData.previousSibling.parentData is ParentDataType);
462 child.parentData.previousSibling.parentData.nextSibling = child.parentData .nextSibling; 462 child.parentData.previousSibling.parentData.nextSibling = child.parentData .nextSibling;
463 } 463 }
464 if (child.parentData.nextSibling == null) { 464 if (child.parentData.nextSibling == null) {
465 assert(_lastChild == child); 465 assert(_lastChild == child);
466 _lastChild = child.parentData.previousSibling; 466 _lastChild = child.parentData.previousSibling;
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 int count = 1; 531 int count = 1;
532 ChildType child = _firstChild; 532 ChildType child = _firstChild;
533 while (child != null) { 533 while (child != null) {
534 result += '${prefix}child ${count}: ${child.toString(prefix)}'; 534 result += '${prefix}child ${count}: ${child.toString(prefix)}';
535 count += 1; 535 count += 1;
536 child = child.parentData.nextSibling; 536 child = child.parentData.nextSibling;
537 } 537 }
538 return result; 538 return result;
539 } 539 }
540 } 540 }
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