Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Side by Side Diff: third_party/WebKit/Source/core/layout/ng/ng_out_of_flow_layout_part.cc

Issue 2721613003: [LayoutNG] Move remaining ng_units structs to their own files (Closed)
Patch Set: Don't export NGBoxStrut for now Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 RefPtr<NGLayoutResult> NGOutOfFlowLayoutPart::LayoutDescendant( 99 RefPtr<NGLayoutResult> NGOutOfFlowLayoutPart::LayoutDescendant(
100 NGBlockNode& descendant, 100 NGBlockNode& descendant,
101 NGStaticPosition static_position, 101 NGStaticPosition static_position,
102 NGLogicalOffset* offset) { 102 NGLogicalOffset* offset) {
103 // Adjust the static_position origin. The static_position coordinate origin is 103 // Adjust the static_position origin. The static_position coordinate origin is
104 // relative to the container's border box, ng_absolute_utils expects it to be 104 // relative to the container's border box, ng_absolute_utils expects it to be
105 // relative to the container's padding box. 105 // relative to the container's padding box.
106 static_position.offset -= container_border_physical_offset_; 106 static_position.offset -= container_border_physical_offset_;
107 107
108 RefPtr<NGLayoutResult> layout_result = nullptr; 108 RefPtr<NGLayoutResult> layout_result = nullptr;
109 Optional<MinAndMaxContentSizes> inline_estimate; 109 Optional<MinMaxContentSize> inline_estimate;
110 Optional<LayoutUnit> block_estimate; 110 Optional<LayoutUnit> block_estimate;
111 111
112 if (AbsoluteNeedsChildInlineSize(descendant.Style())) { 112 if (AbsoluteNeedsChildInlineSize(descendant.Style())) {
113 inline_estimate = descendant.ComputeMinAndMaxContentSizes(); 113 inline_estimate = descendant.ComputeMinMaxContentSize();
114 } 114 }
115 115
116 NGAbsolutePhysicalPosition node_position = 116 NGAbsolutePhysicalPosition node_position =
117 ComputePartialAbsoluteWithChildInlineSize( 117 ComputePartialAbsoluteWithChildInlineSize(
118 *container_space_, descendant.Style(), static_position, 118 *container_space_, descendant.Style(), static_position,
119 inline_estimate); 119 inline_estimate);
120 120
121 if (AbsoluteNeedsChildBlockSize(descendant.Style())) { 121 if (AbsoluteNeedsChildBlockSize(descendant.Style())) {
122 layout_result = GenerateFragment(descendant, block_estimate, node_position); 122 layout_result = GenerateFragment(descendant, block_estimate, node_position);
123 123
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 builder.SetIsFixedSizeBlock(true); 178 builder.SetIsFixedSizeBlock(true);
179 builder.SetIsFixedSizeInline(true); 179 builder.SetIsFixedSizeInline(true);
180 builder.SetIsNewFormattingContext(true); 180 builder.SetIsNewFormattingContext(true);
181 NGConstraintSpace* space = 181 NGConstraintSpace* space =
182 builder.ToConstraintSpace(container_space_->WritingMode()); 182 builder.ToConstraintSpace(container_space_->WritingMode());
183 183
184 return descendant.Layout(space); 184 return descendant.Layout(space);
185 } 185 }
186 186
187 } // namespace blink 187 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698