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/BidiRun.h" | 7 #include "core/layout/BidiRun.h" |
8 #include "core/layout/LayoutBlockFlow.h" | 8 #include "core/layout/LayoutBlockFlow.h" |
9 #include "core/layout/line/LineInfo.h" | 9 #include "core/layout/line/LineInfo.h" |
10 #include "core/layout/line/RootInlineBox.h" | 10 #include "core/layout/line/RootInlineBox.h" |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 #endif | 71 #endif |
72 { | 72 { |
73 if (!is_horizontal_writing_mode_) | 73 if (!is_horizontal_writing_mode_) |
74 baseline_type_ = FontBaseline::kIdeographicBaseline; | 74 baseline_type_ = FontBaseline::kIdeographicBaseline; |
75 if (break_token) | 75 if (break_token) |
76 Initialize(break_token->ItemIndex(), break_token->TextOffset()); | 76 Initialize(break_token->ItemIndex(), break_token->TextOffset()); |
77 else | 77 else |
78 Initialize(0, 0); | 78 Initialize(0, 0); |
79 | 79 |
80 // BFC offset is known for inline fragments. | 80 // BFC offset is known for inline fragments. |
81 container_builder_.SetBfcOffset(space->BfcOffset()); | 81 MaybeUpdateFragmentBfcOffset(ConstraintSpace(), ConstraintSpace().BfcOffset(), |
| 82 &container_builder_); |
82 } | 83 } |
83 | 84 |
84 bool NGInlineLayoutAlgorithm::IsFirstLine() const { | 85 bool NGInlineLayoutAlgorithm::IsFirstLine() const { |
85 return !disallow_first_line_rules_ && container_builder_.Children().IsEmpty(); | 86 return !disallow_first_line_rules_ && container_builder_.Children().IsEmpty(); |
86 } | 87 } |
87 | 88 |
88 const ComputedStyle& NGInlineLayoutAlgorithm::FirstLineStyle() const { | 89 const ComputedStyle& NGInlineLayoutAlgorithm::FirstLineStyle() const { |
89 return Node()->GetLayoutObject()->FirstLineStyleRef(); | 90 return Node()->GetLayoutObject()->FirstLineStyleRef(); |
90 } | 91 } |
91 | 92 |
(...skipping 563 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
655 root_line_box->SetLineTopBottomPositions( | 656 root_line_box->SetLineTopBottomPositions( |
656 line_top, baseline + line_metrics.descent, | 657 line_top, baseline + line_metrics.descent, |
657 baseline - max_with_leading.ascent, | 658 baseline - max_with_leading.ascent, |
658 baseline + max_with_leading.descent); | 659 baseline + max_with_leading.descent); |
659 | 660 |
660 bidi_runs.DeleteRuns(); | 661 bidi_runs.DeleteRuns(); |
661 fragments_for_bidi_runs.Clear(); | 662 fragments_for_bidi_runs.Clear(); |
662 } | 663 } |
663 } | 664 } |
664 } // namespace blink | 665 } // namespace blink |
OLD | NEW |