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

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

Issue 2692403003: [LayoutNG] Make NGBlockLayoutAlgorithm accept a NGBlockNode. (Closed)
Patch Set: comments! 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 7e8127a48780df6ce49966c3c011861e117d73f2..32ab1b40f61c58627d6caa9d6249537a742df500 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
@@ -86,8 +86,7 @@ RefPtr<NGPhysicalFragment> NGBlockNode::Layout(
}
RefPtr<NGPhysicalFragment> fragment =
- NGBlockLayoutAlgorithm(GetLayoutObject(), &Style(), FirstChild(),
- constraint_space, CurrentBreakToken())
+ NGBlockLayoutAlgorithm(this, constraint_space, CurrentBreakToken())
.Layout();
fragment_ = toNGPhysicalBoxFragment(fragment.get());
@@ -121,8 +120,7 @@ MinAndMaxContentSizes NGBlockNode::ComputeMinAndMaxContentSizes() {
.ToConstraintSpace(FromPlatformWritingMode(Style().getWritingMode()));
// TODO(cbiesinger): For orthogonal children, we need to always synthesize.
- NGBlockLayoutAlgorithm minmax_algorithm(layout_box_, &Style(), FirstChild(),
- constraint_space);
+ NGBlockLayoutAlgorithm minmax_algorithm(this, constraint_space);
Optional<MinAndMaxContentSizes> maybe_sizes =
minmax_algorithm.ComputeMinAndMaxContentSizes();
if (maybe_sizes.has_value())
@@ -305,7 +303,7 @@ RefPtr<NGPhysicalBoxFragment> NGBlockNode::RunOldLayout(
LayoutRect overflow = layout_box_->layoutOverflowRect();
// TODO(layout-ng): This does not handle writing modes correctly (for
// overflow)
- NGFragmentBuilder builder(NGPhysicalFragment::kFragmentBox, layout_box_);
+ NGFragmentBuilder builder(NGPhysicalFragment::kFragmentBox, this);
builder.SetInlineSize(layout_box_->logicalWidth())
.SetBlockSize(layout_box_->logicalHeight())
.SetDirection(layout_box_->styleRef().direction())

Powered by Google App Engine
This is Rietveld 408576698