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

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

Issue 2657863005: [css-grid] Clamp the number of auto-repeat tracks (Closed)
Patch Set: Fixed JS syntax in test 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..fc729252b1215b8b1d02fc93bfeccff8258c2c23 100644
--- a/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -2042,6 +2042,12 @@ size_t LayoutGrid::computeAutoRepeatTracksCount(
if (needsToFulfillMinimumSize)
++repetitions;
+ // Clamp the number of repetitions so we don't end up with too many tracks
Manuel Rego 2017/01/27 09:05:57 Nit: Missing dot after comment.
+ if (repetitions > kGridMaxTracks) {
+ repetitions =
+ (kGridMaxTracks - trackSizes.size()) / autoRepeatTrackListLength;
eae 2017/01/26 17:07:23 I know we early return if autoRepeatTrackListLengt
+ }
+
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