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 f73475e43a4b7ef73881966f2c7e1e216ec1397f..17cd0d8968dd86561232172f5aae72f6da0442dd 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 |
@@ -23,12 +23,17 @@ NGFragment* NGBlockLayoutAlgorithm::layout( |
const NGConstraintSpace& constraintSpace) { |
LayoutUnit inlineSize = |
computeInlineSizeForFragment(constraintSpace, *m_style); |
+ LayoutUnit blockSize = |
+ computeBlockSizeForFragment(constraintSpace, *m_style, LayoutUnit(-1)); |
ikilpatrick
2016/08/23 00:49:04
Is the -1 correct? Should it be LayoutUnit(0) inst
cbiesinger
2016/08/23 01:06:54
They don't get resolved to zero -- indefinite perc
|
+ NGConstraintSpace constraint_space_for_children( |
+ constraintSpace, NGLogicalSize(inlineSize, blockSize)); |
HeapVector<Member<const NGFragmentBase>> childFragments; |
LayoutUnit contentSize; |
for (NGBox box : m_boxIterator) { |
- NGBoxMargins childMargins = computeMargins(constraintSpace, *box.style()); |
- NGFragment* fragment = box.layout(constraintSpace); |
+ NGBoxMargins childMargins = |
+ computeMargins(constraint_space_for_children, *box.style()); |
+ NGFragment* fragment = box.layout(constraint_space_for_children); |
// TODO(layout-ng): Support auto margins |
fragment->setOffset(childMargins.inlineStart, |
contentSize + childMargins.blockStart); |
@@ -37,7 +42,8 @@ NGFragment* NGBlockLayoutAlgorithm::layout( |
childFragments.append(fragment); |
} |
- LayoutUnit blockSize = |
+ // Recompute the block-axis size now that we know our content size |
ikilpatrick
2016/08/23 00:49:04
grammar-Nit: period and end?
(I don't really care
cbiesinger
2016/08/23 01:06:54
Done.
|
+ blockSize = |
computeBlockSizeForFragment(constraintSpace, *m_style, contentSize); |
NGFragment* returnFragment = |
new NGFragment(inlineSize, blockSize, inlineSize, blockSize, |