Index: Source/core/rendering/RenderGrid.cpp |
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp |
index 7e84e13e0fde83e79321dd974770003ef77d6399..68f2e3e6d425ab54323c3128dda9775cc08c2d17 100644 |
--- a/Source/core/rendering/RenderGrid.cpp |
+++ b/Source/core/rendering/RenderGrid.cpp |
@@ -618,10 +618,13 @@ void RenderGrid::distributeSpaceToTracks(Vector<GridTrack*>& tracks, Vector<Grid |
GridTrack& track = *tracks[i]; |
LayoutUnit availableLogicalSpaceShare = availableLogicalSpace / (tracksSize - i); |
LayoutUnit trackBreadth = (tracks[i]->*trackGetter)(); |
- LayoutUnit growthShare = std::max(LayoutUnit(), std::min(availableLogicalSpaceShare, track.m_maxBreadth - trackBreadth)); |
+ LayoutUnit growthShare = std::min(availableLogicalSpaceShare, track.m_maxBreadth - trackBreadth); |
+ sizingData.distributeTrackVector[i] = trackBreadth; |
// We should never shrink any grid track or else we can't guarantee we abide by our min-sizing function. |
- sizingData.distributeTrackVector[i] = trackBreadth + growthShare; |
- availableLogicalSpace -= growthShare; |
+ if (growthShare > 0) { |
+ sizingData.distributeTrackVector[i] += growthShare; |
+ availableLogicalSpace -= growthShare; |
+ } |
} |
if (availableLogicalSpace > 0 && tracksForGrowthAboveMaxBreadth) { |