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 22 matching lines...) Expand all Loading... | |
33 // fragment within. | 33 // fragment within. |
34 // @param break_token The break token from which the layout should start. | 34 // @param break_token The break token from which the layout should start. |
35 NGBlockLayoutAlgorithm(NGBlockNode* node, | 35 NGBlockLayoutAlgorithm(NGBlockNode* node, |
36 NGConstraintSpace* space, | 36 NGConstraintSpace* space, |
37 NGBreakToken* break_token = nullptr); | 37 NGBreakToken* break_token = nullptr); |
38 | 38 |
39 Optional<MinAndMaxContentSizes> ComputeMinAndMaxContentSizes() const override; | 39 Optional<MinAndMaxContentSizes> ComputeMinAndMaxContentSizes() const override; |
40 RefPtr<NGPhysicalFragment> Layout() override; | 40 RefPtr<NGPhysicalFragment> Layout() override; |
41 | 41 |
42 private: | 42 private: |
43 // Updates the fragment's BFC offset if it's not already set. | |
ikilpatrick
2017/02/24 17:36:57
I might go through later and reorder everything so
Gleb Lanbin
2017/02/24 18:37:00
agree, I tried to organize things here (see "Read-
| |
44 void UpdateFragmentBfcOffset(const NGLogicalOffset& offset); | |
45 | |
43 NGBoxStrut CalculateMargins(const NGConstraintSpace& space, | 46 NGBoxStrut CalculateMargins(const NGConstraintSpace& space, |
44 const ComputedStyle& style); | 47 const ComputedStyle& style); |
45 | 48 |
46 // Creates a new constraint space for the current child. | 49 // Creates a new constraint space for the current child. |
47 NGConstraintSpace* CreateConstraintSpaceForCurrentChild(); | 50 NGConstraintSpace* CreateConstraintSpaceForCurrentChild(); |
48 void FinishCurrentChildLayout(RefPtr<NGPhysicalBoxFragment>); | 51 void FinishCurrentChildLayout(RefPtr<NGPhysicalBoxFragment>); |
49 | 52 |
50 // Layout inline children. | 53 // Layout inline children. |
51 void LayoutInlineChildren(NGInlineNode*); | 54 void LayoutInlineChildren(NGInlineNode*); |
52 | 55 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
142 // MarginStrut for the previous child. | 145 // MarginStrut for the previous child. |
143 NGMarginStrut curr_margin_strut_; | 146 NGMarginStrut curr_margin_strut_; |
144 NGLogicalOffset bfc_offset_; | 147 NGLogicalOffset bfc_offset_; |
145 NGLogicalOffset curr_bfc_offset_; | 148 NGLogicalOffset curr_bfc_offset_; |
146 NGBoxStrut curr_child_margins_; | 149 NGBoxStrut curr_child_margins_; |
147 }; | 150 }; |
148 | 151 |
149 } // namespace blink | 152 } // namespace blink |
150 | 153 |
151 #endif // NGBlockLayoutAlgorithm_h | 154 #endif // NGBlockLayoutAlgorithm_h |
OLD | NEW |