OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 NGLengthUtils_h | 5 #ifndef NGLengthUtils_h |
6 #define NGLengthUtils_h | 6 #define NGLengthUtils_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/ng/ng_units.h" | 9 #include "core/layout/ng/ng_units.h" |
10 #include "core/layout/ng/ng_writing_mode.h" | 10 #include "core/layout/ng/ng_writing_mode.h" |
11 #include "platform/text/TextDirection.h" | 11 #include "platform/text/TextDirection.h" |
12 #include "wtf/Optional.h" | 12 #include "wtf/Optional.h" |
13 | 13 |
14 namespace blink { | 14 namespace blink { |
15 class ComputedStyle; | 15 class ComputedStyle; |
16 class LayoutUnit; | 16 class LayoutUnit; |
17 class Length; | 17 class Length; |
18 struct MinAndMaxContentSizes; | 18 struct MinAndMaxContentSizes; |
19 class NGConstraintSpace; | 19 class NGConstraintSpace; |
20 struct NGBoxStrut; | 20 struct NGBoxStrut; |
21 class NGFragmentBase; | 21 class NGFragment; |
22 | 22 |
23 enum class LengthResolveType { | 23 enum class LengthResolveType { |
24 kMinSize, | 24 kMinSize, |
25 kMaxSize, | 25 kMaxSize, |
26 kContentSize, | 26 kContentSize, |
27 kMarginBorderPaddingSize | 27 kMarginBorderPaddingSize |
28 }; | 28 }; |
29 | 29 |
30 #define NGSizeIndefinite LayoutUnit(-1) | 30 #define NGSizeIndefinite LayoutUnit(-1) |
31 | 31 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 | 111 |
112 CORE_EXPORT NGBoxStrut ComputePadding(const NGConstraintSpace&, | 112 CORE_EXPORT NGBoxStrut ComputePadding(const NGConstraintSpace&, |
113 const ComputedStyle&); | 113 const ComputedStyle&); |
114 | 114 |
115 // Resolves margin: auto in the inline direction after a box has been laid out. | 115 // Resolves margin: auto in the inline direction after a box has been laid out. |
116 // This uses the available size from the constraint space and the box size from | 116 // This uses the available size from the constraint space and the box size from |
117 // the fragment to compute the margins that are auto, if any, and adjusts | 117 // the fragment to compute the margins that are auto, if any, and adjusts |
118 // the given NGBoxStrut accordingly. | 118 // the given NGBoxStrut accordingly. |
119 CORE_EXPORT void ApplyAutoMargins(const NGConstraintSpace&, | 119 CORE_EXPORT void ApplyAutoMargins(const NGConstraintSpace&, |
120 const ComputedStyle&, | 120 const ComputedStyle&, |
121 const NGFragmentBase&, | 121 const NGFragment&, |
122 NGBoxStrut* margins); | 122 NGBoxStrut* margins); |
123 | 123 |
124 } // namespace blink | 124 } // namespace blink |
125 | 125 |
126 #endif // NGLengthUtils_h | 126 #endif // NGLengthUtils_h |
OLD | NEW |