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 GridPositionsResolver_h |
6 #define GridResolvedPosition_h | 6 #define GridPositionsResolver_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 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 struct GridSpan; | 13 struct GridSpan; |
14 class LayoutBox; | 14 class LayoutBox; |
15 class ComputedStyle; | 15 class ComputedStyle; |
16 | 16 |
17 enum GridPositionSide { | 17 enum GridPositionSide { |
18 ColumnStartSide, | 18 ColumnStartSide, |
19 ColumnEndSide, | 19 ColumnEndSide, |
20 RowStartSide, | 20 RowStartSide, |
21 RowEndSide | 21 RowEndSide |
22 }; | 22 }; |
23 | 23 |
24 enum GridTrackSizingDirection { | 24 enum GridTrackSizingDirection { |
25 ForColumns, | 25 ForColumns, |
26 ForRows | 26 ForRows |
27 }; | 27 }; |
28 | 28 |
29 // This is a utility class with all the code related to grid items positions res
olution. | 29 // This is a utility class with all the code related to grid items positions res
olution. |
30 // TODO(rego): Rename class to GridPositionsResolver. | 30 class GridPositionsResolver { |
31 class GridResolvedPosition { | |
32 DISALLOW_NEW(); | 31 DISALLOW_NEW(); |
33 public: | 32 public: |
34 | 33 |
35 static size_t explicitGridColumnCount(const ComputedStyle&); | 34 static size_t explicitGridColumnCount(const ComputedStyle&); |
36 static size_t explicitGridRowCount(const ComputedStyle&); | 35 static size_t explicitGridRowCount(const ComputedStyle&); |
37 | 36 |
38 static bool isValidNamedLineOrArea(const String& lineName, const ComputedSty
le&, GridPositionSide); | 37 static bool isValidNamedLineOrArea(const String& lineName, const ComputedSty
le&, GridPositionSide); |
39 | 38 |
40 static GridPositionSide initialPositionSide(GridTrackSizingDirection); | 39 static GridPositionSide initialPositionSide(GridTrackSizingDirection); |
41 static GridPositionSide finalPositionSide(GridTrackSizingDirection); | 40 static GridPositionSide finalPositionSide(GridTrackSizingDirection); |
42 | 41 |
43 static size_t spanSizeForAutoPlacedItem(const ComputedStyle&, const LayoutBo
x&, GridTrackSizingDirection); | 42 static size_t spanSizeForAutoPlacedItem(const ComputedStyle&, const LayoutBo
x&, GridTrackSizingDirection); |
44 static GridSpan resolveGridPositionsFromStyle(const ComputedStyle&, const La
youtBox&, GridTrackSizingDirection); | 43 static GridSpan resolveGridPositionsFromStyle(const ComputedStyle&, const La
youtBox&, GridTrackSizingDirection); |
45 | 44 |
46 }; | 45 }; |
47 | 46 |
48 } // namespace blink | 47 } // namespace blink |
49 | 48 |
50 #endif // GridResolvedPosition_h | 49 #endif // GridPositionsResolver_h |
OLD | NEW |