From e0d06791ef2ce802cb001c9ec3d63b4f824c8d3d Mon Sep 17 00:00:00 2001 From: Adam Barth Date: Wed, 8 Jul 2015 20:31:20 -0700 Subject: [PATCH] Fix test failures from b9e2a7fd2bb21933c4dd23354a35a2d83bdc3be8 We need to test for visual overflow after writing size because we need to use the up-to-date value of size. TBR=ianh@google.com Review URL: https://codereview.chromium.org/1230733002 . --- sdk/lib/rendering/block.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sdk/lib/rendering/block.dart b/sdk/lib/rendering/block.dart index b14e16962de..e302e00da67 100644 --- a/sdk/lib/rendering/block.dart +++ b/sdk/lib/rendering/block.dart @@ -15,8 +15,6 @@ abstract class RenderBlockBase extends RenderBox with ContainerRenderObjectMixin // lays out RenderBox children in a vertical stack // uses the maximum width provided by the parent - bool _hasVisualOverflow = false; - RenderBlockBase({ List children }) { @@ -123,15 +121,18 @@ class RenderBlock extends RenderBlockBase { RenderBlock({ List children }) : super(children: children); + bool _hasVisualOverflow = false; + void performLayout() { super.performLayout(); + size = constraints.constrain(new Size(constraints.maxWidth, childrenHeight)); + assert(!size.isInfinite); + // FIXME(eseidel): Block lays out its children with unconstrained height // yet itself remains constrained. Remember that our children wanted to // be taller than we are so we know to clip them (and not cause confusing // mismatch of painting vs. hittesting). _hasVisualOverflow = childrenHeight > size.height; - size = constraints.constrain(new Size(constraints.maxWidth, childrenHeight)); - assert(!size.isInfinite); } void paint(PaintingCanvas canvas, Offset offset) { @@ -146,4 +147,3 @@ class RenderBlock extends RenderBlockBase { } } -