Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc

Issue 2714803002: [LayoutNG] Allow block-flow layout to be fragmented using new approach. (Closed)
Patch Set: rebase. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
index 0d365228ab5da6a1ed7311aac8cb83b1866d7882..973b5724b60a0e95ca4c9b331c2272baa7dba912 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
@@ -77,8 +77,8 @@ NGBlockNode::NGBlockNode(ComputedStyle* style)
// included from a compilation unit that lacks the ComputedStyle definition.
NGBlockNode::~NGBlockNode() {}
-RefPtr<NGLayoutResult> NGBlockNode::Layout(
- NGConstraintSpace* constraint_space) {
+RefPtr<NGLayoutResult> NGBlockNode::Layout(NGConstraintSpace* constraint_space,
+ NGBreakToken* break_token) {
// Use the old layout code and synthesize a fragment.
if (!CanUseNewLayout()) {
DCHECK(layout_box_);
@@ -86,9 +86,9 @@ RefPtr<NGLayoutResult> NGBlockNode::Layout(
return layout_result_;
}
- layout_result_ =
- NGBlockLayoutAlgorithm(this, constraint_space, CurrentBreakToken())
- .Layout();
+ layout_result_ = NGBlockLayoutAlgorithm(this, constraint_space,
+ toNGBlockBreakToken(break_token))
+ .Layout();
CopyFragmentDataToLayoutBox(*constraint_space);
return layout_result_;
@@ -127,7 +127,8 @@ MinAndMaxContentSizes NGBlockNode::ComputeMinAndMaxContentSizes() {
return *maybe_sizes;
// Have to synthesize this value.
- RefPtr<NGLayoutResult> layout_result = Layout(constraint_space);
+ RefPtr<NGLayoutResult> layout_result =
+ Layout(constraint_space, /* break_token */ nullptr);
NGPhysicalFragment* physical_fragment =
layout_result->PhysicalFragment().get();
NGBoxFragment min_fragment(FromPlatformWritingMode(Style().getWritingMode()),
@@ -143,7 +144,7 @@ MinAndMaxContentSizes NGBlockNode::ComputeMinAndMaxContentSizes() {
.SetPercentageResolutionSize({LayoutUnit(), LayoutUnit()})
.ToConstraintSpace(FromPlatformWritingMode(Style().getWritingMode()));
- layout_result = Layout(constraint_space);
+ layout_result = Layout(constraint_space, /* break_token */ nullptr);
physical_fragment = layout_result->PhysicalFragment().get();
NGBoxFragment max_fragment(FromPlatformWritingMode(Style().getWritingMode()),
toNGPhysicalBoxFragment(physical_fragment));

Powered by Google App Engine
This is Rietveld 408576698