| 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/inline/ng_inline_layout_algorithm.h" | 5 #include "core/layout/ng/inline/ng_inline_layout_algorithm.h" |
| 6 | 6 |
| 7 #include "core/layout/ng/inline/ng_bidi_paragraph.h" | 7 #include "core/layout/ng/inline/ng_bidi_paragraph.h" |
| 8 #include "core/layout/ng/inline/ng_inline_break_token.h" | 8 #include "core/layout/ng/inline/ng_inline_break_token.h" |
| 9 #include "core/layout/ng/inline/ng_inline_node.h" | 9 #include "core/layout/ng/inline/ng_inline_node.h" |
| 10 #include "core/layout/ng/inline/ng_line_box_fragment.h" | 10 #include "core/layout/ng/inline/ng_line_box_fragment.h" |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 blink::IsHorizontalWritingMode(space->WritingMode())), | 48 blink::IsHorizontalWritingMode(space->WritingMode())), |
| 49 disallow_first_line_rules_(false), | 49 disallow_first_line_rules_(false), |
| 50 space_builder_(space) | 50 space_builder_(space) |
| 51 { | 51 { |
| 52 container_builder_.MutableUnpositionedFloats() = space->UnpositionedFloats(); | 52 container_builder_.MutableUnpositionedFloats() = space->UnpositionedFloats(); |
| 53 | 53 |
| 54 // TODO(crbug.com/716930): We may be an empty LayoutInline due to splitting. | 54 // TODO(crbug.com/716930): We may be an empty LayoutInline due to splitting. |
| 55 // Only resolve our BFC offset if we know that we are non-empty as we may | 55 // Only resolve our BFC offset if we know that we are non-empty as we may |
| 56 // need to pass through our margin strut. | 56 // need to pass through our margin strut. |
| 57 if (!inline_node->Items().IsEmpty()) { | 57 if (!inline_node->Items().IsEmpty()) { |
| 58 NGLogicalOffset bfc_offset = ConstraintSpace().BfcOffset(); | 58 LayoutUnit bfc_block_offset = ConstraintSpace().BfcOffset().block_offset; |
| 59 bfc_offset.block_offset += ConstraintSpace().MarginStrut().Sum(); | 59 bfc_block_offset += ConstraintSpace().MarginStrut().Sum(); |
| 60 MaybeUpdateFragmentBfcOffset(ConstraintSpace(), bfc_offset, | 60 MaybeUpdateFragmentBfcOffset(ConstraintSpace(), bfc_block_offset, |
| 61 &container_builder_); | 61 &container_builder_); |
| 62 PositionPendingFloats(bfc_offset.block_offset, &container_builder_, | 62 PositionPendingFloats(bfc_block_offset, &container_builder_, |
| 63 MutableConstraintSpace()); | 63 MutableConstraintSpace()); |
| 64 } | 64 } |
| 65 | 65 |
| 66 if (!is_horizontal_writing_mode_) | 66 if (!is_horizontal_writing_mode_) |
| 67 baseline_type_ = FontBaseline::kIdeographicBaseline; | 67 baseline_type_ = FontBaseline::kIdeographicBaseline; |
| 68 | 68 |
| 69 border_and_padding_ = ComputeBorders(ConstraintSpace(), Style()) + | 69 border_and_padding_ = ComputeBorders(ConstraintSpace(), Style()) + |
| 70 ComputePadding(ConstraintSpace(), Style()); | 70 ComputePadding(ConstraintSpace(), Style()); |
| 71 | 71 |
| 72 if (break_token) { | 72 if (break_token) { |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 456 // Margin struts shouldn't need to be passed through like this once we've | 456 // Margin struts shouldn't need to be passed through like this once we've |
| 457 // removed LayoutInline splitting. | 457 // removed LayoutInline splitting. |
| 458 if (!container_builder_.BfcOffset()) { | 458 if (!container_builder_.BfcOffset()) { |
| 459 container_builder_.SetEndMarginStrut(ConstraintSpace().MarginStrut()); | 459 container_builder_.SetEndMarginStrut(ConstraintSpace().MarginStrut()); |
| 460 } | 460 } |
| 461 | 461 |
| 462 return container_builder_.ToBoxFragment(); | 462 return container_builder_.ToBoxFragment(); |
| 463 } | 463 } |
| 464 | 464 |
| 465 } // namespace blink | 465 } // namespace blink |
| OLD | NEW |