Index: Source/core/layout/LayoutGrid.cpp |
diff --git a/Source/core/layout/LayoutGrid.cpp b/Source/core/layout/LayoutGrid.cpp |
index add685ab608673b919360b1109411e75028b78bd..41a747ab8635eb6a17de6a39ce6e49e655124752 100644 |
--- a/Source/core/layout/LayoutGrid.cpp |
+++ b/Source/core/layout/LayoutGrid.cpp |
@@ -638,6 +638,11 @@ LayoutUnit LayoutGrid::minContentForChild(LayoutBox& child, GridTrackSizingDirec |
return 0; |
if (direction == ForColumns) { |
+ // If |child| has a percentage logical width, we shouldn't let it override its intrinsic width, which is |
+ // what we are interested in here. Thus we need to set the override logical width to -1 (no possible resolution). |
+ if (child.style()->logicalWidth().isPercent()) |
+ child.setOverrideContainingBlockContentLogicalWidth(-1); |
Julien - ping for review
2015/02/27 02:07:03
Our need to change the override constantly means t
Manuel Rego
2015/02/27 08:48:50
I agree. We should try to find a best alternative
|
+ |
Manuel Rego
2015/02/25 16:57:59
In addition to previous changes I needed to add th
|
// FIXME: It's unclear if we should return the intrinsic width or the preferred width. |
// See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html |
return child.minPreferredLogicalWidth() + marginIntrinsicLogicalWidthForChild(child); |
@@ -654,6 +659,11 @@ LayoutUnit LayoutGrid::maxContentForChild(LayoutBox& child, GridTrackSizingDirec |
return LayoutUnit(); |
if (direction == ForColumns) { |
+ // If |child| has a percentage logical width, we shouldn't let it override its intrinsic width, which is |
+ // what we are interested in here. Thus we need to set the override logical width to -1 (no possible resolution). |
+ if (child.style()->logicalWidth().isPercent()) |
+ child.setOverrideContainingBlockContentLogicalWidth(-1); |
+ |
// FIXME: It's unclear if we should return the intrinsic width or the preferred width. |
// See http://lists.w3.org/Archives/Public/www-style/2013Jan/0245.html |
return child.maxPreferredLogicalWidth() + marginIntrinsicLogicalWidthForChild(child); |