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_constraint_space.h" | 5 #include "core/layout/ng/ng_constraint_space.h" |
6 | 6 |
7 #include "core/layout/LayoutBlock.h" | 7 #include "core/layout/LayoutBlock.h" |
8 #include "core/layout/LayoutView.h" | 8 #include "core/layout/LayoutView.h" |
9 #include "core/layout/ng/ng_constraint_space_builder.h" | 9 #include "core/layout/ng/ng_constraint_space_builder.h" |
10 | 10 |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 available_size.inline_size = | 95 available_size.inline_size = |
96 box.BorderAndPaddingLogicalWidth() + box.OverrideLogicalContentWidth(); | 96 box.BorderAndPaddingLogicalWidth() + box.OverrideLogicalContentWidth(); |
97 fixed_inline = true; | 97 fixed_inline = true; |
98 } | 98 } |
99 if (box.HasOverrideLogicalContentHeight()) { | 99 if (box.HasOverrideLogicalContentHeight()) { |
100 available_size.block_size = box.BorderAndPaddingLogicalHeight() + | 100 available_size.block_size = box.BorderAndPaddingLogicalHeight() + |
101 box.OverrideLogicalContentHeight(); | 101 box.OverrideLogicalContentHeight(); |
102 fixed_block = true; | 102 fixed_block = true; |
103 } | 103 } |
104 | 104 |
105 bool is_new_fc = | 105 bool is_new_fc = true; |
106 box.IsLayoutBlock() && ToLayoutBlock(box).CreatesNewFormattingContext(); | 106 // TODO(ikilpatrick): This DCHECK needs to be enabled once we've switched |
| 107 // LayoutTableCell, etc over to LayoutNG. |
| 108 // |
| 109 // We currently need to "force" LayoutNG roots to be formatting contexts so |
| 110 // that floats have layout performed on them. |
| 111 // |
| 112 // DCHECK(is_new_fc, |
| 113 // box.IsLayoutBlock() && ToLayoutBlock(box).CreatesNewFormattingContext()); |
107 | 114 |
108 FloatSize icb_float_size = box.View()->ViewportSizeForViewportUnits(); | 115 FloatSize icb_float_size = box.View()->ViewportSizeForViewportUnits(); |
109 NGPhysicalSize initial_containing_block_size{ | 116 NGPhysicalSize initial_containing_block_size{ |
110 LayoutUnit(icb_float_size.Width()), LayoutUnit(icb_float_size.Height())}; | 117 LayoutUnit(icb_float_size.Width()), LayoutUnit(icb_float_size.Height())}; |
111 | 118 |
112 // ICB cannot be indefinite by the spec. | 119 // ICB cannot be indefinite by the spec. |
113 DCHECK_GE(initial_containing_block_size.width, LayoutUnit()); | 120 DCHECK_GE(initial_containing_block_size.width, LayoutUnit()); |
114 DCHECK_GE(initial_containing_block_size.height, LayoutUnit()); | 121 DCHECK_GE(initial_containing_block_size.height, LayoutUnit()); |
115 | 122 |
116 return NGConstraintSpaceBuilder(writing_mode) | 123 return NGConstraintSpaceBuilder(writing_mode) |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 bfc_offset_.block_offset.ToString().Ascii().data(), | 192 bfc_offset_.block_offset.ToString().Ascii().data(), |
186 AvailableSize().inline_size.ToString().Ascii().data(), | 193 AvailableSize().inline_size.ToString().Ascii().data(), |
187 AvailableSize().block_size.ToString().Ascii().data(), | 194 AvailableSize().block_size.ToString().Ascii().data(), |
188 margin_strut_.ToString().Ascii().data(), | 195 margin_strut_.ToString().Ascii().data(), |
189 clearance_offset_.has_value() | 196 clearance_offset_.has_value() |
190 ? clearance_offset_.value().ToString().Ascii().data() | 197 ? clearance_offset_.value().ToString().Ascii().data() |
191 : "none"); | 198 : "none"); |
192 } | 199 } |
193 | 200 |
194 } // namespace blink | 201 } // namespace blink |
OLD | NEW |