Chromium Code Reviews| 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 e8e441e9c6df3f30ba2eec8463317d67eb9afdec..e46e4ef1f2ca161c013435945f8cc9fbf9359c09 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 |
| @@ -42,14 +42,22 @@ bool NGBlockLayoutAlgorithm::Layout(const NGConstraintSpace* constraint_space, |
| LayoutUnit inline_size = |
| computeInlineSizeForFragment(*constraint_space, *style_); |
| + LayoutUnit adjusted_inline_size = |
| + (inline_size - border_and_padding_.InlineSum()).clampNegativeToZero(); |
|
mstensho (USE GERRIT)
2016/09/20 11:30:17
Shouldn't computeInlineSizeForFragment() make sure
cbiesinger
2016/09/20 13:43:37
Good point, done.
|
| // TODO(layout-ng): For quirks mode, should we pass blockSize instead of |
| // -1? |
| LayoutUnit block_size = computeBlockSizeForFragment( |
| - *constraint_space, *style_, LayoutUnit(-1)); |
| + *constraint_space, *style_, NGSizeIndefinite); |
| + LayoutUnit adjusted_block_size(block_size); |
| + if (adjusted_block_size != NGSizeIndefinite) { |
|
ikilpatrick
2016/09/20 10:47:10
is a comment here explaining what is going on wort
cbiesinger
2016/09/20 13:43:37
Done.
|
| + adjusted_block_size = |
| + (adjusted_block_size - border_and_padding_.BlockSum()) |
| + .clampNegativeToZero(); |
| + } |
| constraint_space_for_children_ = new NGConstraintSpace( |
| - *constraint_space, NGLogicalOffset(), |
| - NGLogicalSize(inline_size - border_and_padding_.InlineSum(), |
| - block_size - border_and_padding_.BlockSum())); |
| + FromPlatformWritingMode(style_->getWritingMode()), |
| + FromPlatformDirection(style_->direction()), *constraint_space, |
| + NGLogicalSize(adjusted_inline_size, adjusted_block_size)); |
| content_size_ = border_and_padding_.block_start; |
| builder_ = new NGFragmentBuilder(NGPhysicalFragmentBase::FragmentBox); |