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

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: Rename isRenderView() calls to isLayoutView() 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
« no previous file with comments | « 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 73efb7b33994197844589680becebe4f8e7e445f..10c5de3d2b363489162b519cfdeb9ef893593d52 100644
--- a/Source/core/layout/LayoutGrid.cpp
+++ b/Source/core/layout/LayoutGrid.cpp
@@ -632,6 +632,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);
+
// 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);
@@ -648,6 +653,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);
« no previous file with comments | « Source/core/layout/LayoutBox.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698