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

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

Issue 1211573003: Fill out some more documentation about building RenderBox subclasses. (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
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 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698