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

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

Issue 2657863005: [css-grid] Clamp the number of auto-repeat tracks (Closed)
Patch Set: Patch for landing Created 3 years, 11 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-repeat-huge-grid.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 017e0dafe045673093764f7ac01a09e4b1f146a3..16481de35e7f39ff15dc10cffea1bf5fef404485 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -2042,6 +2042,13 @@ size_t LayoutGrid::computeAutoRepeatTracksCount(
if (needsToFulfillMinimumSize)
++repetitions;
+ // Clamp the number of repetitions so we don't end up with too many tracks.
+ if (repetitions > kGridMaxTracks) {
+ DCHECK_GT(autoRepeatTrackListLength, 0u);
+ repetitions =
+ (kGridMaxTracks - trackSizes.size()) / autoRepeatTrackListLength;
+ }
+
return repetitions * autoRepeatTrackListLength;
}
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-auto-repeat-huge-grid.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698