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_text_layout_algorithm.h" | 5 #include "core/layout/ng/ng_text_layout_algorithm.h" |
6 | 6 |
7 #include "core/layout/ng/ng_box_fragment.h" | 7 #include "core/layout/ng/ng_box_fragment.h" |
8 #include "core/layout/ng/ng_break_token.h" | 8 #include "core/layout/ng/ng_break_token.h" |
9 #include "core/layout/ng/ng_constraint_space.h" | 9 #include "core/layout/ng/ng_constraint_space.h" |
10 #include "core/layout/ng/ng_fragment_builder.h" | 10 #include "core/layout/ng/ng_fragment_builder.h" |
11 #include "core/layout/ng/ng_inline_node.h" | 11 #include "core/layout/ng/ng_inline_node.h" |
12 #include "core/layout/ng/ng_line_builder.h" | 12 #include "core/layout/ng/ng_line_builder.h" |
13 #include "core/layout/ng/ng_text_fragment.h" | 13 #include "core/layout/ng/ng_text_fragment.h" |
14 #include "core/style/ComputedStyle.h" | 14 #include "core/style/ComputedStyle.h" |
15 | 15 |
16 namespace blink { | 16 namespace blink { |
17 | 17 |
18 NGTextLayoutAlgorithm::NGTextLayoutAlgorithm( | 18 NGTextLayoutAlgorithm::NGTextLayoutAlgorithm( |
19 NGInlineNode* inline_box, | 19 NGInlineNode* inline_box, |
20 NGConstraintSpace* constraint_space, | 20 NGConstraintSpace* constraint_space, |
21 NGBreakToken* break_token) | 21 NGBreakToken* break_token) |
22 : NGLayoutAlgorithm(kTextLayoutAlgorithm), | 22 : inline_box_(inline_box), |
23 inline_box_(inline_box), | |
24 constraint_space_(constraint_space), | 23 constraint_space_(constraint_space), |
25 break_token_(break_token) { | 24 break_token_(break_token) { |
26 DCHECK(inline_box_); | 25 DCHECK(inline_box_); |
27 } | 26 } |
28 | 27 |
29 NGPhysicalFragment* NGTextLayoutAlgorithm::Layout() { | 28 NGPhysicalFragment* NGTextLayoutAlgorithm::Layout() { |
30 ASSERT_NOT_REACHED(); | 29 ASSERT_NOT_REACHED(); |
31 return nullptr; | 30 return nullptr; |
32 } | 31 } |
33 | 32 |
(...skipping 27 matching lines...) Expand all Loading... |
61 break; | 60 break; |
62 } | 61 } |
63 inline_size += item.InlineSize(); | 62 inline_size += item.InlineSize(); |
64 } | 63 } |
65 line_builder->Add(start_index, i, inline_size); | 64 line_builder->Add(start_index, i, inline_size); |
66 start_index = i; | 65 start_index = i; |
67 } | 66 } |
68 line_builder->CreateLine(); | 67 line_builder->CreateLine(); |
69 } | 68 } |
70 | 69 |
71 DEFINE_TRACE(NGTextLayoutAlgorithm) { | |
72 NGLayoutAlgorithm::trace(visitor); | |
73 visitor->trace(inline_box_); | |
74 visitor->trace(constraint_space_); | |
75 visitor->trace(break_token_); | |
76 } | |
77 | |
78 } // namespace blink | 70 } // namespace blink |
OLD | NEW |