diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 89352321c4..57b78e810d 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -3793,10 +3793,25 @@ MeasuringReflow(nsIFrame* aChild, nsIFrame::ReflowChildFlags::NoMoveFrame | nsIFrame::ReflowChildFlags::NoSizeView | nsIFrame::ReflowChildFlags::NoDeleteNextInFlowChild; - parent->ReflowChild(aChild, pc, childSize, childRI, wm, - LogicalPoint(wm), nsSize(), flags, childStatus); - parent->FinishReflowChild(aChild, pc, childSize, &childRI, wm, - LogicalPoint(wm), nsSize(), flags); + if (childSize.mBoundingMetrics.width != 0) { + parent->ReflowChild(aChild, + pc, + childSize, + childRI, + wm, + LogicalPoint(wm), + nsSize(), + flags, + childStatus); + parent->FinishReflowChild(aChild, + pc, + childSize, + &childRI, + wm, + LogicalPoint(wm), + nsSize(), + flags); + } #ifdef DEBUG parent->DeleteProperty(nsContainerFrame::DebugReflowingWithInfiniteISize()); #endif