Chromium Code Reviews| Index: sky/sdk/lib/rendering/object.dart |
| diff --git a/sky/sdk/lib/rendering/object.dart b/sky/sdk/lib/rendering/object.dart |
| index a21db01421615485521d0d36a5e7c7a53cb57c5e..3e92d3d9204a073fd766e0f86c0b7593cd186a84 100644 |
| --- a/sky/sdk/lib/rendering/object.dart |
| +++ b/sky/sdk/lib/rendering/object.dart |
| @@ -367,7 +367,6 @@ abstract class ContainerParentDataMixin<ChildType extends RenderObject> { |
| } |
| abstract class ContainerRenderObjectMixin<ChildType extends RenderObject, ParentDataType extends ContainerParentDataMixin<ChildType>> implements RenderObject { |
| - // abstract class that has only InlineNode children |
| bool _debugUltimatePreviousSiblingOf(ChildType child, { ChildType equals }) { |
| assert(child.parentData is ParentDataType); |
| @@ -388,12 +387,19 @@ abstract class ContainerRenderObjectMixin<ChildType extends RenderObject, Parent |
| return child == equals; |
| } |
| + int _childCount = 0; |
| + int get childCount => _childCount; |
| + |
| ChildType _firstChild; |
| ChildType _lastChild; |
| void _addToChildList(ChildType child, { ChildType before }) { |
| assert(child.parentData is ParentDataType); |
| assert(child.parentData.nextSibling == null); |
| assert(child.parentData.previousSibling == null); |
| + |
| + _childCount += 1; |
|
Hixie
2015/06/26 18:04:33
Since the rest of this function doesn't have parag
hansmuller
2015/06/26 18:16:10
Done.
|
| + assert(_childCount > 0); |
| + |
| if (before == null) { |
| // append at the end (_lastChild) |
| child.parentData.previousSibling = _lastChild; |
| @@ -448,6 +454,10 @@ abstract class ContainerRenderObjectMixin<ChildType extends RenderObject, Parent |
| assert(child.parentData is ParentDataType); |
| assert(_debugUltimatePreviousSiblingOf(child, equals: _firstChild)); |
| assert(_debugUltimateNextSiblingOf(child, equals: _lastChild)); |
| + |
| + _childCount -= 1; |
| + assert(_childCount > 0); |
| + |
|
Hixie
2015/06/26 18:04:33
ditto here
hansmuller
2015/06/26 18:16:10
Done.
|
| if (child.parentData.previousSibling == null) { |
| assert(_firstChild == child); |
| _firstChild = child.parentData.nextSibling; |