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

Unified Diff: sky/sdk/lib/framework/node.dart

Issue 1134593007: [Effen] Add a "parent" pointer to Node. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/layout.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/sdk/lib/framework/node.dart
diff --git a/sky/sdk/lib/framework/node.dart b/sky/sdk/lib/framework/node.dart
index ec9a1f94fa9f38d0e8297ea64b30018bc3dcc534..ea51099c43fd4d12e7b6c63a60009ed253a43084 100644
--- a/sky/sdk/lib/framework/node.dart
+++ b/sky/sdk/lib/framework/node.dart
@@ -44,15 +44,21 @@ class Node {
}
detachChildren() { } // workaround for lack of inter-class mixins in Dart
- void setAsChild(Node child) { // only for use by subclasses
+ Node _parent;
+ Node get parent => _parent;
+ void adoptChild(Node child) { // only for use by subclasses
assert(child != null);
+ assert(child._parent == null);
+ child._parent = this;
if (attached)
child.attach();
redepthChild(child);
}
void dropChild(Node child) { // only for use by subclasses
assert(child != null);
+ assert(child._parent == this);
assert(child.attached == attached);
+ child._parent = null;
if (attached)
child.detach();
}
« no previous file with comments | « sky/sdk/lib/framework/layout.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698