Commit 987ca527 authored by ikilpatrick's avatar ikilpatrick Committed by Commit Bot

[LayoutNG] Refactor of HandleInflow children.

This moves a bunch of code around and some additional comments.

Before the code for handling an inflow element was a little difficult to follow.
Now most of the code and complexities are inside HandleInflow. Functions which
this calls are now relatively simple.

BUG=635619

Review-Url: https://codereview.chromium.org/2975973002
Cr-Commit-Position: refs/heads/master@{#486260}
parent f98299ef
......@@ -75,17 +75,16 @@ class CORE_EXPORT NGBlockLayoutAlgorithm
const WTF::Optional<NGLogicalOffset> floats_bfc_offset = WTF::nullopt);
// @return Estimated BFC offset for the "to be layout" child.
WTF::Optional<NGInflowChildData> PrepareChildLayout(
const NGPreviousInflowPosition&,
NGLayoutInputNode);
NGInflowChildData ComputeChildData(const NGPreviousInflowPosition&,
NGLayoutInputNode);
WTF::Optional<NGPreviousInflowPosition> FinishChildLayout(
const NGConstraintSpace&,
const NGPreviousInflowPosition& prev_data,
NGPreviousInflowPosition ComputeInflowPosition(
const NGPreviousInflowPosition& previous_inflow_position,
const NGInflowChildData& child_data,
NGLayoutInputNode child,
NGBreakToken* child_break_token,
RefPtr<NGLayoutResult>);
const WTF::Optional<NGLogicalOffset>& child_bfc_offset,
const NGLogicalOffset& logical_offset,
const NGLayoutResult& layout_result,
const NGFragment& fragment);
// Positions the fragment that establishes a new formatting context.
//
......@@ -134,9 +133,13 @@ class CORE_EXPORT NGBlockLayoutAlgorithm
const NGInflowChildData& child_data);
void HandleOutOfFlowPositioned(const NGPreviousInflowPosition&, NGBlockNode);
void HandleFloating(const NGPreviousInflowPosition&,
NGBlockNode,
NGBlockBreakToken*);
void HandleFloat(const NGPreviousInflowPosition&,
NGBlockNode,
NGBlockBreakToken*);
WTF::Optional<NGPreviousInflowPosition> HandleInflow(
const NGPreviousInflowPosition&,
NGLayoutInputNode child,
NGBreakToken* child_break_token);
// Final adjustments before fragment creation. We need to prevent the
// fragment from crossing fragmentainer boundaries, and rather create a break
......
......@@ -28,9 +28,6 @@ class CORE_EXPORT NGFragment {
return static_cast<NGWritingMode>(writing_mode_);
}
// TODO(ikilpatrick): Remove once block layout algorithm refactoring complete.
explicit operator bool() { return physical_fragment_ != nullptr; }
// Returns the border-box size.
LayoutUnit InlineSize() const;
LayoutUnit BlockSize() const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment