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

Side by Side Diff: third_party/WebKit/Source/core/layout/Grid.cpp

Issue 2670363003: [css-grid] Clamp the number of auto repeat tracks in all cases (Closed)
Patch Set: New version matching the specs Created 3 years, 10 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 unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/layout/Grid.h" 5 #include "core/layout/Grid.h"
6 6
7 #include "core/layout/LayoutGrid.h" 7 #include "core/layout/LayoutGrid.h"
8 8
9 namespace blink { 9 namespace blink {
10 10
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 } 74 }
75 75
76 #if DCHECK_IS_ON() 76 #if DCHECK_IS_ON()
77 bool Grid::hasAnyGridItemPaintOrder() const { 77 bool Grid::hasAnyGridItemPaintOrder() const {
78 return !m_gridItemsIndexesMap.isEmpty(); 78 return !m_gridItemsIndexesMap.isEmpty();
79 } 79 }
80 #endif 80 #endif
81 81
82 void Grid::setAutoRepeatTracks(size_t autoRepeatRows, 82 void Grid::setAutoRepeatTracks(size_t autoRepeatRows,
83 size_t autoRepeatColumns) { 83 size_t autoRepeatColumns) {
84 DCHECK_GE(static_cast<unsigned>(kGridMaxTracks),
85 numTracks(ForRows) + autoRepeatRows);
86 DCHECK_GE(static_cast<unsigned>(kGridMaxTracks),
87 numTracks(ForColumns) + autoRepeatColumns);
84 m_autoRepeatRows = autoRepeatRows; 88 m_autoRepeatRows = autoRepeatRows;
85 m_autoRepeatColumns = autoRepeatColumns; 89 m_autoRepeatColumns = autoRepeatColumns;
86 } 90 }
87 91
88 size_t Grid::autoRepeatTracks(GridTrackSizingDirection direction) const { 92 size_t Grid::autoRepeatTracks(GridTrackSizingDirection direction) const {
89 return direction == ForRows ? m_autoRepeatRows : m_autoRepeatColumns; 93 return direction == ForRows ? m_autoRepeatRows : m_autoRepeatColumns;
90 } 94 }
91 95
92 void Grid::setAutoRepeatEmptyColumns( 96 void Grid::setAutoRepeatEmptyColumns(
93 std::unique_ptr<OrderedTrackIndexSet> autoRepeatEmptyColumns) { 97 std::unique_ptr<OrderedTrackIndexSet> autoRepeatEmptyColumns) {
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 // Advance the iterator to avoid an infinite loop where we would return 233 // Advance the iterator to avoid an infinite loop where we would return
230 // the same grid area over and over. 234 // the same grid area over and over.
231 ++varyingTrackIndex; 235 ++varyingTrackIndex;
232 return result; 236 return result;
233 } 237 }
234 } 238 }
235 return nullptr; 239 return nullptr;
236 } 240 }
237 241
238 } // namespace blink 242 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698