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_box.h" | 9 #include "core/layout/ng/ng_box.h" |
10 #include "core/layout/ng/ng_fragment_builder.h" | 10 #include "core/layout/ng/ng_fragment_builder.h" |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 const NGFragment& fragment); | 59 const NGFragment& fragment); |
60 | 60 |
61 // Calculates position of the in-flow block-level fragment that needs to be | 61 // Calculates position of the in-flow block-level fragment that needs to be |
62 // positioned relative to the current fragment that is being built. | 62 // positioned relative to the current fragment that is being built. |
63 // | 63 // |
64 // @param fragment Fragment that needs to be placed. | 64 // @param fragment Fragment that needs to be placed. |
65 // @param child_margins Margins information for the current child fragment. | 65 // @param child_margins Margins information for the current child fragment. |
66 // @param space Constraint space for the block. | 66 // @param space Constraint space for the block. |
67 // @return Position of the fragment in the parent's constraint space. | 67 // @return Position of the fragment in the parent's constraint space. |
68 NGLogicalOffset PositionFragment(const NGFragment& fragment, | 68 NGLogicalOffset PositionFragment(const NGFragment& fragment, |
69 NGBoxStrut child_margins, | 69 const NGBoxStrut& child_margins, |
70 const NGConstraintSpace& space); | 70 const NGConstraintSpace& space); |
71 | 71 |
72 // Calculates position of the float fragment that needs to be | 72 // Calculates position of the float fragment that needs to be |
73 // positioned relative to the current fragment that is being built. | 73 // positioned relative to the current fragment that is being built. |
74 // | 74 // |
75 // @param fragment Fragment that needs to be placed. | 75 // @param fragment Fragment that needs to be placed. |
76 // @param margins Margins information for the fragment. | 76 // @param margins Margins information for the fragment. |
77 // @return Position of the fragment in the parent's constraint space. | 77 // @return Position of the fragment in the parent's constraint space. |
78 NGLogicalOffset PositionFloatFragment(const NGFragment& fragment, | 78 NGLogicalOffset PositionFloatFragment(const NGFragment& fragment, |
79 NGBoxStrut margins); | 79 const NGBoxStrut& margins); |
80 | 80 |
81 // Updates block-{start|end} of the currently constructed fragment. | 81 // Updates block-{start|end} of the currently constructed fragment. |
82 // | 82 // |
83 // This method is supposed to be called on every child but it only updates | 83 // This method is supposed to be called on every child but it only updates |
84 // the block-start once (on the first non-zero height child fragment) and | 84 // the block-start once (on the first non-zero height child fragment) and |
85 // keeps updating block-end (on every non-zero height child). | 85 // keeps updating block-end (on every non-zero height child). |
86 void UpdateMarginStrut(const NGMarginStrut& from); | 86 void UpdateMarginStrut(const NGMarginStrut& from); |
87 | 87 |
88 // Read-only Getters. | 88 // Read-only Getters. |
89 const ComputedStyle& Style() const { return *style_; } | 89 const ComputedStyle& Style() const { return *style_; } |
(...skipping 12 matching lines...) Expand all Loading... |
102 // MarginStrut for the previous child. | 102 // MarginStrut for the previous child. |
103 NGMarginStrut prev_child_margin_strut_; | 103 NGMarginStrut prev_child_margin_strut_; |
104 // Whether the block-start was set for the currently built | 104 // Whether the block-start was set for the currently built |
105 // fragment's margin strut. | 105 // fragment's margin strut. |
106 bool is_fragment_margin_strut_block_start_updated_ : 1; | 106 bool is_fragment_margin_strut_block_start_updated_ : 1; |
107 }; | 107 }; |
108 | 108 |
109 } // namespace blink | 109 } // namespace blink |
110 | 110 |
111 #endif // NGBlockLayoutAlgorithm_h | 111 #endif // NGBlockLayoutAlgorithm_h |
OLD | NEW |