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

Side by Side Diff: sky/sdk/lib/framework/rendering/object.dart

Issue 1182933003: Verify that callers correctly set parentUsesSize if they use the child's size (and fix a few cases … (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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 import 'dart:math' as math; 5 import 'dart:math' as math;
6 import 'dart:sky' as sky; 6 import 'dart:sky' as sky;
7 import 'dart:sky' show Point, Size, Rect, Color, Paint, Path; 7 import 'dart:sky' show Point, Size, Rect, Color, Paint, Path;
8 8
9 import '../node.dart'; 9 import '../node.dart';
10 import '../scheduler.dart' as scheduler; 10 import '../scheduler.dart' as scheduler;
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 _relayoutSubtreeRoot = this; 121 _relayoutSubtreeRoot = this;
122 _nodesNeedingLayout.add(this); 122 _nodesNeedingLayout.add(this);
123 scheduler.ensureVisualUpdate(); 123 scheduler.ensureVisualUpdate();
124 } 124 }
125 static void flushLayout() { 125 static void flushLayout() {
126 _debugDoingLayout = true; 126 _debugDoingLayout = true;
127 List<RenderObject> dirtyNodes = _nodesNeedingLayout; 127 List<RenderObject> dirtyNodes = _nodesNeedingLayout;
128 _nodesNeedingLayout = new List<RenderObject>(); 128 _nodesNeedingLayout = new List<RenderObject>();
129 dirtyNodes..sort((a, b) => a.depth - b.depth)..forEach((node) { 129 dirtyNodes..sort((a, b) => a.depth - b.depth)..forEach((node) {
130 if (node._needsLayout && node.attached) 130 if (node._needsLayout && node.attached)
131 node._doLayout(); 131 node.layoutWithoutResize();
132 }); 132 });
133 _debugDoingLayout = false; 133 _debugDoingLayout = false;
134 } 134 }
135 void _doLayout() { 135 void layoutWithoutResize() {
136 try { 136 try {
137 assert(_relayoutSubtreeRoot == this); 137 assert(_relayoutSubtreeRoot == this);
138 performLayout(); 138 performLayout();
139 } catch (e, stack) { 139 } catch (e, stack) {
140 print('Exception raised during layout of ${this}: ${e}'); 140 print('Exception raised during layout of ${this}: ${e}');
141 print(stack); 141 print(stack);
142 return; 142 return;
143 } 143 }
144 _needsLayout = false; 144 _needsLayout = false;
145 } 145 }
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 int count = 1; 457 int count = 1;
458 ChildType child = _firstChild; 458 ChildType child = _firstChild;
459 while (child != null) { 459 while (child != null) {
460 result += '${prefix}child ${count}: ${child.toString(prefix)}'; 460 result += '${prefix}child ${count}: ${child.toString(prefix)}';
461 count += 1; 461 count += 1;
462 child = child.parentData.nextSibling; 462 child = child.parentData.nextSibling;
463 } 463 }
464 return result; 464 return result;
465 } 465 }
466 } 466 }
OLDNEW
« no previous file with comments | « sky/sdk/lib/framework/rendering/box.dart ('k') | sky/sdk/lib/framework/rendering/paragraph.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698