OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 GridTrackSizingAlgorithm_h | 5 #ifndef GridTrackSizingAlgorithm_h |
6 #define GridTrackSizingAlgorithm_h | 6 #define GridTrackSizingAlgorithm_h |
7 | 7 |
8 #include <memory> | 8 #include <memory> |
9 #include "core/layout/LayoutBox.h" | 9 #include "core/layout/LayoutBox.h" |
10 #include "core/style/GridPositionsResolver.h" | 10 #include "core/style/GridPositionsResolver.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 LayoutUnit MaxContentSize() const { return max_content_size_; }; | 103 LayoutUnit MaxContentSize() const { return max_content_size_; }; |
104 | 104 |
105 Vector<GridTrack>& Tracks(GridTrackSizingDirection); | 105 Vector<GridTrack>& Tracks(GridTrackSizingDirection); |
106 const Vector<GridTrack>& Tracks(GridTrackSizingDirection) const; | 106 const Vector<GridTrack>& Tracks(GridTrackSizingDirection) const; |
107 | 107 |
108 Optional<LayoutUnit> FreeSpace(GridTrackSizingDirection); | 108 Optional<LayoutUnit> FreeSpace(GridTrackSizingDirection); |
109 void SetFreeSpace(GridTrackSizingDirection, Optional<LayoutUnit>); | 109 void SetFreeSpace(GridTrackSizingDirection, Optional<LayoutUnit>); |
110 | 110 |
111 #if DCHECK_IS_ON() | 111 #if DCHECK_IS_ON() |
112 bool TracksAreWiderThanMinTrackBreadth() const; | 112 bool TracksAreWiderThanMinTrackBreadth() const; |
113 bool IsTrackSizingOperation() const { | |
114 return sizing_operation_ == kTrackSizing; | |
115 }; | |
116 #endif | 113 #endif |
117 | 114 |
118 private: | 115 private: |
119 GridTrackSize GetGridTrackSize(GridTrackSizingDirection, | 116 GridTrackSize GetGridTrackSize(GridTrackSizingDirection, |
120 size_t translated_index) const; | 117 size_t translated_index) const; |
121 GridTrackSize RawGridTrackSize(GridTrackSizingDirection, | 118 GridTrackSize RawGridTrackSize(GridTrackSizingDirection, |
122 size_t translated_index) const; | 119 size_t translated_index) const; |
123 LayoutUnit AssumedRowsSizeForOrthogonalChild(const LayoutBox&) const; | 120 LayoutUnit AssumedRowsSizeForOrthogonalChild(const LayoutBox&) const; |
124 LayoutUnit ComputeTrackBasedSize() const; | 121 LayoutUnit ComputeTrackBasedSize() const; |
125 | 122 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 static GridTrackSizingDirection FlowAwareDirectionForChild( | 296 static GridTrackSizingDirection FlowAwareDirectionForChild( |
300 const LayoutGrid*, | 297 const LayoutGrid*, |
301 const LayoutBox& child, | 298 const LayoutBox& child, |
302 GridTrackSizingDirection); | 299 GridTrackSizingDirection); |
303 | 300 |
304 GridTrackSizingAlgorithm& algorithm_; | 301 GridTrackSizingAlgorithm& algorithm_; |
305 }; | 302 }; |
306 } | 303 } |
307 | 304 |
308 #endif // GridTrackSizingAlgorithm_h | 305 #endif // GridTrackSizingAlgorithm_h |
OLD | NEW |