Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(740)

Unified Diff: Source/core/layout/LayoutGrid.cpp

Issue 914993003: [CSS Grid Layout] Determine definite/indefinite size properly in nested grids (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: New version Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« Source/core/layout/LayoutBox.h ('K') | « Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
« Source/core/layout/LayoutBox.h ('K') | « Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698