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

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

Issue 2483683003: [LayoutNG] Split apart storage for AvailableSize and PercentageSize. (Closed)
Patch Set: rebase. Created 4 years, 1 month 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 49d4d32f47a3d684e2602dcfea1ab1ba56782100..91af9609923a3187207e9462239be67d4b39dc67 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_box.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.cc
@@ -89,7 +89,9 @@ bool NGBox::ComputeMinAndMaxContentSizes(MinAndMaxContentSizes* sizes) {
NGConstraintSpaceBuilder builder(
FromPlatformWritingMode(Style()->getWritingMode()));
- builder.SetContainerSize(NGLogicalSize(LayoutUnit(), LayoutUnit()));
+ builder.SetAvailableSize(NGLogicalSize(LayoutUnit(), LayoutUnit()));
+ builder.SetPercentageResolutionSize(
+ NGLogicalSize(LayoutUnit(), LayoutUnit()));
// TODO(layoutng): Use builder.ToConstraintSpace.ToLogicalConstraintSpace
// once
// that's available.
@@ -126,7 +128,9 @@ bool NGBox::ComputeMinAndMaxContentSizes(MinAndMaxContentSizes* sizes) {
// Now, redo with infinite space for max_content
NGConstraintSpaceBuilder builder(
FromPlatformWritingMode(Style()->getWritingMode()));
- builder.SetContainerSize(NGLogicalSize(LayoutUnit::max(), LayoutUnit()));
+ builder.SetAvailableSize(NGLogicalSize(LayoutUnit::max(), LayoutUnit()));
+ builder.SetPercentageResolutionSize(
+ NGLogicalSize(LayoutUnit(), LayoutUnit()));
NGConstraintSpace* constraint_space = new NGConstraintSpace(
FromPlatformWritingMode(Style()->getWritingMode()),
FromPlatformDirection(Style()->direction()), builder.ToConstraintSpace());
@@ -250,11 +254,11 @@ void NGBox::CopyFragmentDataToLayoutBox(
NGPhysicalFragment* NGBox::RunOldLayout(
const NGConstraintSpace& constraint_space) {
// TODO(layout-ng): If fixedSize is true, set the override width/height too
- NGLogicalSize container_size = constraint_space.ContainerSize();
+ NGLogicalSize available_size = constraint_space.AvailableSize();
layout_box_->setOverrideContainingBlockContentLogicalWidth(
- container_size.inline_size);
+ available_size.inline_size);
layout_box_->setOverrideContainingBlockContentLogicalHeight(
- container_size.block_size);
+ available_size.block_size);
if (layout_box_->isLayoutNGBlockFlow() && layout_box_->needsLayout()) {
toLayoutNGBlockFlow(layout_box_)->LayoutBlockFlow::layoutBlock(true);
} else {

Powered by Google App Engine
This is Rietveld 408576698