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 NGBlockLayoutAlgorithm_h | 5 #ifndef NGBlockLayoutAlgorithm_h |
6 #define NGBlockLayoutAlgorithm_h | 6 #define NGBlockLayoutAlgorithm_h |
7 | 7 |
8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
9 #include "core/layout/ng/geometry/ng_margin_strut.h" | 9 #include "core/layout/ng/geometry/ng_margin_strut.h" |
10 #include "core/layout/ng/ng_block_break_token.h" | 10 #include "core/layout/ng/ng_block_break_token.h" |
11 #include "core/layout/ng/ng_block_node.h" | 11 #include "core/layout/ng/ng_block_node.h" |
12 #include "core/layout/ng/ng_constraint_space_builder.h" | 12 #include "core/layout/ng/ng_constraint_space_builder.h" |
13 #include "core/layout/ng/ng_fragment_builder.h" | |
14 #include "core/layout/ng/ng_layout_algorithm.h" | 13 #include "core/layout/ng/ng_layout_algorithm.h" |
15 #include "platform/wtf/RefPtr.h" | 14 #include "platform/wtf/RefPtr.h" |
16 | 15 |
17 namespace blink { | 16 namespace blink { |
18 | 17 |
19 class NGConstraintSpace; | 18 class NGConstraintSpace; |
20 class NGLayoutResult; | 19 class NGLayoutResult; |
21 | 20 |
22 // Updates the fragment's BFC offset if it's not already set. | 21 // Updates the fragment's BFC offset if it's not already set. |
23 void MaybeUpdateFragmentBfcOffset(const NGConstraintSpace&, | 22 void MaybeUpdateFragmentBfcOffset(const NGConstraintSpace&, |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 // token if we're out of space. | 56 // token if we're out of space. |
58 void FinalizeForFragmentation(); | 57 void FinalizeForFragmentation(); |
59 | 58 |
60 // Calculates logical offset for the current fragment using either | 59 // Calculates logical offset for the current fragment using either |
61 // {@code content_size_} when the fragment doesn't know it's offset | 60 // {@code content_size_} when the fragment doesn't know it's offset |
62 // or {@code known_fragment_offset} if the fragment knows it's offset | 61 // or {@code known_fragment_offset} if the fragment knows it's offset |
63 // @return Fragment's offset relative to the fragment's parent. | 62 // @return Fragment's offset relative to the fragment's parent. |
64 NGLogicalOffset CalculateLogicalOffset( | 63 NGLogicalOffset CalculateLogicalOffset( |
65 const WTF::Optional<NGLogicalOffset>& known_fragment_offset); | 64 const WTF::Optional<NGLogicalOffset>& known_fragment_offset); |
66 | 65 |
67 NGFragmentBuilder builder_; | |
68 NGConstraintSpaceBuilder space_builder_; | 66 NGConstraintSpaceBuilder space_builder_; |
69 | 67 |
70 NGBoxStrut border_and_padding_; | 68 NGBoxStrut border_and_padding_; |
71 LayoutUnit content_size_; | 69 LayoutUnit content_size_; |
72 LayoutUnit max_inline_size_; | 70 LayoutUnit max_inline_size_; |
73 // MarginStrut for the previous child. | 71 // MarginStrut for the previous child. |
74 NGMarginStrut curr_margin_strut_; | 72 NGMarginStrut curr_margin_strut_; |
75 NGLogicalOffset curr_bfc_offset_; | 73 NGLogicalOffset curr_bfc_offset_; |
76 NGBoxStrut curr_child_margins_; | 74 NGBoxStrut curr_child_margins_; |
77 }; | 75 }; |
78 | 76 |
79 } // namespace blink | 77 } // namespace blink |
80 | 78 |
81 #endif // NGBlockLayoutAlgorithm_h | 79 #endif // NGBlockLayoutAlgorithm_h |
OLD | NEW |