11 Commits

Author SHA1 Message Date
Hixie
d54c213b24 Clean up a bunch of our Dart code.
- constructors first
 - have either a blank line at the top and bottom of each class, or no blank line in either place (it's still inconsistent about which we should do)
 - hide clamp()

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1172173002
2015-06-09 15:27:58 -07:00
Adam Barth
a68b53ae91 Fix the Sky tests
Instead of triggering layout synchronously during AppView construction, we now
schedule the initial layout using a magic bootstrapping function.

TBR=ianh@google.com

Review URL: https://codereview.chromium.org/1172123003.
2015-06-09 14:07:17 -07:00
Hixie
6495ef0710 Add asserts to prevent people from setting box.parentData.position or box.size except during layout.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1176623002
2015-06-09 13:11:11 -07:00
Hixie
12aa568fc4 Export Point, Size, Rect, Color, Paint, Path, BoxDecoration, Border, BorderSide, EdgeDims, and FlexDirection from fn2.dart
That way most of our libraries don't have to use sky.Foo all over the place, and we can reduce the number of imports in most Dart components.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1161323004
2015-06-05 10:18:50 -07:00
Hixie
3cf7368d97 Silence a bunch of annoying bogus dartanalyzer warnings.
- several places where we use a getter knowing that it will return a
   subclass of its declared type, even asserting that it does, but
   where the analyzer is worried that the getter might start returning
   a new value unexpectedly, solved by having a temporary local
   variable shadow the getter and asserting that it doesn't change
   value
 - many many places where we do this with parentData specifically,
   solved by type-erasing parentData.
 - a place where a mixin wants to be subclassing another class, and
   uses its methods, solved by saying that the mixin is abstract but
   implements the superclass

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1160923008
2015-06-05 09:44:09 -07:00
Hixie
10cda2fe28 Include DETACHED, NEEDS-LAYOUT, and relayoutSubtreeRoot info in the debug output for the render tree
R=chinmaygarde@google.com

Review URL: https://codereview.chromium.org/1149083011
2015-06-04 15:58:43 -07:00
Hixie
9b0cb975cb Improve the RenderObject.toString() logic so that there's not blank lines everywhere and to generally be better.
Adds sizes, positions, transforms, improves RenderParagraph's output.

R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1160233004
2015-06-04 15:45:44 -07:00
Hixie
67d883c506 We don't necessarily have a child, so debugDescribeChildren() needs to check for null.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1151533006
2015-06-04 14:30:17 -07:00
Hixie
8ee5aa0bc6 Give RenderObject a useful toString().
This makes debugging the render tree a lot easier. Just print the node
you care about, and you get an indented tree view of its subtree,
including settings. New subclasses should implement the new virtual
method debugDescribeSettings() to expose new settings.

R=eseidel@chromium.org

Review URL: https://codereview.chromium.org/1157993005
2015-06-04 14:10:07 -07:00
Hixie
9706fc588f Assert that you can't mutate the tree during paint or layout.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1144933007
2015-06-04 11:14:39 -07:00
Hixie
8e34567652 Rename RenderNode to RenderObject.
R=abarth@chromium.org

Review URL: https://codereview.chromium.org/1165013003
2015-06-04 10:45:21 -07:00