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 ...@@ -75,17 +75,16 @@ class CORE_EXPORT NGBlockLayoutAlgorithm
const WTF::Optional<NGLogicalOffset> floats_bfc_offset = WTF::nullopt); const WTF::Optional<NGLogicalOffset> floats_bfc_offset = WTF::nullopt);
// @return Estimated BFC offset for the "to be layout" child. // @return Estimated BFC offset for the "to be layout" child.
WTF::Optional<NGInflowChildData> PrepareChildLayout( NGInflowChildData ComputeChildData(const NGPreviousInflowPosition&,
const NGPreviousInflowPosition&, NGLayoutInputNode);
NGLayoutInputNode);
WTF::Optional<NGPreviousInflowPosition> FinishChildLayout( NGPreviousInflowPosition ComputeInflowPosition(
const NGConstraintSpace&, const NGPreviousInflowPosition& previous_inflow_position,
const NGPreviousInflowPosition& prev_data,
const NGInflowChildData& child_data, const NGInflowChildData& child_data,
NGLayoutInputNode child, const WTF::Optional<NGLogicalOffset>& child_bfc_offset,
NGBreakToken* child_break_token, const NGLogicalOffset& logical_offset,
RefPtr<NGLayoutResult>); const NGLayoutResult& layout_result,
const NGFragment& fragment);
// Positions the fragment that establishes a new formatting context. // Positions the fragment that establishes a new formatting context.
// //
...@@ -134,9 +133,13 @@ class CORE_EXPORT NGBlockLayoutAlgorithm ...@@ -134,9 +133,13 @@ class CORE_EXPORT NGBlockLayoutAlgorithm
const NGInflowChildData& child_data); const NGInflowChildData& child_data);
void HandleOutOfFlowPositioned(const NGPreviousInflowPosition&, NGBlockNode); void HandleOutOfFlowPositioned(const NGPreviousInflowPosition&, NGBlockNode);
void HandleFloating(const NGPreviousInflowPosition&, void HandleFloat(const NGPreviousInflowPosition&,
NGBlockNode, NGBlockNode,
NGBlockBreakToken*); NGBlockBreakToken*);
WTF::Optional<NGPreviousInflowPosition> HandleInflow(
const NGPreviousInflowPosition&,
NGLayoutInputNode child,
NGBreakToken* child_break_token);
// Final adjustments before fragment creation. We need to prevent the // Final adjustments before fragment creation. We need to prevent the
// fragment from crossing fragmentainer boundaries, and rather create a break // fragment from crossing fragmentainer boundaries, and rather create a break
......
...@@ -28,9 +28,6 @@ class CORE_EXPORT NGFragment { ...@@ -28,9 +28,6 @@ class CORE_EXPORT NGFragment {
return static_cast<NGWritingMode>(writing_mode_); 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. // Returns the border-box size.
LayoutUnit InlineSize() const; LayoutUnit InlineSize() const;
LayoutUnit BlockSize() 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