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 #ifndef GridResolvedPosition_h | 5 #ifndef GridResolvedPosition_h |
6 #define GridResolvedPosition_h | 6 #define GridResolvedPosition_h |
7 | 7 |
8 #include "core/style/GridPosition.h" | 8 #include "core/style/GridPosition.h" |
9 #include "wtf/Allocator.h" | 9 #include "wtf/Allocator.h" |
10 | 10 |
(...skipping 11 matching lines...) Expand all Loading... |
22 }; | 22 }; |
23 | 23 |
24 enum GridTrackSizingDirection { | 24 enum GridTrackSizingDirection { |
25 ForColumns, | 25 ForColumns, |
26 ForRows | 26 ForRows |
27 }; | 27 }; |
28 | 28 |
29 // This class represents an index into one of the dimensions of the grid array. | 29 // This class represents an index into one of the dimensions of the grid array. |
30 // Wraps a size_t integer just for the purpose of knowing what we manipulate in
the grid code. | 30 // Wraps a size_t integer just for the purpose of knowing what we manipulate in
the grid code. |
31 class GridResolvedPosition { | 31 class GridResolvedPosition { |
32 DISALLOW_ALLOCATION(); | 32 DISALLOW_NEW(); |
33 public: | 33 public: |
34 static GridResolvedPosition adjustGridPositionForAfterEndSide(size_t resolve
dPosition) | 34 static GridResolvedPosition adjustGridPositionForAfterEndSide(size_t resolve
dPosition) |
35 { | 35 { |
36 return resolvedPosition ? GridResolvedPosition(resolvedPosition - 1) : G
ridResolvedPosition(0); | 36 return resolvedPosition ? GridResolvedPosition(resolvedPosition - 1) : G
ridResolvedPosition(0); |
37 } | 37 } |
38 | 38 |
39 static GridResolvedPosition adjustGridPositionForSide(size_t resolvedPositio
n, GridPositionSide side) | 39 static GridResolvedPosition adjustGridPositionForSide(size_t resolvedPositio
n, GridPositionSide side) |
40 { | 40 { |
41 // An item finishing on the N-th line belongs to the N-1-th cell. | 41 // An item finishing on the N-th line belongs to the N-1-th cell. |
42 if (side == ColumnEndSide || side == RowEndSide) | 42 if (side == ColumnEndSide || side == RowEndSide) |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 private: | 126 private: |
127 | 127 |
128 static size_t explicitGridSizeForSide(const ComputedStyle&, GridPositionSide
); | 128 static size_t explicitGridSizeForSide(const ComputedStyle&, GridPositionSide
); |
129 | 129 |
130 size_t m_integerPosition; | 130 size_t m_integerPosition; |
131 }; | 131 }; |
132 | 132 |
133 } // namespace blink | 133 } // namespace blink |
134 | 134 |
135 #endif // GridResolvedPosition_h | 135 #endif // GridResolvedPosition_h |
OLD | NEW |