| 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" |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 // position because the parent fragment's BFC is known. | 92 // position because the parent fragment's BFC is known. |
| 93 // Example: | 93 // Example: |
| 94 // BFC Offset is known here because of the padding. | 94 // BFC Offset is known here because of the padding. |
| 95 // <div style="padding: 1px"> | 95 // <div style="padding: 1px"> |
| 96 // <div id="empty-div" style="margins: 1px"></div> | 96 // <div id="empty-div" style="margins: 1px"></div> |
| 97 NGLogicalOffset PositionWithParentBfc(const NGConstraintSpace&, | 97 NGLogicalOffset PositionWithParentBfc(const NGConstraintSpace&, |
| 98 const NGBoxFragment&); | 98 const NGBoxFragment&); |
| 99 | 99 |
| 100 NGLogicalOffset PositionLegacy(const NGConstraintSpace& child_space); | 100 NGLogicalOffset PositionLegacy(const NGConstraintSpace& child_space); |
| 101 | 101 |
| 102 void FinishFloatChildLayout(const ComputedStyle&, | 102 void HandleOutOfFlowPositioned(NGBlockNode*); |
| 103 NGBlockNode*, | 103 void HandleFloating(NGBlockNode*, NGBlockBreakToken*); |
| 104 NGBlockBreakToken*); | |
| 105 | 104 |
| 106 // Final adjustments before fragment creation. We need to prevent the | 105 // Final adjustments before fragment creation. We need to prevent the |
| 107 // fragment from crossing fragmentainer boundaries, and rather create a break | 106 // fragment from crossing fragmentainer boundaries, and rather create a break |
| 108 // token if we're out of space. | 107 // token if we're out of space. |
| 109 void FinalizeForFragmentation(); | 108 void FinalizeForFragmentation(); |
| 110 | 109 |
| 111 // Calculates logical offset for the current fragment using either | 110 // Calculates logical offset for the current fragment using either |
| 112 // {@code content_size_} when the fragment doesn't know it's offset | 111 // {@code content_size_} when the fragment doesn't know it's offset |
| 113 // or {@code known_fragment_offset} if the fragment knows it's offset | 112 // or {@code known_fragment_offset} if the fragment knows it's offset |
| 114 // @return Fragment's offset relative to the fragment's parent. | 113 // @return Fragment's offset relative to the fragment's parent. |
| 115 NGLogicalOffset CalculateLogicalOffset( | 114 NGLogicalOffset CalculateLogicalOffset( |
| 116 const WTF::Optional<NGLogicalOffset>& known_fragment_offset); | 115 const WTF::Optional<NGLogicalOffset>& known_fragment_offset); |
| 117 | 116 |
| 118 NGLogicalSize child_available_size_; | 117 NGLogicalSize child_available_size_; |
| 119 NGLogicalSize child_percentage_size_; | 118 NGLogicalSize child_percentage_size_; |
| 120 | 119 |
| 121 NGBoxStrut border_and_padding_; | 120 NGBoxStrut border_and_padding_; |
| 122 LayoutUnit content_size_; | 121 LayoutUnit content_size_; |
| 123 LayoutUnit max_inline_size_; | 122 LayoutUnit max_inline_size_; |
| 124 // MarginStrut for the previous child. | 123 // MarginStrut for the previous child. |
| 125 NGMarginStrut curr_margin_strut_; | 124 NGMarginStrut curr_margin_strut_; |
| 126 NGLogicalOffset curr_bfc_offset_; | 125 NGLogicalOffset curr_bfc_offset_; |
| 127 NGBoxStrut curr_child_margins_; | 126 NGBoxStrut curr_child_margins_; |
| 128 }; | 127 }; |
| 129 | 128 |
| 130 } // namespace blink | 129 } // namespace blink |
| 131 | 130 |
| 132 #endif // NGBlockLayoutAlgorithm_h | 131 #endif // NGBlockLayoutAlgorithm_h |
| OLD | NEW |