Index: Source/core/rendering/RenderGrid.cpp |
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp |
index b7c875331c57b28d394b2db8a0feb3eee48b85f4..2776bb04a7d4b37df84b4a9273893279d0768ebc 100644 |
--- a/Source/core/rendering/RenderGrid.cpp |
+++ b/Source/core/rendering/RenderGrid.cpp |
@@ -564,10 +564,12 @@ size_t RenderGrid::explicitGridSizeForSide(GridPositionSide side) const |
LayoutUnit RenderGrid::logicalContentHeightForChild(RenderBox* child, Vector<GridTrack>& columnTracks) |
{ |
SubtreeLayoutScope layoutScope(child); |
- if (child->style()->logicalHeight().isPercent()) |
+ LayoutUnit oldOverrideContainingBlockContentLogicalWidth = child->hasOverrideContainingBlockLogicalWidth() ? child->overrideContainingBlockContentLogicalWidth() : LayoutUnit(); |
+ LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForChild(child, ForColumns, columnTracks); |
+ if (child->style()->logicalHeight().isPercent() || oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth) |
layoutScope.setNeedsLayout(child); |
- child->setOverrideContainingBlockContentLogicalWidth(gridAreaBreadthForChild(child, ForColumns, columnTracks)); |
+ child->setOverrideContainingBlockContentLogicalWidth(overrideContainingBlockContentLogicalWidth); |
// If |child| has a percentage logical height, we shouldn't let it override its intrinsic height, which is |
// what we are interested in here. Thus we need to set the override logical height to -1 (no possible resolution). |
child->setOverrideContainingBlockContentLogicalHeight(-1); |