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

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

Issue 1160923008: Silence a bunch of annoying bogus dartanalyzer warnings. (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/object.dart
diff --git a/sky/sdk/lib/framework/rendering/object.dart b/sky/sdk/lib/framework/rendering/object.dart
index 5aee1f85f49861e4bde64359554f6635ac23ef9c..77a434f7636e87627c6b924f28abe9e4b422430d 100644
--- a/sky/sdk/lib/framework/rendering/object.dart
+++ b/sky/sdk/lib/framework/rendering/object.dart
@@ -44,7 +44,7 @@ abstract class RenderObject extends AbstractNode {
// parentData is only for use by the RenderObject that actually lays this
// node out, and any other nodes who happen to know exactly what
// kind of node that is.
- ParentData parentData;
+ 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);
@@ -107,8 +107,10 @@ abstract class RenderObject extends AbstractNode {
_needsLayout = true;
assert(_relayoutSubtreeRoot != null);
if (_relayoutSubtreeRoot != this) {
+ final parent = this.parent; // TODO(ianh): Remove this once the analyzer is cleverer
assert(parent is RenderObject);
parent.markNeedsLayout();
+ assert(parent == this.parent); // TODO(ianh): Remove this once the analyzer is cleverer
} else {
_nodesNeedingLayout.add(this);
scheduler.ensureVisualUpdate();
@@ -136,11 +138,13 @@ abstract class RenderObject extends AbstractNode {
_needsLayout = false;
}
void layout(dynamic constraints, { bool parentUsesSize: false }) {
+ final parent = this.parent; // TODO(ianh): Remove this once the analyzer is cleverer
RenderObject relayoutSubtreeRoot;
if (!parentUsesSize || sizedByParent || parent is! RenderObject)
relayoutSubtreeRoot = this;
else
relayoutSubtreeRoot = parent._relayoutSubtreeRoot;
+ assert(parent == this.parent); // TODO(ianh): Remove this once the analyzer is cleverer
if (!needsLayout && constraints == _constraints && relayoutSubtreeRoot == _relayoutSubtreeRoot)
return;
_constraints = constraints;
@@ -150,6 +154,7 @@ abstract class RenderObject extends AbstractNode {
performLayout();
_needsLayout = false;
markNeedsPaint();
+ assert(parent == this.parent); // TODO(ianh): Remove this once the analyzer is cleverer
}
bool get sizedByParent => false; // return true if the constraints are the only input to the sizing algorithm (in particular, child nodes have no impact)
void performResize(); // set the local dimensions, using only the constraints (only called if sizedByParent is true)
@@ -257,7 +262,7 @@ class HitTestResult {
// GENERIC MIXIN FOR RENDER NODES WITH ONE CHILD
-abstract class RenderObjectWithChildMixin<ChildType extends RenderObject> {
+abstract class RenderObjectWithChildMixin<ChildType extends RenderObject> implements RenderObject {
ChildType _child;
ChildType get child => _child;
void set child (ChildType value) {
« 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