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

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

Issue 1176623002: Add asserts to prevent people from setting box.parentData.position or box.size except during layout. (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/rendering/box.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/object.dart
diff --git a/sky/sdk/lib/framework/rendering/object.dart b/sky/sdk/lib/framework/rendering/object.dart
index 6ca5e88e17e5c2ea34f37c0e81ac1a51e58ef0ad..174b3c7c91e9fa36c92fac07064b66589c6dbaa3 100644
--- a/sky/sdk/lib/framework/rendering/object.dart
+++ b/sky/sdk/lib/framework/rendering/object.dart
@@ -49,7 +49,7 @@ abstract class RenderObject extends AbstractNode {
dynamic parentData; // TODO(ianh): change the type of this back to ParentData once the analyzer is cleverer
void setParentData(RenderObject child) {
// override this to setup .parentData correctly for your class
- assert(!_debugDoingLayout);
+ assert(!debugDoingLayout);
assert(!debugDoingPaint);
if (child.parentData is! ParentData)
child.parentData = new ParentData();
@@ -57,7 +57,7 @@ abstract class RenderObject extends AbstractNode {
void adoptChild(RenderObject child) { // only for use by subclasses
// call this whenever you decide a node is a child
- assert(!_debugDoingLayout);
+ assert(!debugDoingLayout);
assert(!debugDoingPaint);
assert(child != null);
setParentData(child);
@@ -65,7 +65,7 @@ abstract class RenderObject extends AbstractNode {
markNeedsLayout();
}
void dropChild(RenderObject child) { // only for use by subclasses
- assert(!_debugDoingLayout);
+ assert(!debugDoingLayout);
assert(!debugDoingPaint);
assert(child != null);
assert(child.parentData != null);
@@ -80,6 +80,7 @@ abstract class RenderObject extends AbstractNode {
static List<RenderObject> _nodesNeedingLayout = new List<RenderObject>();
static bool _debugDoingLayout = false;
+ static bool get debugDoingLayout => _debugDoingLayout;
bool _needsLayout = true;
bool get needsLayout => _needsLayout;
RenderObject _relayoutSubtreeRoot;
@@ -100,7 +101,7 @@ abstract class RenderObject extends AbstractNode {
return true;
}
void markNeedsLayout() {
- assert(!_debugDoingLayout);
+ assert(!debugDoingLayout);
assert(!debugDoingPaint);
if (_needsLayout) {
assert(debugAncestorsAlreadyMarkedNeedsLayout());
« no previous file with comments | « sky/sdk/lib/framework/rendering/box.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698