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