| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/layout/ng/ng_block_layout_algorithm.h" | 5 #include "core/layout/ng/ng_block_layout_algorithm.h" |
| 6 | 6 |
| 7 #include "core/layout/ng/inline/ng_inline_node.h" | 7 #include "core/layout/ng/inline/ng_inline_node.h" |
| 8 #include "core/layout/ng/ng_absolute_utils.h" | 8 #include "core/layout/ng/ng_absolute_utils.h" |
| 9 #include "core/layout/ng/ng_block_child_iterator.h" | 9 #include "core/layout/ng/ng_block_child_iterator.h" |
| 10 #include "core/layout/ng/ng_constraint_space.h" | 10 #include "core/layout/ng/ng_constraint_space.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 builder->SetBfcOffset(mutable_offset); | 86 builder->SetBfcOffset(mutable_offset); |
| 87 } | 87 } |
| 88 } | 88 } |
| 89 | 89 |
| 90 void PositionPendingFloats(LayoutUnit origin_block_offset, | 90 void PositionPendingFloats(LayoutUnit origin_block_offset, |
| 91 NGFragmentBuilder* container_builder, | 91 NGFragmentBuilder* container_builder, |
| 92 NGConstraintSpace* space) { | 92 NGConstraintSpace* space) { |
| 93 DCHECK(container_builder->BfcOffset()) | 93 DCHECK(container_builder->BfcOffset()) |
| 94 << "Parent BFC offset should be known here"; | 94 << "Parent BFC offset should be known here"; |
| 95 const auto& floating_objects = container_builder->UnpositionedFloats(); | 95 const auto& floating_objects = container_builder->UnpositionedFloats(); |
| 96 PositionFloats(origin_block_offset, | 96 container_builder->MutablePositionedFloats().AppendVector(PositionFloats( |
| 97 container_builder->BfcOffset().value().block_offset, | 97 origin_block_offset, container_builder->BfcOffset().value().block_offset, |
| 98 floating_objects, space); | 98 floating_objects, space)); |
| 99 container_builder->MutablePositionedFloats().AppendVector(floating_objects); | |
| 100 container_builder->MutableUnpositionedFloats().clear(); | 99 container_builder->MutableUnpositionedFloats().clear(); |
| 101 } | 100 } |
| 102 | 101 |
| 103 NGBlockLayoutAlgorithm::NGBlockLayoutAlgorithm(NGBlockNode* node, | 102 NGBlockLayoutAlgorithm::NGBlockLayoutAlgorithm(NGBlockNode* node, |
| 104 NGConstraintSpace* space, | 103 NGConstraintSpace* space, |
| 105 NGBlockBreakToken* break_token) | 104 NGBlockBreakToken* break_token) |
| 106 : NGLayoutAlgorithm(node, space, break_token), | 105 : NGLayoutAlgorithm(node, space, break_token), |
| 107 space_builder_(constraint_space_) {} | 106 space_builder_(constraint_space_) {} |
| 108 | 107 |
| 109 Optional<MinMaxContentSize> NGBlockLayoutAlgorithm::ComputeMinMaxContentSize() | 108 Optional<MinMaxContentSize> NGBlockLayoutAlgorithm::ComputeMinMaxContentSize() |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 626 if (is_new_bfc) { | 625 if (is_new_bfc) { |
| 627 space_available -= child_bfc_offset.block_offset; | 626 space_available -= child_bfc_offset.block_offset; |
| 628 } | 627 } |
| 629 } | 628 } |
| 630 space_builder_.SetFragmentainerSpaceAvailable(space_available); | 629 space_builder_.SetFragmentainerSpaceAvailable(space_available); |
| 631 | 630 |
| 632 return space_builder_.ToConstraintSpace( | 631 return space_builder_.ToConstraintSpace( |
| 633 FromPlatformWritingMode(child_style.GetWritingMode())); | 632 FromPlatformWritingMode(child_style.GetWritingMode())); |
| 634 } | 633 } |
| 635 } // namespace blink | 634 } // namespace blink |
| OLD | NEW |