Chromium Code Reviews| Index: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h |
| diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h |
| index f93787e18efd67a17a5773842dbf62c8e62f35b4..b34f0b86648a5761a2ca4aec098a0f3ca1418e5a 100644 |
| --- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h |
| +++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.h |
| @@ -18,19 +18,35 @@ namespace blink { |
| class NGConstraintSpace; |
| class NGLayoutResult; |
| -struct NGInflowChildData; |
| -struct NGPreviousInflowPosition; |
| + |
| +// This struct is used for communicating to a child the position of the |
| +// previous inflow child. |
| +struct NGPreviousInflowPosition { |
| + LayoutUnit bfc_block_offset; |
| + LayoutUnit logical_block_offset; |
| + NGMarginStrut margin_strut; |
| +}; |
| + |
| +// This strut holds information for the current inflow child. The data is not |
| +// useful outside of handling this single inflow child. |
| +struct NGInflowChildData { |
| + NGLogicalOffset bfc_offset_estimate; |
| + NGMarginStrut margin_strut; |
| + NGBoxStrut margins; |
| +}; |
| // Updates the fragment's BFC offset if it's not already set. |
| -void MaybeUpdateFragmentBfcOffset(const NGConstraintSpace&, |
| +bool MaybeUpdateFragmentBfcOffset(const NGConstraintSpace&, |
| LayoutUnit bfc_block_offset, |
| NGFragmentBuilder* builder); |
| // Positions pending floats starting from {@origin_block_offset} and relative |
| // to container's BFC offset. |
| -void PositionPendingFloats(LayoutUnit origin_block_offset, |
| - NGFragmentBuilder* container_builder, |
| - NGConstraintSpace* space); |
| +void PositionPendingFloats( |
| + LayoutUnit origin_block_offset, |
| + NGFragmentBuilder* container_builder, |
| + Vector<RefPtr<NGUnpositionedFloat>>* unpositioned_floats, |
| + NGConstraintSpace* space); |
| // A class for general block layout (e.g. a <div> with no special style). |
| // Lays out the children in sequence. |
| @@ -55,18 +71,21 @@ class CORE_EXPORT NGBlockLayoutAlgorithm |
| // Creates a new constraint space for the current child. |
| RefPtr<NGConstraintSpace> CreateConstraintSpaceForChild( |
| const NGLayoutInputNode child, |
| - const NGInflowChildData& child_data); |
| + const NGInflowChildData& child_data, |
| + const WTF::Optional<NGLogicalOffset> floats_bfc_offset = WTF::nullopt); |
| // @return Estimated BFC offset for the "to be layout" child. |
| - NGInflowChildData PrepareChildLayout(const NGPreviousInflowPosition&, |
| - NGLayoutInputNode); |
| + WTF::Optional<NGInflowChildData> PrepareChildLayout( |
| + const NGPreviousInflowPosition&, |
| + NGLayoutInputNode); |
| - NGPreviousInflowPosition FinishChildLayout( |
| + WTF::Optional<NGPreviousInflowPosition> FinishChildLayout( |
| const NGConstraintSpace&, |
| const NGPreviousInflowPosition& prev_data, |
| const NGInflowChildData& child_data, |
| - const NGLayoutInputNode child, |
| - NGLayoutResult*); |
| + NGLayoutInputNode child, |
| + NGBreakToken* child_break_token, |
|
eae
2017/07/10 23:27:49
const?
ikilpatrick
2017/07/11 17:20:41
Unfortunately not, we need to make the NGLayoutInp
|
| + RefPtr<NGLayoutResult>); |
| // Positions the fragment that establishes a new formatting context. |
| // |
| @@ -87,14 +106,16 @@ class CORE_EXPORT NGBlockLayoutAlgorithm |
| // then it will be placed there and we collapse its margin. |
| // 2) If #new-fc is too big then we need to clear its position and place it |
| // below #float ignoring its vertical margin. |
| - NGLogicalOffset PositionNewFc(const NGLayoutInputNode& child, |
| - const NGPreviousInflowPosition&, |
| - const NGBoxFragment&, |
| - const NGInflowChildData& child_data, |
| - const NGConstraintSpace& child_space); |
| + WTF::Optional<NGLogicalOffset> PositionNewFc( |
|
eae
2017/07/10 23:27:49
The API here is a bit confusing. Using the offset
ikilpatrick
2017/07/11 17:20:41
done. Just did a bool atm.
|
| + const NGLayoutInputNode& child, |
| + const NGPreviousInflowPosition&, |
| + const NGLayoutResult&, |
| + const NGInflowChildData& child_data, |
| + const NGConstraintSpace& child_space); |
| // Positions the fragment that knows its BFC offset. |
| - NGLogicalOffset PositionWithBfcOffset(const NGLogicalOffset& bfc_offset); |
| + WTF::Optional<NGLogicalOffset> PositionWithBfcOffset( |
| + const NGLogicalOffset& bfc_offset); |
| // Positions using the parent BFC offset. |
| // Fragment doesn't know its offset but we can still calculate its BFC |
| @@ -134,6 +155,10 @@ class CORE_EXPORT NGBlockLayoutAlgorithm |
| NGBoxStrut border_scrollbar_padding_; |
| LayoutUnit content_size_; |
| LayoutUnit max_inline_size_; |
| + |
| + bool abort_when_bfc_resolved_; |
| + |
| + Vector<RefPtr<NGUnpositionedFloat>> unpositioned_floats_; |
| }; |
| } // namespace blink |