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 | 94 |
95 LayoutUnit BorderEdgeForCurrentChild() const { | 95 LayoutUnit BorderEdgeForCurrentChild() const { |
96 // TODO(mstensho): Need to take care of margin collapsing somehow. We | 96 // TODO(mstensho): Need to take care of margin collapsing somehow. We |
97 // should at least attempt to estimate what the top margin is going to be. | 97 // should at least attempt to estimate what the top margin is going to be. |
98 return content_size_; | 98 return content_size_; |
99 } | 99 } |
100 | 100 |
101 // Calculates offset for the provided fragment which is relative to the | 101 // Calculates offset for the provided fragment which is relative to the |
102 // fragment's parent. | 102 // fragment's parent. |
103 NGLogicalOffset CalculateRelativeOffset(const NGBoxFragment& fragment); | 103 NGLogicalOffset CalculateRelativeOffset(const NGBoxFragment& fragment); |
104 | |
105 NGLogicalOffset GetChildSpaceOffset() const { | 104 NGLogicalOffset GetChildSpaceOffset() const { |
106 return NGLogicalOffset(border_and_padding_.inline_start, content_size_); | 105 return NGLogicalOffset(border_and_padding_.inline_start, content_size_); |
107 } | 106 } |
108 | 107 |
109 // Read-only Getters. | 108 // Read-only Getters. |
110 const ComputedStyle& CurrentChildStyle() const { | 109 const ComputedStyle& CurrentChildStyle() const { |
111 DCHECK(current_child_); | 110 DCHECK(current_child_); |
112 return toNGBlockNode(current_child_)->Style(); | 111 return toNGBlockNode(current_child_)->Style(); |
113 } | 112 } |
114 | 113 |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // MarginStrut for the previous child. | 145 // MarginStrut for the previous child. |
147 NGMarginStrut curr_margin_strut_; | 146 NGMarginStrut curr_margin_strut_; |
148 NGLogicalOffset bfc_offset_; | 147 NGLogicalOffset bfc_offset_; |
149 NGLogicalOffset curr_bfc_offset_; | 148 NGLogicalOffset curr_bfc_offset_; |
150 NGBoxStrut curr_child_margins_; | 149 NGBoxStrut curr_child_margins_; |
151 }; | 150 }; |
152 | 151 |
153 } // namespace blink | 152 } // namespace blink |
154 | 153 |
155 #endif // NGBlockLayoutAlgorithm_h | 154 #endif // NGBlockLayoutAlgorithm_h |
OLD | NEW |