OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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_base_layout_algorithm_test.h" | 5 #include "core/layout/ng/ng_base_layout_algorithm_test.h" |
6 | 6 |
7 #include "core/layout/ng/inline/ng_inline_layout_algorithm.h" | 7 #include "core/layout/ng/inline/ng_inline_layout_algorithm.h" |
8 #include "core/layout/ng/inline/ng_inline_node.h" | 8 #include "core/layout/ng/inline/ng_inline_node.h" |
9 #include "core/layout/ng/inline/ng_line_breaker.h" | 9 #include "core/layout/ng/inline/ng_line_breaker.h" |
10 #include "core/layout/ng/layout_ng_block_flow.h" | 10 #include "core/layout/ng/layout_ng_block_flow.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 RefPtr<NGConstraintSpace> space = | 34 RefPtr<NGConstraintSpace> space = |
35 NGConstraintSpaceBuilder(NGWritingMode::kHorizontalTopBottom) | 35 NGConstraintSpaceBuilder(NGWritingMode::kHorizontalTopBottom) |
36 .SetAvailableSize({available_width, NGSizeIndefinite}) | 36 .SetAvailableSize({available_width, NGSizeIndefinite}) |
37 .ToConstraintSpace(NGWritingMode::kHorizontalTopBottom); | 37 .ToConstraintSpace(NGWritingMode::kHorizontalTopBottom); |
38 | 38 |
39 NGFragmentBuilder container_builder( | 39 NGFragmentBuilder container_builder( |
40 NGPhysicalFragment::NGFragmentType::kFragmentBox, node); | 40 NGPhysicalFragment::NGFragmentType::kFragmentBox, node); |
41 container_builder.SetBfcOffset(NGLogicalOffset{LayoutUnit(), LayoutUnit()}); | 41 container_builder.SetBfcOffset(NGLogicalOffset{LayoutUnit(), LayoutUnit()}); |
42 | 42 |
43 NGLineBreaker line_breaker(node, space.Get(), &container_builder); | 43 Vector<RefPtr<NGUnpositionedFloat>> unpositioned_floats; |
| 44 NGLineBreaker line_breaker(node, space.Get(), &container_builder, |
| 45 &unpositioned_floats); |
| 46 |
44 Vector<NGInlineItemResults> lines; | 47 Vector<NGInlineItemResults> lines; |
45 NGLineInfo line_info; | 48 NGLineInfo line_info; |
46 while (line_breaker.NextLine(&line_info, NGLogicalOffset())) | 49 while (line_breaker.NextLine(&line_info, NGLogicalOffset())) |
47 lines.push_back(std::move(line_info.Results())); | 50 lines.push_back(std::move(line_info.Results())); |
48 return lines; | 51 return lines; |
49 } | 52 } |
50 }; | 53 }; |
51 | 54 |
52 namespace { | 55 namespace { |
53 | 56 |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 EXPECT_EQ("789", ToString(lines[1], node)); | 271 EXPECT_EQ("789", ToString(lines[1], node)); |
269 | 272 |
270 lines = BreakLines(node, LayoutUnit(20)); | 273 lines = BreakLines(node, LayoutUnit(20)); |
271 EXPECT_EQ(2u, lines.size()); | 274 EXPECT_EQ(2u, lines.size()); |
272 EXPECT_EQ("123456", ToString(lines[0], node)); | 275 EXPECT_EQ("123456", ToString(lines[0], node)); |
273 EXPECT_EQ("789", ToString(lines[1], node)); | 276 EXPECT_EQ("789", ToString(lines[1], node)); |
274 } | 277 } |
275 | 278 |
276 } // namespace | 279 } // namespace |
277 } // namespace blink | 280 } // namespace blink |
OLD | NEW |