| 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/ng_absolute_utils.h" | 7 #include "core/layout/ng/ng_absolute_utils.h" |
| 8 #include "core/layout/ng/ng_block_break_token.h" | 8 #include "core/layout/ng/ng_block_break_token.h" |
| 9 #include "core/layout/ng/ng_box_fragment.h" | 9 #include "core/layout/ng/ng_box_fragment.h" |
| 10 #include "core/layout/ng/ng_column_mapper.h" | 10 #include "core/layout/ng/ng_column_mapper.h" |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // Only modify content_size if BlockSize is not empty. It's needed to prevent | 589 // Only modify content_size if BlockSize is not empty. It's needed to prevent |
| 590 // the situation when logical_offset is included in content_size for empty | 590 // the situation when logical_offset is included in content_size for empty |
| 591 // blocks. Example: | 591 // blocks. Example: |
| 592 // <div style="overflow:hidden"> | 592 // <div style="overflow:hidden"> |
| 593 // <div style="margin-top: 8px"></div> | 593 // <div style="margin-top: 8px"></div> |
| 594 // <div style="margin-top: 10px"></div> | 594 // <div style="margin-top: 10px"></div> |
| 595 // </div> | 595 // </div> |
| 596 if (fragment.BlockSize()) | 596 if (fragment.BlockSize()) |
| 597 content_size_ = fragment.BlockSize() + logical_offset.block_offset; | 597 content_size_ = fragment.BlockSize() + logical_offset.block_offset; |
| 598 max_inline_size_ = | 598 max_inline_size_ = |
| 599 std::max(max_inline_size_, fragment.InlineSize() + | 599 std::max(max_inline_size_, |
| 600 curr_child_margins_.InlineSum() + | 600 fragment.InlineSize() + curr_child_margins_.InlineSum() + |
| 601 border_and_padding_.InlineSum()); | 601 border_and_padding_.InlineSum()); |
| 602 | 602 |
| 603 builder_->AddChild(std::move(physical_fragment), logical_offset); | 603 builder_->AddChild(std::move(physical_fragment), logical_offset); |
| 604 } | 604 } |
| 605 | 605 |
| 606 bool NGBlockLayoutAlgorithm::ProceedToNextUnfinishedSibling( | 606 bool NGBlockLayoutAlgorithm::ProceedToNextUnfinishedSibling( |
| 607 NGPhysicalFragment* child_fragment) { | 607 NGPhysicalFragment* child_fragment) { |
| 608 DCHECK(current_child_); | 608 DCHECK(current_child_); |
| 609 NGBlockNode* finished_child = toNGBlockNode(current_child_); | 609 NGBlockNode* finished_child = toNGBlockNode(current_child_); |
| 610 current_child_ = current_child_->NextSibling(); | 610 current_child_ = current_child_->NextSibling(); |
| 611 if (!ConstraintSpace().HasBlockFragmentation() && !fragmentainer_mapper_) | 611 if (!ConstraintSpace().HasBlockFragmentation() && !fragmentainer_mapper_) |
| (...skipping 218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 830 space_builder_->SetMarginStrut(curr_margin_strut_); | 830 space_builder_->SetMarginStrut(curr_margin_strut_); |
| 831 } | 831 } |
| 832 | 832 |
| 833 space_builder_->SetBfcOffset(curr_bfc_offset_); | 833 space_builder_->SetBfcOffset(curr_bfc_offset_); |
| 834 | 834 |
| 835 return space_builder_->ToConstraintSpace( | 835 return space_builder_->ToConstraintSpace( |
| 836 FromPlatformWritingMode(current_child_style.getWritingMode())); | 836 FromPlatformWritingMode(current_child_style.getWritingMode())); |
| 837 } | 837 } |
| 838 | 838 |
| 839 } // namespace blink | 839 } // namespace blink |
| OLD | NEW |