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

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

Issue 1321573005: [CSS Grid Layout] Flex factor sum must be 1 at least. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Just return if accumulatedFractions is 1. Created 5 years, 4 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 | « LayoutTests/fast/css-grid-layout/flex-factor-sum-less-than-1-expected.txt ('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 fa0f179b1a0fff95e96561186f81dfd73a1ad9b9..7546f750de5e76f39886342b6b75ba8f9f3bb1ee 100644
--- a/Source/core/layout/LayoutGrid.cpp
+++ b/Source/core/layout/LayoutGrid.cpp
@@ -575,6 +575,11 @@ double LayoutGrid::computeNormalizedFractionBreadth(Vector<GridTrack>& tracks, c
availableLogicalSpaceIgnoringFractionTracks += track.m_track->baseSize();
}
+ // Let flex factor sum be the sum of the flex factors of the flexible tracks. If this value
+ // is less than 1, set it to 1 instead.
+ if (accumulatedFractions < 1)
+ return availableLogicalSpaceIgnoringFractionTracks;
+
return availableLogicalSpaceIgnoringFractionTracks / accumulatedFractions;
}
« no previous file with comments | « LayoutTests/fast/css-grid-layout/flex-factor-sum-less-than-1-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698