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 | 9 |
10 namespace blink { | 10 namespace blink { |
11 class ComputedStyle; | 11 class ComputedStyle; |
12 class LayoutUnit; | 12 class LayoutUnit; |
13 class Length; | 13 class Length; |
14 class NGConstraintSpace; | 14 class NGConstraintSpace; |
15 struct NGBoxStrut; | 15 struct NGBoxStrut; |
16 | 16 |
17 enum class LengthResolveType { MinSize, MaxSize, ContentSize, MarginSize }; | 17 enum class LengthResolveType { |
| 18 MinSize, |
| 19 MaxSize, |
| 20 ContentSize, |
| 21 MarginBorderPaddingSize |
| 22 }; |
18 | 23 |
19 #define NGSizeIndefinite LayoutUnit(-1) | 24 #define NGSizeIndefinite LayoutUnit(-1) |
20 | 25 |
21 // Convert an inline-axis length to a layout unit using the given constraint | 26 // Convert an inline-axis length to a layout unit using the given constraint |
22 // space. | 27 // space. |
23 CORE_EXPORT LayoutUnit resolveInlineLength(const NGConstraintSpace&, | 28 CORE_EXPORT LayoutUnit resolveInlineLength(const NGConstraintSpace&, |
24 const Length&, | 29 const Length&, |
25 LengthResolveType); | 30 LengthResolveType); |
26 | 31 |
27 // Convert a block-axis length to a layout unit using the given constraint | 32 // Convert a block-axis length to a layout unit using the given constraint |
(...skipping 12 matching lines...) Expand all Loading... |
40 // Resolves the given length to a layout unit, constraining it by the min | 45 // Resolves the given length to a layout unit, constraining it by the min |
41 // logical height and max logical height properties from the ComputedStyle | 46 // logical height and max logical height properties from the ComputedStyle |
42 // object. | 47 // object. |
43 CORE_EXPORT LayoutUnit computeBlockSizeForFragment(const NGConstraintSpace&, | 48 CORE_EXPORT LayoutUnit computeBlockSizeForFragment(const NGConstraintSpace&, |
44 const ComputedStyle&, | 49 const ComputedStyle&, |
45 LayoutUnit contentSize); | 50 LayoutUnit contentSize); |
46 | 51 |
47 CORE_EXPORT NGBoxStrut computeMargins(const NGConstraintSpace&, | 52 CORE_EXPORT NGBoxStrut computeMargins(const NGConstraintSpace&, |
48 const ComputedStyle&); | 53 const ComputedStyle&); |
49 | 54 |
| 55 CORE_EXPORT NGBoxStrut computeBorders(const ComputedStyle&); |
| 56 |
| 57 CORE_EXPORT NGBoxStrut computePadding(const NGConstraintSpace&, |
| 58 const ComputedStyle&); |
| 59 |
50 } // namespace blink | 60 } // namespace blink |
51 | 61 |
52 #endif // NGLengthUtils_h | 62 #endif // NGLengthUtils_h |
OLD | NEW |