Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2011 Apple Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 2024 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2035 size_t repetitions = | 2035 size_t repetitions = |
| 2036 1 + (freeSpace / (autoRepeatTracksSize + gapSize)).toInt(); | 2036 1 + (freeSpace / (autoRepeatTracksSize + gapSize)).toInt(); |
| 2037 | 2037 |
| 2038 // Provided the grid container does not have a definite size or max-size in | 2038 // Provided the grid container does not have a definite size or max-size in |
| 2039 // the relevant axis, if the min size is definite then the number of | 2039 // the relevant axis, if the min size is definite then the number of |
| 2040 // repetitions is the largest possible positive integer that fulfills that | 2040 // repetitions is the largest possible positive integer that fulfills that |
| 2041 // minimum requirement. | 2041 // minimum requirement. |
| 2042 if (needsToFulfillMinimumSize) | 2042 if (needsToFulfillMinimumSize) |
| 2043 ++repetitions; | 2043 ++repetitions; |
| 2044 | 2044 |
| 2045 // 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.
| |
| 2046 if (repetitions > kGridMaxTracks) { | |
| 2047 repetitions = | |
| 2048 (kGridMaxTracks - trackSizes.size()) / autoRepeatTrackListLength; | |
|
eae
2017/01/26 17:07:23
I know we early return if autoRepeatTrackListLengt
| |
| 2049 } | |
| 2050 | |
| 2045 return repetitions * autoRepeatTrackListLength; | 2051 return repetitions * autoRepeatTrackListLength; |
| 2046 } | 2052 } |
| 2047 | 2053 |
| 2048 std::unique_ptr<LayoutGrid::OrderedTrackIndexSet> | 2054 std::unique_ptr<LayoutGrid::OrderedTrackIndexSet> |
| 2049 LayoutGrid::computeEmptyTracksForAutoRepeat( | 2055 LayoutGrid::computeEmptyTracksForAutoRepeat( |
| 2050 Grid& grid, | 2056 Grid& grid, |
| 2051 GridTrackSizingDirection direction) const { | 2057 GridTrackSizingDirection direction) const { |
| 2052 bool isRowAxis = direction == ForColumns; | 2058 bool isRowAxis = direction == ForColumns; |
| 2053 if ((isRowAxis && styleRef().gridAutoRepeatColumnsType() != AutoFit) || | 2059 if ((isRowAxis && styleRef().gridAutoRepeatColumnsType() != AutoFit) || |
| 2054 (!isRowAxis && styleRef().gridAutoRepeatRowsType() != AutoFit)) | 2060 (!isRowAxis && styleRef().gridAutoRepeatRowsType() != AutoFit)) |
| (...skipping 1566 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3621 if (direction == ForRows) | 3627 if (direction == ForRows) |
| 3622 return grid.numTracks(ForRows); | 3628 return grid.numTracks(ForRows); |
| 3623 | 3629 |
| 3624 return grid.numTracks(ForRows) | 3630 return grid.numTracks(ForRows) |
| 3625 ? grid.numTracks(ForColumns) | 3631 ? grid.numTracks(ForColumns) |
| 3626 : GridPositionsResolver::explicitGridColumnCount( | 3632 : GridPositionsResolver::explicitGridColumnCount( |
| 3627 styleRef(), grid.autoRepeatTracks(ForColumns)); | 3633 styleRef(), grid.autoRepeatTracks(ForColumns)); |
| 3628 } | 3634 } |
| 3629 | 3635 |
| 3630 } // namespace blink | 3636 } // namespace blink |
| OLD | NEW |