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

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

Issue 2456973002: [LayoutNG] Move ng_block_layout_algorithm to use constraint space builder. (Closed)
Patch Set: rebase. Created 4 years, 2 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_box.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_box.cc b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
index 13f790844a421e87d8c086081e50bbb862332853..40062d95e97e529b9d4adec139b79c4ada13e61d 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_box.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
@@ -33,16 +33,18 @@ bool NGBox::Layout(const NGConstraintSpace* constraint_space,
// resulting size to the LayoutObject, or use the old layout code and
// synthesize a fragment.
if (CanUseNewLayout()) {
- if (!algorithm_)
- algorithm_ = new NGBlockLayoutAlgorithm(Style(), FirstChild());
// Change the coordinate system of the constraint space.
NGConstraintSpace* child_constraint_space = new NGConstraintSpace(
FromPlatformWritingMode(Style()->getWritingMode()),
FromPlatformDirection(Style()->direction()),
constraint_space->MutablePhysicalSpace());
+ if (!algorithm_)
+ algorithm_ = new NGBlockLayoutAlgorithm(Style(), FirstChild(),
+ child_constraint_space);
+
NGPhysicalFragment* fragment = nullptr;
- if (!algorithm_->Layout(child_constraint_space, &fragment))
+ if (!algorithm_->Layout(&fragment))
return false;
fragment_ = fragment;

Powered by Google App Engine
This is Rietveld 408576698