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_block_layout_algorithm.h" | 5 #include "core/layout/ng/ng_block_layout_algorithm.h" |
6 | 6 |
7 #include "core/layout/ng/ng_absolute_utils.h" | 7 #include "core/layout/ng/ng_absolute_utils.h" |
8 #include "core/layout/ng/ng_block_break_token.h" | 8 #include "core/layout/ng/ng_block_break_token.h" |
9 #include "core/layout/ng/ng_block_child_iterator.h" | 9 #include "core/layout/ng/ng_block_child_iterator.h" |
10 #include "core/layout/ng/ng_box_fragment.h" | 10 #include "core/layout/ng/ng_box_fragment.h" |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 GetChildSpaceOffset()); | 451 GetChildSpaceOffset()); |
452 NGBlockChildIterator::Entry entry = child_iterator.NextChild(); | 452 NGBlockChildIterator::Entry entry = child_iterator.NextChild(); |
453 child = entry.node; | 453 child = entry.node; |
454 child_break_token = entry.token; | 454 child_break_token = entry.token; |
455 continue; | 455 continue; |
456 } | 456 } |
457 } | 457 } |
458 | 458 |
459 RefPtr<NGConstraintSpace> child_space = | 459 RefPtr<NGConstraintSpace> child_space = |
460 CreateConstraintSpaceForChild(child); | 460 CreateConstraintSpaceForChild(child); |
| 461 RefPtr<NGLayoutResult> layout_result = |
| 462 child->Layout(child_space.get(), child_break_token); |
461 | 463 |
462 RefPtr<NGLayoutResult> layout_result; | |
463 if (child->Type() == NGLayoutInputNode::kLegacyInline) { | |
464 layout_result = toNGInlineNode(child)->Layout( | |
465 child_space.get(), &builder_, child_break_token); | |
466 } else { | |
467 layout_result = child->Layout(child_space.get(), child_break_token); | |
468 } | |
469 FinishChildLayout(child, child_space.get(), layout_result); | 464 FinishChildLayout(child, child_space.get(), layout_result); |
470 | 465 |
471 entry = child_iterator.NextChild(); | 466 entry = child_iterator.NextChild(); |
472 child = entry.node; | 467 child = entry.node; |
473 child_break_token = entry.token; | 468 child_break_token = entry.token; |
474 | 469 |
475 if (IsOutOfSpace(ConstraintSpace(), content_size_)) | 470 if (IsOutOfSpace(ConstraintSpace(), content_size_)) |
476 break; | 471 break; |
477 } | 472 } |
478 | 473 |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
746 DCHECK(builder_.BfcOffset()); | 741 DCHECK(builder_.BfcOffset()); |
747 space_available -= curr_bfc_offset_.block_offset; | 742 space_available -= curr_bfc_offset_.block_offset; |
748 } | 743 } |
749 } | 744 } |
750 space_builder_.SetFragmentainerSpaceAvailable(space_available); | 745 space_builder_.SetFragmentainerSpaceAvailable(space_available); |
751 | 746 |
752 return space_builder_.ToConstraintSpace( | 747 return space_builder_.ToConstraintSpace( |
753 FromPlatformWritingMode(child_style.getWritingMode())); | 748 FromPlatformWritingMode(child_style.getWritingMode())); |
754 } | 749 } |
755 } // namespace blink | 750 } // namespace blink |
OLD | NEW |