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