| OLD | NEW |
| 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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 401 } | 401 } |
| 402 void add(ChildType child, { ChildType before }) { | 402 void add(ChildType child, { ChildType before }) { |
| 403 assert(child != this); | 403 assert(child != this); |
| 404 assert(before != this); | 404 assert(before != this); |
| 405 assert(child != before); | 405 assert(child != before); |
| 406 assert(child != _firstChild); | 406 assert(child != _firstChild); |
| 407 assert(child != _lastChild); | 407 assert(child != _lastChild); |
| 408 adoptChild(child); | 408 adoptChild(child); |
| 409 _addToChildList(child, before: before); | 409 _addToChildList(child, before: before); |
| 410 } | 410 } |
| 411 void addAll(List<ChildType> children) { |
| 412 if (children != null) |
| 413 for (ChildType child in children) |
| 414 add(child); |
| 415 } |
| 411 void _removeFromChildList(ChildType child) { | 416 void _removeFromChildList(ChildType child) { |
| 412 assert(child.parentData is ParentDataType); | 417 assert(child.parentData is ParentDataType); |
| 413 assert(_debugUltimatePreviousSiblingOf(child, equals: _firstChild)); | 418 assert(_debugUltimatePreviousSiblingOf(child, equals: _firstChild)); |
| 414 assert(_debugUltimateNextSiblingOf(child, equals: _lastChild)); | 419 assert(_debugUltimateNextSiblingOf(child, equals: _lastChild)); |
| 415 if (child.parentData.previousSibling == null) { | 420 if (child.parentData.previousSibling == null) { |
| 416 assert(_firstChild == child); | 421 assert(_firstChild == child); |
| 417 _firstChild = child.parentData.nextSibling; | 422 _firstChild = child.parentData.nextSibling; |
| 418 } else { | 423 } else { |
| 419 assert(child.parentData.previousSibling.parentData is ParentDataType); | 424 assert(child.parentData.previousSibling.parentData is ParentDataType); |
| 420 child.parentData.previousSibling.parentData.nextSibling = child.parentData
.nextSibling; | 425 child.parentData.previousSibling.parentData.nextSibling = child.parentData
.nextSibling; |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 int count = 1; | 494 int count = 1; |
| 490 ChildType child = _firstChild; | 495 ChildType child = _firstChild; |
| 491 while (child != null) { | 496 while (child != null) { |
| 492 result += '${prefix}child ${count}: ${child.toString(prefix)}'; | 497 result += '${prefix}child ${count}: ${child.toString(prefix)}'; |
| 493 count += 1; | 498 count += 1; |
| 494 child = child.parentData.nextSibling; | 499 child = child.parentData.nextSibling; |
| 495 } | 500 } |
| 496 return result; | 501 return result; |
| 497 } | 502 } |
| 498 } | 503 } |
| OLD | NEW |