OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "GridPositionsResolver.h" | 5 #include "GridPositionsResolver.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include "core/layout/LayoutBox.h" | 8 #include "core/layout/LayoutBox.h" |
9 #include "core/style/GridArea.h" | 9 #include "core/style/GridArea.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 static inline GridTrackSizingDirection directionFromSide( | 13 static inline GridTrackSizingDirection directionFromSide( |
14 GridPositionSide side) { | 14 GridPositionSide side) { |
15 return side == ColumnStartSide || side == ColumnEndSide ? ForColumns | 15 return side == ColumnStartSide || side == ColumnEndSide ? ForColumns |
16 : ForRows; | 16 : ForRows; |
17 } | 17 } |
18 | 18 |
19 static inline String implicitNamedGridLineForSide(const String& lineName, | 19 static inline String implicitNamedGridLineForSide(const String& lineName, |
20 GridPositionSide side) { | 20 GridPositionSide side) { |
21 return lineName + ((side == ColumnStartSide || side == RowStartSide) | 21 return lineName + |
22 ? "-start" | 22 ((side == ColumnStartSide || side == RowStartSide) ? "-start" |
23 : "-end"); | 23 : "-end"); |
24 } | 24 } |
25 | 25 |
26 NamedLineCollection::NamedLineCollection( | 26 NamedLineCollection::NamedLineCollection( |
27 const ComputedStyle& gridContainerStyle, | 27 const ComputedStyle& gridContainerStyle, |
28 const String& namedLine, | 28 const String& namedLine, |
29 GridTrackSizingDirection direction, | 29 GridTrackSizingDirection direction, |
30 size_t lastLine, | 30 size_t lastLine, |
31 size_t autoRepeatTracksCount) | 31 size_t autoRepeatTracksCount) |
32 : m_lastLine(lastLine), m_autoRepeatTotalTracks(autoRepeatTracksCount) { | 32 : m_lastLine(lastLine), m_autoRepeatTotalTracks(autoRepeatTracksCount) { |
33 bool isRowAxis = direction == ForColumns; | 33 bool isRowAxis = direction == ForColumns; |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 | 515 |
516 if (endLine < startLine) | 516 if (endLine < startLine) |
517 std::swap(endLine, startLine); | 517 std::swap(endLine, startLine); |
518 else if (endLine == startLine) | 518 else if (endLine == startLine) |
519 endLine = startLine + 1; | 519 endLine = startLine + 1; |
520 | 520 |
521 return GridSpan::untranslatedDefiniteGridSpan(startLine, endLine); | 521 return GridSpan::untranslatedDefiniteGridSpan(startLine, endLine); |
522 } | 522 } |
523 | 523 |
524 } // namespace blink | 524 } // namespace blink |
OLD | NEW |