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

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

Issue 2415313003: [css-grid] Computing free space on indefinite sized grids (Closed)
Patch Set: Created 4 years, 2 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 | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-content-alignment-overflow-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/layout/LayoutGrid.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
index a9d80d7ebbd8775def2668b9adf41c2c2b336d45..24a85f06f9a6ba3421ee12933d25d8d92f15a99c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -692,6 +692,8 @@ void LayoutGrid::computeTrackSizesForIndefiniteSize(
computeUsedBreadthOfGridTracks(direction, sizingData, minIntrinsicSize,
maxIntrinsicSize);
+ // Free Space is always 0 for indefinite sizing computation.
+ sizingData.freeSpace(direction) = LayoutUnit();
svillar 2016/10/17 08:20:33 I disagree with this change for 2 reasons: 1) the
jfernandez 2016/10/17 08:43:54 Well, since we are initializing it to 0, we are ge
svillar 2016/10/17 09:13:19 I understand but what you're doing here is exactly
size_t numberOfTracks = direction == ForColumns
? sizingData.columnTracks.size()
@@ -3212,7 +3214,10 @@ ContentAlignmentData LayoutGrid::computeContentPositionAndDistributionOffset(
OverflowAlignment overflow =
isRowAxis ? styleRef().justifyContentOverflowAlignment()
: styleRef().alignContentOverflowAlignment();
- if (availableFreeSpace <= 0 && overflow == OverflowAlignmentSafe)
+ // TODO (lajava): Default value for overflow isn't exaclty as 'unsafe'.
+ // https://drafts.csswg.org/css-align/#overflow-values
+ if (availableFreeSpace == 0 ||
+ (availableFreeSpace < 0 && overflow == OverflowAlignmentSafe))
return {LayoutUnit(), LayoutUnit()};
switch (position) {
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-content-alignment-overflow-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698