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

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

Issue 2336663002: [css-grid] Too many gaps with trailing collapsing tracks (Closed)
Patch Set: Patch for landing Created 4 years, 3 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-auto-fit-columns.html ('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 c76dd7d4fd35df8cd800ba1964120a2db2a3be4e..768d81a059f4d4d6edf34dd661a7247cc26adb7c 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -565,6 +565,12 @@ LayoutUnit LayoutGrid::guttersSize(GridTrackSizingDirection direction, size_t st
gapAccumulator += gap;
}
+ // The above loop adds one extra gap for trailing collapsed tracks.
+ if (gapAccumulator && isEmptyAutoRepeatTrack(direction, endLine - 1)) {
+ DCHECK_GE(gapAccumulator, gap);
+ gapAccumulator -= gap;
+ }
+
// If the startLine is the start line of a collapsed track we need to go backwards till we reach
// a non collapsed track. If we find a non collapsed track we need to add that gap.
if (startLine && isEmptyAutoRepeatTrack(direction, startLine)) {
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-auto-fit-columns.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698