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 93a7142ca0529f8a81ea43abe29796a31f782173..276d2e8fd96cc8d38f77b57af8922e0a714aae85 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 |
@@ -29,8 +29,8 @@ namespace { |
void AdjustToClearance(const NGConstraintSpace& space, |
const ComputedStyle& style, |
LayoutUnit* content_size) { |
- const NGExclusion* right_exclusion = space.LastRightFloatExclusion(); |
- const NGExclusion* left_exclusion = space.LastLeftFloatExclusion(); |
+ const NGExclusion* right_exclusion = space.Exclusions()->last_right_float; |
+ const NGExclusion* left_exclusion = space.Exclusions()->last_left_float; |
// Calculates Left/Right block end offset from left/right float exclusions or |
// use the default content offset position. |
@@ -218,13 +218,11 @@ NGLayoutStatus NGBlockLayoutAlgorithm::Layout( |
if (adjusted_block_size != NGSizeIndefinite) |
adjusted_block_size -= border_and_padding_.BlockSum(); |
- space_builder_ = |
- new NGConstraintSpaceBuilder(constraint_space_->WritingMode()); |
+ space_builder_ = new NGConstraintSpaceBuilder(constraint_space_); |
space_builder_->SetAvailableSize( |
NGLogicalSize(adjusted_inline_size, adjusted_block_size)); |
space_builder_->SetPercentageResolutionSize( |
NGLogicalSize(adjusted_inline_size, adjusted_block_size)); |
- |
content_size_ = border_and_padding_.block_start; |
builder_ = new NGFragmentBuilder(NGPhysicalFragmentBase::FragmentBox); |
@@ -424,19 +422,11 @@ NGBlockLayoutAlgorithm::CreateConstraintSpaceForCurrentChild() const { |
space_builder_->SetIsNewFormattingContext( |
IsNewFormattingContextForInFlowBlockLevelChild(ConstraintSpace(), |
CurrentChildStyle())); |
- NGConstraintSpace* child_space = new NGConstraintSpace( |
- constraint_space_->WritingMode(), constraint_space_->Direction(), |
- space_builder_->ToConstraintSpace()); |
+ NGConstraintSpace* child_space = space_builder_->ToConstraintSpace(); |
// TODO(layout-ng): Set offset through the space builder. |
child_space->SetOffset( |
NGLogicalOffset(border_and_padding_.inline_start, content_size_)); |
- |
- // TODO(layout-ng): avoid copying here. A child and parent constraint spaces |
- // should share the same backing space. |
- for (const auto& exclusion : constraint_space_->Exclusions()) { |
- child_space->AddExclusion(*exclusion.get()); |
- } |
return child_space; |
} |