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_direction.h" | 9 #include "core/layout/ng/ng_direction.h" |
10 #include "core/layout/ng/ng_writing_mode.h" | 10 #include "core/layout/ng/ng_writing_mode.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 MinSize, | 21 MinSize, |
22 MaxSize, | 22 MaxSize, |
23 ContentSize, | 23 ContentSize, |
24 MarginBorderPaddingSize | 24 MarginBorderPaddingSize |
25 }; | 25 }; |
26 | 26 |
27 #define NGSizeIndefinite LayoutUnit(-1) | 27 #define NGSizeIndefinite LayoutUnit(-1) |
28 | 28 |
29 // Convert an inline-axis length to a layout unit using the given constraint | 29 // Convert an inline-axis length to a layout unit using the given constraint |
30 // space. | 30 // space. |
31 CORE_EXPORT LayoutUnit resolveInlineLength(const NGConstraintSpace&, | 31 CORE_EXPORT LayoutUnit ResolveInlineLength(const NGConstraintSpace&, |
32 const ComputedStyle&, | 32 const ComputedStyle&, |
33 const Length&, | 33 const Length&, |
34 LengthResolveType); | 34 LengthResolveType); |
35 | 35 |
36 // Convert a block-axis length to a layout unit using the given constraint | 36 // Convert a block-axis length to a layout unit using the given constraint |
37 // space and content size. | 37 // space and content size. |
38 CORE_EXPORT LayoutUnit resolveBlockLength(const NGConstraintSpace&, | 38 CORE_EXPORT LayoutUnit ResolveBlockLength(const NGConstraintSpace&, |
39 const ComputedStyle&, | 39 const ComputedStyle&, |
40 const Length&, | 40 const Length&, |
41 LayoutUnit contentSize, | 41 LayoutUnit contentSize, |
42 LengthResolveType); | 42 LengthResolveType); |
43 | 43 |
44 // Resolves the given length to a layout unit, constraining it by the min | 44 // Resolves the given length to a layout unit, constraining it by the min |
45 // logical width and max logical width properties from the ComputedStyle | 45 // logical width and max logical width properties from the ComputedStyle |
46 // object. | 46 // object. |
47 CORE_EXPORT LayoutUnit computeInlineSizeForFragment(const NGConstraintSpace&, | 47 CORE_EXPORT LayoutUnit ComputeInlineSizeForFragment(const NGConstraintSpace&, |
48 const ComputedStyle&); | 48 const ComputedStyle&); |
49 | 49 |
50 // Resolves the given length to a layout unit, constraining it by the min | 50 // Resolves the given length to a layout unit, constraining it by the min |
51 // logical height and max logical height properties from the ComputedStyle | 51 // logical height and max logical height properties from the ComputedStyle |
52 // object. | 52 // object. |
53 CORE_EXPORT LayoutUnit computeBlockSizeForFragment(const NGConstraintSpace&, | 53 CORE_EXPORT LayoutUnit ComputeBlockSizeForFragment(const NGConstraintSpace&, |
54 const ComputedStyle&, | 54 const ComputedStyle&, |
55 LayoutUnit contentSize); | 55 LayoutUnit contentSize); |
56 | 56 |
57 CORE_EXPORT NGBoxStrut computeMargins(const NGConstraintSpace&, | 57 CORE_EXPORT NGBoxStrut ComputeMargins(const NGConstraintSpace&, |
58 const ComputedStyle&, | 58 const ComputedStyle&, |
59 const NGWritingMode writing_mode, | 59 const NGWritingMode writing_mode, |
60 const NGDirection direction); | 60 const NGDirection direction); |
61 | 61 |
62 CORE_EXPORT NGBoxStrut computeBorders(const ComputedStyle&); | 62 CORE_EXPORT NGBoxStrut ComputeBorders(const ComputedStyle&); |
63 | 63 |
64 CORE_EXPORT NGBoxStrut computePadding(const NGConstraintSpace&, | 64 CORE_EXPORT NGBoxStrut ComputePadding(const NGConstraintSpace&, |
65 const ComputedStyle&); | 65 const ComputedStyle&); |
66 | 66 |
67 // Resolves margin: auto in the inline direction after a box has been laid out. | 67 // Resolves margin: auto in the inline direction after a box has been laid out. |
68 // This uses the container size from the constraint space and the box size from | 68 // This uses the container size from the constraint space and the box size from |
69 // the fragment to compute the margins that are auto, if any, and adjusts | 69 // the fragment to compute the margins that are auto, if any, and adjusts |
70 // the given NGBoxStrut accordingly. | 70 // the given NGBoxStrut accordingly. |
71 CORE_EXPORT void ApplyAutoMargins(const NGConstraintSpace&, | 71 CORE_EXPORT void ApplyAutoMargins(const NGConstraintSpace&, |
72 const ComputedStyle&, | 72 const ComputedStyle&, |
73 const NGFragment&, | 73 const NGFragment&, |
74 NGBoxStrut& margins); | 74 NGBoxStrut& margins); |
75 | 75 |
76 } // namespace blink | 76 } // namespace blink |
77 | 77 |
78 #endif // NGLengthUtils_h | 78 #endif // NGLengthUtils_h |
OLD | NEW |