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

Side by Side Diff: sky/sdk/lib/base/README.md

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
« no previous file with comments | « no previous file | sky/sdk/lib/base/node.dart » ('j') | sky/sdk/lib/rendering/README.md » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 Sky Base 1 Sky Base
2 ======== 2 ========
3 3
4 AbstractNode
5 ------------
6
7 The [node.dart](node.dart) file defines a class, `AbstractNode`, which
8 can be used to build mutable trees.
9
10 * When a subclass is changing the parent of a child, it should
11 call either parent.adoptChild(child) or parent.dropChild(child)
12 as appropriate. Subclasses should expose an API for
13 manipulating the tree if you want to (e.g. a setter for a
14 'child' property, or an 'add()' method to manipulate a list).
15
16 * You can see the current parent by querying 'parent'.
17
18 * You can see the current attachment state by querying
19 'attached'. The root of any tree that is to be considered
20 attached should be manually attached by calling 'attach()'.
21 Other than that, don't call 'attach()' or 'detach()'. This is
22 all managed automatically assuming you call the 'adoptChild()'
23 and 'dropChild()' methods appropriately.
24
25 * Subclasses that have children must override 'attach()' and
26 'detach()' as described below.
27
28 * Nodes always have a 'depth' greater than their ancestors'.
29 There's no guarantee regarding depth between siblings. The
30 depth of a node is used to ensure that nodes are processed in
31 depth order. The 'depth' of a child can be more than one
32 greater than the 'depth' of the parent, because the 'depth'
33 values are never decreased: all that matters is that it's
34 greater than the parent. Consider a tree with a root node A, a
35 child B, and a grandchild C. Initially, A will have 'depth' 0,
36 B 'depth' 1, and C 'depth' 2. If C is moved to be a child of A,
37 sibling of B, then the numbers won't change. C's 'depth' will
38 still be 2. This is all managed automatically assuming you call
39 'adoptChild()' and 'dropChild()' appropriately.
40
41
4 Dependencies 42 Dependencies
5 ------------ 43 ------------
6 44
7 No dependencies except for `dart:sky` and Dart's core libraries. 45 No dependencies except for `dart:sky` and Dart's core libraries.
OLDNEW
« no previous file with comments | « no previous file | sky/sdk/lib/base/node.dart » ('j') | sky/sdk/lib/rendering/README.md » ('J')

Powered by Google App Engine
This is Rietveld 408576698