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_out_of_flow_layout_part.h" | 5 #include "core/layout/ng/ng_out_of_flow_layout_part.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_node.h" | 8 #include "core/layout/ng/ng_block_node.h" |
| 9 #include "core/layout/ng/ng_box_fragment.h" |
9 #include "core/layout/ng/ng_constraint_space_builder.h" | 10 #include "core/layout/ng/ng_constraint_space_builder.h" |
10 #include "core/layout/ng/ng_fragment.h" | 11 #include "core/layout/ng/ng_fragment.h" |
11 #include "core/layout/ng/ng_length_utils.h" | 12 #include "core/layout/ng/ng_length_utils.h" |
12 #include "core/layout/ng/ng_physical_fragment.h" | 13 #include "core/layout/ng/ng_physical_fragment.h" |
13 #include "core/style/ComputedStyle.h" | 14 #include "core/style/ComputedStyle.h" |
14 | 15 |
15 namespace blink { | 16 namespace blink { |
16 | 17 |
17 NGOutOfFlowLayoutPart::NGOutOfFlowLayoutPart( | 18 NGOutOfFlowLayoutPart::NGOutOfFlowLayoutPart( |
18 PassRefPtr<const ComputedStyle> container_style, | 19 PassRefPtr<const ComputedStyle> container_style, |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 110 |
110 NGConstraintSpaceBuilder builder(parent_space_->WritingMode()); | 111 NGConstraintSpaceBuilder builder(parent_space_->WritingMode()); |
111 builder.SetAvailableSize(available_size); | 112 builder.SetAvailableSize(available_size); |
112 builder.SetPercentageResolutionSize(parent_space_->AvailableSize()); | 113 builder.SetPercentageResolutionSize(parent_space_->AvailableSize()); |
113 if (block_estimate) | 114 if (block_estimate) |
114 builder.SetIsFixedSizeBlock(true); | 115 builder.SetIsFixedSizeBlock(true); |
115 builder.SetIsFixedSizeInline(true); | 116 builder.SetIsFixedSizeInline(true); |
116 builder.SetIsNewFormattingContext(true); | 117 builder.SetIsNewFormattingContext(true); |
117 NGConstraintSpace* space = builder.ToConstraintSpace(); | 118 NGConstraintSpace* space = builder.ToConstraintSpace(); |
118 | 119 |
119 NGFragment* fragment; | 120 NGPhysicalFragment* fragment = node.Layout(space); |
120 node.LayoutSync(space, &fragment); | 121 |
121 return fragment; | 122 // TODO(ikilpatrick): the writing mode switching here looks wrong. |
| 123 return new NGBoxFragment(parent_space_->WritingMode(), |
| 124 parent_space_->Direction(), |
| 125 toNGPhysicalBoxFragment(fragment)); |
122 } | 126 } |
123 | 127 |
124 DEFINE_TRACE(NGOutOfFlowLayoutPart) { | 128 DEFINE_TRACE(NGOutOfFlowLayoutPart) { |
125 visitor->trace(parent_space_); | 129 visitor->trace(parent_space_); |
126 } | 130 } |
127 | 131 |
128 } // namespace blink | 132 } // namespace blink |
OLD | NEW |