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/ng_block_node.h" | 9 #include "core/layout/ng/ng_block_node.h" |
10 #include "core/layout/ng/ng_break_token.h" | 10 #include "core/layout/ng/ng_break_token.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 return content_size_; | 94 return content_size_; |
95 } | 95 } |
96 | 96 |
97 // Calculates logical offset for the current fragment using either | 97 // Calculates logical offset for the current fragment using either |
98 // {@code content_size_} when the fragment doesn't know it's offset | 98 // {@code content_size_} when the fragment doesn't know it's offset |
99 // or {@code known_fragment_offset} if the fragment knows it's offset | 99 // or {@code known_fragment_offset} if the fragment knows it's offset |
100 // @return Fragment's offset relative to the fragment's parent. | 100 // @return Fragment's offset relative to the fragment's parent. |
101 NGLogicalOffset CalculateLogicalOffset( | 101 NGLogicalOffset CalculateLogicalOffset( |
102 const WTF::Optional<NGLogicalOffset>& known_fragment_offset); | 102 const WTF::Optional<NGLogicalOffset>& known_fragment_offset); |
103 | 103 |
| 104 // Updates the fragment's BFC offset if it's not already set. |
| 105 void UpdateFragmentBfcOffset(const NGLogicalOffset& offset); |
| 106 |
104 NGLogicalOffset GetChildSpaceOffset() const { | 107 NGLogicalOffset GetChildSpaceOffset() const { |
105 return NGLogicalOffset(border_and_padding_.inline_start, content_size_); | 108 return NGLogicalOffset(border_and_padding_.inline_start, content_size_); |
106 } | 109 } |
107 | 110 |
108 // Read-only Getters. | 111 // Read-only Getters. |
109 const ComputedStyle& CurrentChildStyle() const { | 112 const ComputedStyle& CurrentChildStyle() const { |
110 DCHECK(current_child_); | 113 DCHECK(current_child_); |
111 return toNGBlockNode(current_child_)->Style(); | 114 return toNGBlockNode(current_child_)->Style(); |
112 } | 115 } |
113 | 116 |
(...skipping 29 matching lines...) Expand all Loading... |
143 // MarginStrut for the previous child. | 146 // MarginStrut for the previous child. |
144 NGMarginStrut curr_margin_strut_; | 147 NGMarginStrut curr_margin_strut_; |
145 NGLogicalOffset bfc_offset_; | 148 NGLogicalOffset bfc_offset_; |
146 NGLogicalOffset curr_bfc_offset_; | 149 NGLogicalOffset curr_bfc_offset_; |
147 NGBoxStrut curr_child_margins_; | 150 NGBoxStrut curr_child_margins_; |
148 }; | 151 }; |
149 | 152 |
150 } // namespace blink | 153 } // namespace blink |
151 | 154 |
152 #endif // NGBlockLayoutAlgorithm_h | 155 #endif // NGBlockLayoutAlgorithm_h |
OLD | NEW |