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_block_child_iterator.h" | 9 #include "core/layout/ng/ng_block_child_iterator.h" |
10 #include "core/layout/ng/ng_box_fragment.h" | 10 #include "core/layout/ng/ng_box_fragment.h" |
(...skipping 679 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
690 | 690 |
691 if (child->Type() == NGLayoutInputNode::kLegacyInline) { | 691 if (child->Type() == NGLayoutInputNode::kLegacyInline) { |
692 // TODO(kojii): Setup space_builder_ appropriately for inline child. | 692 // TODO(kojii): Setup space_builder_ appropriately for inline child. |
693 | 693 |
694 // Margins collapsing: Inline block. | 694 // Margins collapsing: Inline block. |
695 curr_bfc_offset_.block_offset += curr_margin_strut_.Sum(); | 695 curr_bfc_offset_.block_offset += curr_margin_strut_.Sum(); |
696 UpdateFragmentBfcOffset(curr_bfc_offset_); | 696 UpdateFragmentBfcOffset(curr_bfc_offset_); |
697 PositionPendingFloats(curr_bfc_offset_.block_offset, | 697 PositionPendingFloats(curr_bfc_offset_.block_offset, |
698 MutableConstraintSpace(), &builder_); | 698 MutableConstraintSpace(), &builder_); |
699 curr_margin_strut_ = {}; | 699 curr_margin_strut_ = {}; |
| 700 space_builder_.SetBfcOffset(curr_bfc_offset_); |
700 | 701 |
701 return space_builder_.ToConstraintSpace( | 702 return space_builder_.ToConstraintSpace( |
702 FromPlatformWritingMode(Style().getWritingMode())); | 703 FromPlatformWritingMode(Style().getWritingMode())); |
703 } | 704 } |
704 | 705 |
705 NGBlockNode* block_child = toNGBlockNode(child); | 706 NGBlockNode* block_child = toNGBlockNode(child); |
706 const ComputedStyle& child_style = block_child->Style(); | 707 const ComputedStyle& child_style = block_child->Style(); |
707 | 708 |
708 // Calculate margins in parent's writing mode. | 709 // Calculate margins in parent's writing mode. |
709 curr_child_margins_ = CalculateMargins( | 710 curr_child_margins_ = CalculateMargins( |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
765 DCHECK(builder_.BfcOffset()); | 766 DCHECK(builder_.BfcOffset()); |
766 space_available -= curr_bfc_offset_.block_offset; | 767 space_available -= curr_bfc_offset_.block_offset; |
767 } | 768 } |
768 } | 769 } |
769 space_builder_.SetFragmentainerSpaceAvailable(space_available); | 770 space_builder_.SetFragmentainerSpaceAvailable(space_available); |
770 | 771 |
771 return space_builder_.ToConstraintSpace( | 772 return space_builder_.ToConstraintSpace( |
772 FromPlatformWritingMode(child_style.getWritingMode())); | 773 FromPlatformWritingMode(child_style.getWritingMode())); |
773 } | 774 } |
774 } // namespace blink | 775 } // namespace blink |
OLD | NEW |