| 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_box_fragment.h" |
| 10 #include "core/layout/ng/ng_constraint_space_builder.h" | 10 #include "core/layout/ng/ng_constraint_space_builder.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 // Adjust the static_position origin. The static_position coordinate origin is | 94 // Adjust the static_position origin. The static_position coordinate origin is |
| 95 // relative to the container's border box, ng_absolute_utils expects it to be | 95 // relative to the container's border box, ng_absolute_utils expects it to be |
| 96 // relative to the container's padding box. | 96 // relative to the container's padding box. |
| 97 static_position.offset -= container_border_physical_offset_; | 97 static_position.offset -= container_border_physical_offset_; |
| 98 | 98 |
| 99 NGFragment* fragment = nullptr; | 99 NGFragment* fragment = nullptr; |
| 100 Optional<MinAndMaxContentSizes> inline_estimate; | 100 Optional<MinAndMaxContentSizes> inline_estimate; |
| 101 Optional<LayoutUnit> block_estimate; | 101 Optional<LayoutUnit> block_estimate; |
| 102 | 102 |
| 103 if (AbsoluteNeedsChildInlineSize(*descendant.Style())) { | 103 if (AbsoluteNeedsChildInlineSize(*descendant.Style())) { |
| 104 inline_estimate = descendant.ComputeMinAndMaxContentSizesSync(); | 104 inline_estimate = descendant.ComputeMinAndMaxContentSizes(); |
| 105 } | 105 } |
| 106 | 106 |
| 107 NGAbsolutePhysicalPosition node_position = | 107 NGAbsolutePhysicalPosition node_position = |
| 108 ComputePartialAbsoluteWithChildInlineSize( | 108 ComputePartialAbsoluteWithChildInlineSize( |
| 109 *container_space_, *descendant.Style(), static_position, | 109 *container_space_, *descendant.Style(), static_position, |
| 110 inline_estimate); | 110 inline_estimate); |
| 111 | 111 |
| 112 if (AbsoluteNeedsChildBlockSize(*descendant.Style())) { | 112 if (AbsoluteNeedsChildBlockSize(*descendant.Style())) { |
| 113 fragment = GenerateFragment(descendant, block_estimate, node_position); | 113 fragment = GenerateFragment(descendant, block_estimate, node_position); |
| 114 block_estimate = fragment->BlockSize(); | 114 block_estimate = fragment->BlockSize(); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 NGPhysicalFragment* fragment = descendant.Layout(space); | 168 NGPhysicalFragment* fragment = descendant.Layout(space); |
| 169 | 169 |
| 170 // TODO(ikilpatrick): the writing mode switching here looks wrong. | 170 // TODO(ikilpatrick): the writing mode switching here looks wrong. |
| 171 return new NGBoxFragment(container_space_->WritingMode(), | 171 return new NGBoxFragment(container_space_->WritingMode(), |
| 172 container_space_->Direction(), | 172 container_space_->Direction(), |
| 173 toNGPhysicalBoxFragment(fragment)); | 173 toNGPhysicalBoxFragment(fragment)); |
| 174 } | 174 } |
| 175 | 175 |
| 176 } // namespace blink | 176 } // namespace blink |
| OLD | NEW |