Negative constraints never make sense, so catch those too.
Make RenderObject.layout's isNormalized assert use the newer more fancy
debug version of isNormalized.
* Use actual exceptions rather than assertions containing code
containing strings when trying to give messages to authors.
* Introduce RenderingError which is an AssertionError that takes a
string argument, to support the above.
* Provide a BoxDimensions.hasBoundedWidth/hasBoundedHeight API.
* Document BoxDimensions.isNormalized.
* Provide more useful information when we assert isNormalized and find
that it is false.
* When finding the size is infinite, crawl the tree to figure out which
render box is likely responsible for the infinite constraints.
* Provide more information when size doesn't match the constraints.
* Provide more information when intrinsic dimension methods violate the
constraints.
* Only spam a huge amount of information for the first exception from
the rendering library. I've noticed a lot of people looking at the
last exception printed rather than the first and that's very
misleading -- after the rendering library hits an exception, all bets
are off regarding what'll happen in the future. All kinds of asserts
might fire.
* Improve docs around the debug methods and flags for the above.
* Make Block default to have no children. Previously, giving no children
crashed with a confusing message about a null deref in an assert.
Add BoxConstraints.isNormalized feature.
Use this feature in asserts in all the intrinsic dimension methods, in
various relevant BoxConstraints methods, and in layout().
Wrap the _DebugSize logic in BoxConstraints.constrain() in an assert
block to avoid a branch in release mode.
Remove the logic in BoxConstraints.isSatisfiedBy() that dealt with
non-normalized values.
Add BoxConstraints.normalize().
Make RenderCustomOneChildLayoutBox.performLayout() only set
parentUsesSize on the child if the constraints aren't tight.
Instead of PointerInputEvent having a "type" field, we now have a
different class for each pointer type.
This has ripple effects throughout the system.
I also did code cleanup in affected files while I was there.
This patch simplifies PaintingContext with several goals:
1) We now call a callback instead of assuming the caller has a single child to
paint. This change will let us handle render objects that wish to paint more
than one child.
2) We now avoid creating lots of empty picture layers because we don't eagerly
start recording pictures. Instead, we wait for the first caller to touch the
canvas before creating the picture recorder.
3) We now are more consistent about which values have incorporated the painting
offset.
Also, fix warnings in rendering/sector_layout.dart
Also, fix hit testing in rendering/sector_layout.dart
Also, add WidgetToRenderBoxAdapter
Also, make the rendering library debugging tools more resilient to
dumping stuff before layout is complete.