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 c6b57e2dc284e3fcd4789f68f4f0483c9203cafe..49d4d32f47a3d684e2602dcfea1ab1ba56782100 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_box.cc |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_box.cc |
@@ -67,6 +67,22 @@ bool NGBox::Layout(const NGConstraintSpace* constraint_space, |
} |
bool NGBox::ComputeMinAndMaxContentSizes(MinAndMaxContentSizes* sizes) { |
+ if (!CanUseNewLayout()) { |
+ DCHECK(layout_box_); |
+ // TODO(layout-ng): This could be somewhat optimized by directly calling |
+ // computeIntrinsicLogicalWidths, but that function is currently private. |
+ // Consider doing that if this becomes a performance issue. |
+ LayoutUnit borderAndPadding = layout_box_->borderAndPaddingLogicalWidth(); |
+ sizes->min_content = layout_box_->computeLogicalWidthUsing( |
+ MainOrPreferredSize, Length(MinContent), |
+ LayoutUnit(), layout_box_->containingBlock()) - |
+ borderAndPadding; |
+ sizes->max_content = layout_box_->computeLogicalWidthUsing( |
+ MainOrPreferredSize, Length(MaxContent), |
+ LayoutUnit(), layout_box_->containingBlock()) - |
+ borderAndPadding; |
+ return true; |
+ } |
DCHECK(!layout_algorithm_) |
<< "Can't interleave Layout and ComputeMinAndMaxContentSizes"; |
if (!minmax_algorithm_) { |