diff options
author | JustOff <Off.Just.Off@gmail.com> | 2018-10-20 16:25:28 +0300 |
---|---|---|
committer | JustOff <Off.Just.Off@gmail.com> | 2018-10-20 16:25:28 +0300 |
commit | 88671bcc3633af5a5e34715518e0804ca892fac7 (patch) | |
tree | 14068d4087e5b83dc86a272d8427bdebe4849f14 | |
parent | 56eb74dbedb8663070f837deee42d31d027e3dd7 (diff) | |
download | UXP-88671bcc3633af5a5e34715518e0804ca892fac7.tar UXP-88671bcc3633af5a5e34715518e0804ca892fac7.tar.gz UXP-88671bcc3633af5a5e34715518e0804ca892fac7.tar.lz UXP-88671bcc3633af5a5e34715518e0804ca892fac7.tar.xz UXP-88671bcc3633af5a5e34715518e0804ca892fac7.zip |
[css-grid] Don't shrink-wrap the inline size when we have an available size when measuring block size
-rw-r--r-- | layout/generic/nsGridContainerFrame.cpp | 8 |
1 files 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, |