diff options
author | Moonchild <mcwerewolf@gmail.com> | 2018-10-20 16:03:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-20 16:03:35 +0200 |
commit | 54deaf4437f448ef81cecb5a3249efaf83bb53d8 (patch) | |
tree | befd3d35a2cbe0601f2ea3d968b74fefc9c9cfe1 /layout/generic/nsGridContainerFrame.cpp | |
parent | 714ccb6f886447530b67a45aeb7b9b875e6f33c9 (diff) | |
parent | 7110f93fb1345577a6f156935e720a741bccb50a (diff) | |
download | UXP-54deaf4437f448ef81cecb5a3249efaf83bb53d8.tar UXP-54deaf4437f448ef81cecb5a3249efaf83bb53d8.tar.gz UXP-54deaf4437f448ef81cecb5a3249efaf83bb53d8.tar.lz UXP-54deaf4437f448ef81cecb5a3249efaf83bb53d8.tar.xz UXP-54deaf4437f448ef81cecb5a3249efaf83bb53d8.zip |
Merge pull request #841 from JustOff/PR_css_grid_shrink_wrap
[css-grid] Don't shrink-wrap the inline size when we have an available size when measuring block size
Diffstat (limited to 'layout/generic/nsGridContainerFrame.cpp')
-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, |