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_constraint_space_builder.h" | 10 #include "core/layout/ng/ng_constraint_space_builder.h" |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 NGLogicalOffset PositionFloatFragment(const NGFragmentBase& fragment, | 73 NGLogicalOffset PositionFloatFragment(const NGFragmentBase& fragment, |
74 const NGBoxStrut& margins); | 74 const NGBoxStrut& margins); |
75 | 75 |
76 // Updates block-{start|end} of the currently constructed fragment. | 76 // Updates block-{start|end} of the currently constructed fragment. |
77 // | 77 // |
78 // This method is supposed to be called on every child but it only updates | 78 // This method is supposed to be called on every child but it only updates |
79 // the block-start once (on the first non-zero height child fragment) and | 79 // the block-start once (on the first non-zero height child fragment) and |
80 // keeps updating block-end (on every non-zero height child). | 80 // keeps updating block-end (on every non-zero height child). |
81 void UpdateMarginStrut(const NGMarginStrut& from); | 81 void UpdateMarginStrut(const NGMarginStrut& from); |
82 | 82 |
| 83 NGLogicalOffset GetChildSpaceOffset() const { |
| 84 return NGLogicalOffset(border_and_padding_.inline_start, content_size_); |
| 85 } |
| 86 |
83 // Read-only Getters. | 87 // Read-only Getters. |
84 const ComputedStyle& CurrentChildStyle() const { | 88 const ComputedStyle& CurrentChildStyle() const { |
85 DCHECK(current_child_); | 89 DCHECK(current_child_); |
86 return *current_child_->Style(); | 90 return *current_child_->Style(); |
87 } | 91 } |
88 | 92 |
89 const NGConstraintSpace& ConstraintSpace() const { | 93 const NGConstraintSpace& ConstraintSpace() const { |
90 return *constraint_space_; | 94 return *constraint_space_; |
91 } | 95 } |
92 | 96 |
(...skipping 18 matching lines...) Expand all Loading... |
111 // MarginStrut for the previous child. | 115 // MarginStrut for the previous child. |
112 NGMarginStrut prev_child_margin_strut_; | 116 NGMarginStrut prev_child_margin_strut_; |
113 // Whether the block-start was set for the currently built | 117 // Whether the block-start was set for the currently built |
114 // fragment's margin strut. | 118 // fragment's margin strut. |
115 bool is_fragment_margin_strut_block_start_updated_ : 1; | 119 bool is_fragment_margin_strut_block_start_updated_ : 1; |
116 }; | 120 }; |
117 | 121 |
118 } // namespace blink | 122 } // namespace blink |
119 | 123 |
120 #endif // NGBlockLayoutAlgorithm_h | 124 #endif // NGBlockLayoutAlgorithm_h |
OLD | NEW |