Index: third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc |
index 039ca524b65373f21255750a959c87ea33b288f2..c4a4410b651c132ce7cc137858570b117a54e3b6 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_layout_algorithm.cc |
@@ -200,7 +200,7 @@ NGLayoutStatus NGBlockLayoutAlgorithm::Layout( |
ComputeBorders(Style()) + ComputePadding(ConstraintSpace(), Style()); |
WTF::Optional<MinAndMaxContentSizes> sizes; |
- if (NeedMinAndMaxContentSizes(Style())) { |
+ if (NeedMinAndMaxContentSizes(ConstraintSpace(), Style())) { |
// TODOO(layout-ng): Implement |
sizes = MinAndMaxContentSizes(); |
} |
@@ -442,11 +442,19 @@ void NGBlockLayoutAlgorithm::UpdateMarginStrut(const NGMarginStrut& from) { |
NGConstraintSpace* |
NGBlockLayoutAlgorithm::CreateConstraintSpaceForCurrentChild() const { |
+ // TODO(layout-ng): Orthogonal children should also shrink to fit (in *their* |
+ // inline axis) |
+ // We have to keep this commented out for now until we correctly compute |
+ // min/max content sizes in Layout(). |
+ // bool shrink_to_fit = CurrentChildStyle().display() == EDisplay::InlineBlock |
+ // || CurrentChildStyle().isFloating(); |
+ bool shrink_to_fit = false; |
DCHECK(current_child_); |
space_builder_ |
->SetIsNewFormattingContext( |
IsNewFormattingContextForInFlowBlockLevelChild(ConstraintSpace(), |
CurrentChildStyle())) |
+ .SetIsShrinkToFit(shrink_to_fit) |
.SetWritingMode( |
FromPlatformWritingMode(CurrentChildStyle().getWritingMode())) |
.SetTextDirection(CurrentChildStyle().direction()); |