From 88671bcc3633af5a5e34715518e0804ca892fac7 Mon Sep 17 00:00:00 2001 From: JustOff Date: Sat, 20 Oct 2018 16:25:28 +0300 Subject: [css-grid] Don't shrink-wrap the inline size when we have an available size when measuring block size --- layout/generic/nsGridContainerFrame.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 8f117b5ab..fbd61f783 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -3714,8 +3714,11 @@ MeasuringReflow(nsIFrame* aChild, parent->Properties().Set( nsContainerFrame::DebugReflowingWithInfiniteISize(), true); #endif - uint32_t riFlags = ReflowInput::COMPUTE_SIZE_SHRINK_WRAP | - ReflowInput::COMPUTE_SIZE_USE_AUTO_BSIZE; + auto wm = aChild->GetWritingMode(); + uint32_t riFlags = ReflowInput::COMPUTE_SIZE_USE_AUTO_BSIZE; + if (aAvailableSize.ISize(wm) == INFINITE_ISIZE_COORD) { + riFlags |= ReflowInput::COMPUTE_SIZE_SHRINK_WRAP; + } if (aIMinSizeClamp != NS_MAXSIZE) { riFlags |= ReflowInput::I_CLAMP_MARGIN_BOX_MIN_SIZE; } @@ -3730,7 +3733,6 @@ MeasuringReflow(nsIFrame* aChild, ReflowOutput childSize(childRI); nsReflowStatus childStatus; const uint32_t flags = NS_FRAME_NO_MOVE_FRAME | NS_FRAME_NO_SIZE_VIEW; - WritingMode wm = childRI.GetWritingMode(); parent->ReflowChild(aChild, pc, childSize, childRI, wm, LogicalPoint(wm), nsSize(), flags, childStatus); parent->FinishReflowChild(aChild, pc, childSize, &childRI, wm, -- cgit v1.2.3