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

Unified Diff: Source/core/rendering/RenderGrid.cpp

Issue 906323003: [CSS Grid Layout] Columns set in percentages collapse to auto width (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@sergio-indefinite
Patch Set: 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/rendering/RenderGrid.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderGrid.cpp
diff --git a/Source/core/rendering/RenderGrid.cpp b/Source/core/rendering/RenderGrid.cpp
index b7b8ee3c6901d1716ad7373d6fe73a8d09843a39..0dfc22df8a8be702fa7b9a59dff3fa1d346b6db3 100644
--- a/Source/core/rendering/RenderGrid.cpp
+++ b/Source/core/rendering/RenderGrid.cpp
@@ -590,6 +590,11 @@ double RenderGrid::computeNormalizedFractionBreadth(Vector<GridTrack>& tracks, c
return availableLogicalSpaceIgnoringFractionTracks / accumulatedFractions;
}
+bool RenderGrid::hasDefiniteLogicalSize(GridTrackSizingDirection direction) const
+{
+ return (direction == ForRows) ? hasDefiniteLogicalHeight() : hasDefiniteLogicalWidth();
+}
+
GridTrackSize RenderGrid::gridTrackSize(GridTrackSizingDirection direction, size_t i) const
{
bool isForColumns = direction == ForColumns;
@@ -598,10 +603,7 @@ GridTrackSize RenderGrid::gridTrackSize(GridTrackSizingDirection direction, size
// If the logical width/height of the grid container is indefinite, percentage values are treated as <auto> (or in
// the case of minmax() as min-content for the first position and max-content for the second).
- Length logicalSize = isForColumns ? style()->logicalWidth() : style()->logicalHeight();
- // FIXME: isIntrinsicOrAuto() does not fulfil the 'indefinite size' description as it does not include <percentage>
- // of indefinite sizes. This is a broather issue as Length does not have the required context to support it.
- if (logicalSize.isIntrinsicOrAuto()) {
+ if (!hasDefiniteLogicalSize(direction)) {
const GridLength& oldMinTrackBreadth = trackSize.minTrackBreadth();
const GridLength& oldMaxTrackBreadth = trackSize.maxTrackBreadth();
return GridTrackSize(oldMinTrackBreadth.isPercentage() ? Length(MinContent) : oldMinTrackBreadth, oldMaxTrackBreadth.isPercentage() ? Length(MaxContent) : oldMaxTrackBreadth);
« no previous file with comments | « Source/core/rendering/RenderGrid.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698