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

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

Issue 1151573020: Fix the crash when the drawer is hidden. (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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/sdk/lib/framework/fn2.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/rendering/node.dart
diff --git a/sky/sdk/lib/framework/rendering/node.dart b/sky/sdk/lib/framework/rendering/node.dart
index 07cf57cdfa457499aeadf0c4cfb7c0fc076a6a16..81ad8242021b55a059d2ea5bc9f2338a1232d62f 100644
--- a/sky/sdk/lib/framework/rendering/node.dart
+++ b/sky/sdk/lib/framework/rendering/node.dart
@@ -55,12 +55,18 @@ abstract class RenderNode extends AbstractNode {
assert(child != null);
setParentData(child);
super.adoptChild(child);
+ markNeedsLayout();
}
void dropChild(RenderNode child) { // only for use by subclasses
assert(child != null);
assert(child.parentData != null);
child.parentData.detach();
+ if (child._relayoutSubtreeRoot != child) {
+ child._relayoutSubtreeRoot = null;
+ child._needsLayout = true;
+ }
super.dropChild(child);
+ markNeedsLayout();
}
static List<RenderNode> _nodesNeedingLayout = new List<RenderNode>();
@@ -231,7 +237,6 @@ abstract class RenderNodeWithChildMixin<ChildType extends RenderNode> {
_child = value;
if (_child != null)
adoptChild(_child);
- markNeedsLayout();
}
void attachChildren() {
if (_child != null)
@@ -336,7 +341,6 @@ abstract class ContainerRenderNodeMixin<ChildType extends RenderNode, ParentData
assert(before.parentData.previousSibling == child);
}
}
- markNeedsLayout();
}
void remove(ChildType child) {
assert(child.parentData is ParentDataType);
@@ -359,7 +363,6 @@ abstract class ContainerRenderNodeMixin<ChildType extends RenderNode, ParentData
child.parentData.previousSibling = null;
child.parentData.nextSibling = null;
dropChild(child);
- markNeedsLayout();
}
void redepthChildren() {
ChildType child = _firstChild;
« no previous file with comments | « sky/sdk/lib/framework/fn2.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698