| 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 14 matching lines...) Expand all Loading... |
| 25 ForColumns, | 25 ForColumns, |
| 26 ForRows | 26 ForRows |
| 27 }; | 27 }; |
| 28 | 28 |
| 29 // This class represents a line index into one of the dimensions of the grid arr
ay. | 29 // This class represents a line index into one of the dimensions of the grid arr
ay. |
| 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_NEW(); | 32 DISALLOW_NEW(); |
| 33 public: | 33 public: |
| 34 | 34 |
| 35 static bool isValidNamedLineOrArea(const String& lineName, const ComputedSty
le&, GridPositionSide); | |
| 36 static GridPositionSide initialPositionSide(GridTrackSizingDirection); | |
| 37 static GridPositionSide finalPositionSide(GridTrackSizingDirection); | |
| 38 static void initialAndFinalPositionsFromStyle(const ComputedStyle&, const La
youtBox&, GridTrackSizingDirection, GridPosition &initialPosition, GridPosition
&finalPosition); | |
| 39 static GridSpan resolveGridPositionsFromAutoPlacementPosition(const Computed
Style&, const LayoutBox&, GridTrackSizingDirection, const GridResolvedPosition&)
; | |
| 40 static GridSpan resolveGridPositionsFromStyle(const ComputedStyle&, const La
youtBox&, GridTrackSizingDirection); | |
| 41 static GridResolvedPosition resolveNamedGridLinePositionFromStyle(const Comp
utedStyle&, const GridPosition&, GridPositionSide); | |
| 42 static GridResolvedPosition resolveGridPositionFromStyle(const ComputedStyle
&, const GridPosition&, GridPositionSide); | |
| 43 static GridSpan resolveGridPositionAgainstOppositePosition(const ComputedSty
le&, const GridResolvedPosition& resolvedOppositePosition, const GridPosition&,
GridPositionSide); | |
| 44 static GridSpan resolveNamedGridLinePositionAgainstOppositePosition(const Co
mputedStyle&, const GridResolvedPosition& resolvedOppositePosition, const GridPo
sition&, GridPositionSide); | |
| 45 | |
| 46 GridResolvedPosition(size_t position) | 35 GridResolvedPosition(size_t position) |
| 47 : m_integerPosition(position) | 36 : m_integerPosition(position) |
| 48 { | 37 { |
| 49 } | 38 } |
| 50 | 39 |
| 51 GridResolvedPosition& operator*() | 40 GridResolvedPosition& operator*() |
| 52 { | 41 { |
| 53 return *this; | 42 return *this; |
| 54 } | 43 } |
| 55 | 44 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 } | 89 } |
| 101 | 90 |
| 102 GridResolvedPosition prev() const | 91 GridResolvedPosition prev() const |
| 103 { | 92 { |
| 104 return GridResolvedPosition(m_integerPosition > 0 ? m_integerPosition -
1 : 0); | 93 return GridResolvedPosition(m_integerPosition > 0 ? m_integerPosition -
1 : 0); |
| 105 } | 94 } |
| 106 | 95 |
| 107 static size_t explicitGridColumnCount(const ComputedStyle&); | 96 static size_t explicitGridColumnCount(const ComputedStyle&); |
| 108 static size_t explicitGridRowCount(const ComputedStyle&); | 97 static size_t explicitGridRowCount(const ComputedStyle&); |
| 109 | 98 |
| 99 static bool isValidNamedLineOrArea(const String& lineName, const ComputedSty
le&, GridPositionSide); |
| 100 |
| 101 static GridPositionSide initialPositionSide(GridTrackSizingDirection); |
| 102 static GridPositionSide finalPositionSide(GridTrackSizingDirection); |
| 103 |
| 104 static GridSpan resolveGridPositionsFromAutoPlacementPosition(const Computed
Style&, const LayoutBox&, GridTrackSizingDirection, const GridResolvedPosition&)
; |
| 105 static GridSpan resolveGridPositionsFromStyle(const ComputedStyle&, const La
youtBox&, GridTrackSizingDirection); |
| 106 |
| 110 private: | 107 private: |
| 111 | 108 |
| 112 static size_t explicitGridSizeForSide(const ComputedStyle&, GridPositionSide
); | |
| 113 | |
| 114 size_t m_integerPosition; | 109 size_t m_integerPosition; |
| 115 }; | 110 }; |
| 116 | 111 |
| 117 } // namespace blink | 112 } // namespace blink |
| 118 | 113 |
| 119 #endif // GridResolvedPosition_h | 114 #endif // GridResolvedPosition_h |
| OLD | NEW |