| 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_break_token.h" | 7 #include "core/layout/ng/ng_break_token.h" |
| 8 #include "core/layout/ng/ng_constraint_space.h" | 8 #include "core/layout/ng/ng_constraint_space.h" |
| 9 #include "core/layout/ng/ng_fragment.h" | |
| 10 #include "core/layout/ng/ng_fragment_builder.h" | 9 #include "core/layout/ng/ng_fragment_builder.h" |
| 11 #include "core/layout/ng/ng_line_builder.h" | 10 #include "core/layout/ng/ng_line_builder.h" |
| 12 #include "core/layout/ng/ng_text_fragment.h" | 11 #include "core/layout/ng/ng_text_fragment.h" |
| 13 #include "core/layout/ng/ng_inline_node.h" | 12 #include "core/layout/ng/ng_inline_node.h" |
| 14 #include "core/style/ComputedStyle.h" | 13 #include "core/style/ComputedStyle.h" |
| 14 #include "core/layout/ng/ng_box_fragment.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 : NGLayoutAlgorithm(kTextLayoutAlgorithm), |
| 23 inline_box_(inline_box), | 23 inline_box_(inline_box), |
| 24 constraint_space_(constraint_space), | 24 constraint_space_(constraint_space), |
| 25 break_token_(break_token) { | 25 break_token_(break_token) { |
| 26 DCHECK(inline_box_); | 26 DCHECK(inline_box_); |
| 27 } | 27 } |
| 28 | 28 |
| 29 NGLayoutStatus NGTextLayoutAlgorithm::Layout( | 29 NGLayoutStatus NGTextLayoutAlgorithm::Layout(NGPhysicalFragment*, |
| 30 NGPhysicalFragmentBase*, | 30 NGPhysicalFragment** fragment_out, |
| 31 NGPhysicalFragmentBase** fragment_out, | 31 NGLayoutAlgorithm**) { |
| 32 NGLayoutAlgorithm**) { | |
| 33 ASSERT_NOT_REACHED(); | 32 ASSERT_NOT_REACHED(); |
| 34 *fragment_out = nullptr; | 33 *fragment_out = nullptr; |
| 35 return kNewFragment; | 34 return kNewFragment; |
| 36 } | 35 } |
| 37 | 36 |
| 38 bool NGTextLayoutAlgorithm::LayoutInline(NGLineBuilder* line_builder) { | 37 bool NGTextLayoutAlgorithm::LayoutInline(NGLineBuilder* line_builder) { |
| 39 // TODO(kojii): Make this tickable. Each line is easy. Needs more thoughts | 38 // TODO(kojii): Make this tickable. Each line is easy. Needs more thoughts |
| 40 // for each fragment in a line. Bidi reordering is probably atomic. | 39 // for each fragment in a line. Bidi reordering is probably atomic. |
| 41 // TODO(kojii): oof is not well-thought yet. The bottom static position may be | 40 // TODO(kojii): oof is not well-thought yet. The bottom static position may be |
| 42 // in the next line, https://github.com/w3c/csswg-drafts/issues/609 | 41 // in the next line, https://github.com/w3c/csswg-drafts/issues/609 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 71 } | 70 } |
| 72 | 71 |
| 73 DEFINE_TRACE(NGTextLayoutAlgorithm) { | 72 DEFINE_TRACE(NGTextLayoutAlgorithm) { |
| 74 NGLayoutAlgorithm::trace(visitor); | 73 NGLayoutAlgorithm::trace(visitor); |
| 75 visitor->trace(inline_box_); | 74 visitor->trace(inline_box_); |
| 76 visitor->trace(constraint_space_); | 75 visitor->trace(constraint_space_); |
| 77 visitor->trace(break_token_); | 76 visitor->trace(break_token_); |
| 78 } | 77 } |
| 79 | 78 |
| 80 } // namespace blink | 79 } // namespace blink |
| OLD | NEW |