Index: Source/core/rendering/RenderGrid.cpp |
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp |
index cd2d268e4cc698a6118351e88b355458386dfef6..7197601557c14c85ebd8b51b9611fd2fb12acb3e 100644 |
--- a/Source/core/rendering/RenderGrid.cpp |
+++ b/Source/core/rendering/RenderGrid.cpp |
@@ -845,6 +845,14 @@ void RenderGrid::dirtyGrid() |
m_gridIsDirty = true; |
} |
+static bool gridItemDependsOnGridAreaLogicalHeight(const RenderBox* gridItem) |
+{ |
+ const Length& logicalHeight = gridItem->style()->logicalHeight(); |
+ // FIXME: This is wrong if the grid area and the grid item have orthogonal writing modes, |
+ // but the rest of the code doesn't handle this case anyway (http://crbug.com/234194). |
+ return logicalHeight.isPercent(); |
ojan
2013/09/07 17:13:20
Don't you also need to check maxHeight/minHeight?
Julien - ping for review
2013/09/09 18:04:42
I think you are right, I will add more testing for
|
+} |
+ |
void RenderGrid::layoutGridItems() |
{ |
placeItemsOnGrid(); |
@@ -870,7 +878,7 @@ void RenderGrid::layoutGridItems() |
LayoutUnit overrideContainingBlockContentLogicalHeight = gridAreaBreadthForChild(child, ForRows, rowTracks); |
SubtreeLayoutScope layoutScope(child); |
- if (oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth || oldOverrideContainingBlockContentLogicalHeight != overrideContainingBlockContentLogicalHeight) |
+ if (oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth || (gridItemDependsOnGridAreaLogicalHeight(child) && oldOverrideContainingBlockContentLogicalHeight != overrideContainingBlockContentLogicalHeight)) |
layoutScope.setNeedsLayout(child); |
child->setOverrideContainingBlockContentLogicalWidth(overrideContainingBlockContentLogicalWidth); |