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

Issue 1144423002: Actually perform a block layout (Closed)

Created:
5 years, 7 months ago by abarth-chromium
Modified:
5 years, 7 months ago
Reviewers:
Hixie, eseidel
CC:
gregsimon, mojo-reviews_chromium.org, ojan, qsr+mojo_chromium.org
Base URL:
git@github.com:domokit/mojo.git@master
Target Ref:
refs/heads/master
Project:
mojo
Visibility:
Public.

Description

Actually perform a block layout This CL teaches simple_render_tree how to do a block layout using layout2.dart. R=eseidel@chromium.org, ianh@google.com Committed: https://chromium.googlesource.com/external/mojo/+/d6109ce1ae3a7b73a0e8b6ab0b9d37d05205766d

Patch Set 1 #

Total comments: 1

Patch Set 2 : Less verbose #

Patch Set 3 : Some more notes #

Total comments: 14
Unified diffs Side-by-side diffs Delta from patch set Stats (+117 lines, -79 lines) Patch
M sky/examples/raw/simple_render_tree.dart View 1 1 chunk +19 lines, -6 lines 2 comments Download
M sky/sdk/lib/framework/layout2.dart View 1 2 11 chunks +98 lines, -73 lines 12 comments Download

Messages

Total messages: 6 (1 generated)
abarth-chromium
5 years, 7 months ago (2015-05-21 00:14:13 UTC) #1
abarth-chromium
https://codereview.chromium.org/1144423002/diff/1/sky/sdk/lib/framework/layout2.dart File sky/sdk/lib/framework/layout2.dart (right): https://codereview.chromium.org/1144423002/diff/1/sky/sdk/lib/framework/layout2.dart#newcode406 sky/sdk/lib/framework/layout2.dart:406: BoxConstraints constraints, {double width, double height}) { width and ...
5 years, 7 months ago (2015-05-21 02:43:59 UTC) #2
eseidel
lgtm https://codereview.chromium.org/1144423002/diff/40001/sky/examples/raw/simple_render_tree.dart File sky/examples/raw/simple_render_tree.dart (right): https://codereview.chromium.org/1144423002/diff/40001/sky/examples/raw/simple_render_tree.dart#newcode9 sky/examples/raw/simple_render_tree.dart:9: class SimpleBlock extends RenderDecoratedBox { Simple isnt' a ...
5 years, 7 months ago (2015-05-21 18:08:14 UTC) #4
abarth-chromium
Committed patchset #3 (id:40001) manually as d6109ce1ae3a7b73a0e8b6ab0b9d37d05205766d (presubmit successful).
5 years, 7 months ago (2015-05-21 18:15:54 UTC) #5
Hixie
5 years, 7 months ago (2015-05-21 19:45:04 UTC) #6
Message was sent while issue was closed.
https://codereview.chromium.org/1144423002/diff/40001/sky/examples/raw/simple...
File sky/examples/raw/simple_render_tree.dart (right):

https://codereview.chromium.org/1144423002/diff/40001/sky/examples/raw/simple...
sky/examples/raw/simple_render_tree.dart:9: class SimpleBlock extends
RenderDecoratedBox {
On 2015/05/21 at 18:08:14, eseidel wrote:
> Simple isnt' a very good name.  SolidColorBlock?  ColoredBlock?

TwoHundredPixelHighBlock? :-)

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
File sky/sdk/lib/framework/layout2.dart (left):

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:232: ancestor.paintFrame();
This is the code I was talking about earlier.

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
File sky/sdk/lib/framework/layout2.dart (right):

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:441: setWidth(constraints, 0.0);
how about:

   width = constraints.constrainWidth(0.0);

...? (and ditto height)

(and remove setWidth/setHeight, since people will think those are an API they
can use from outside)

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:447: double height;
I wish we could make these protected and only public expose the getters, but
Dart doesn't have protected.

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:463: BoxDecoration({
make this a const constructor.

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:615: // TODO(abarth): Shouldn't this have a
value: maxWidth?
good question.

if it does, we should assert that the maxWidth isn't double.INFINITY,
probably...

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:627: 
Why the blank line?

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:643: width = clamp(min: constraints.minWidth,
max: constraints.maxWidth);
should be consistent with the intrinsic dimensions logic, whatever that is.

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:663: child.parentData.x = 0.0; //
TODO(abarth): Shouldn't this be _padding.left?
Yes.

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:730: setWidth(constraints, 0.0);
change as discussed above.

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:740: toolbar.layout(new
BoxConstraints(minWidth: width, maxWidth: width, minHeight: kToolbarHeight,
maxHeight: kToolbarHeight));
Make a BoxConstraints constructor that takes just a width/height and sets the
min/max accordingly.

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:747: statusbar.layout(new
BoxConstraints(minWidth: width, maxWidth: width, minHeight: kStatusbarHeight,
maxHeight: kStatusbarHeight));
ditto

https://codereview.chromium.org/1144423002/diff/40001/sky/sdk/lib/framework/l...
sky/sdk/lib/framework/layout2.dart:753: body.layout(new BoxConstraints(minWidth:
width, maxWidth: width, minHeight: bodyHeight, maxHeight: bodyHeight));
ditto

Powered by Google App Engine
This is Rietveld 408576698