Chromium Code Reviews| 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 #include "core/layout/ng/ng_layout_opportunity_iterator.h" | 10 #include "core/layout/ng/ng_layout_opportunity_iterator.h" |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 96 fixed_block = true; | 96 fixed_block = true; |
| 97 } | 97 } |
| 98 | 98 |
| 99 bool is_new_fc = | 99 bool is_new_fc = |
| 100 box.isLayoutBlock() && toLayoutBlock(box).createsNewFormattingContext(); | 100 box.isLayoutBlock() && toLayoutBlock(box).createsNewFormattingContext(); |
| 101 | 101 |
| 102 FloatSize icb_float_size = box.view()->viewportSizeForViewportUnits(); | 102 FloatSize icb_float_size = box.view()->viewportSizeForViewportUnits(); |
| 103 NGPhysicalSize initial_containing_block_size{ | 103 NGPhysicalSize initial_containing_block_size{ |
| 104 LayoutUnit(icb_float_size.width()), LayoutUnit(icb_float_size.height())}; | 104 LayoutUnit(icb_float_size.width()), LayoutUnit(icb_float_size.height())}; |
| 105 | 105 |
| 106 DCHECK(initial_containing_block_size.width >= LayoutUnit()); | |
|
Gleb Lanbin
2017/03/01 21:08:42
1) DCHECK(initial_containing_block_size >= NGPhysi
dgrogan
2017/03/01 21:25:09
nit: DCHECK_GE?
atotic
2017/03/01 23:07:49
done.
| |
| 107 DCHECK(initial_containing_block_size.height >= LayoutUnit()); | |
| 108 | |
| 106 return NGConstraintSpaceBuilder(writing_mode) | 109 return NGConstraintSpaceBuilder(writing_mode) |
| 107 .SetAvailableSize(available_size) | 110 .SetAvailableSize(available_size) |
| 108 .SetPercentageResolutionSize(percentage_size) | 111 .SetPercentageResolutionSize(percentage_size) |
| 109 .SetInitialContainingBlockSize(initial_containing_block_size) | 112 .SetInitialContainingBlockSize(initial_containing_block_size) |
| 110 .SetIsInlineDirectionTriggersScrollbar( | 113 .SetIsInlineDirectionTriggersScrollbar( |
| 111 box.styleRef().overflowInlineDirection() == EOverflow::kAuto) | 114 box.styleRef().overflowInlineDirection() == EOverflow::kAuto) |
| 112 .SetIsBlockDirectionTriggersScrollbar( | 115 .SetIsBlockDirectionTriggersScrollbar( |
| 113 box.styleRef().overflowBlockDirection() == EOverflow::kAuto) | 116 box.styleRef().overflowBlockDirection() == EOverflow::kAuto) |
| 114 .SetIsFixedSizeInline(fixed_inline) | 117 .SetIsFixedSizeInline(fixed_inline) |
| 115 .SetIsFixedSizeBlock(fixed_block) | 118 .SetIsFixedSizeBlock(fixed_block) |
| (...skipping 24 matching lines...) Expand all Loading... | |
| 140 bfc_offset_.block_offset.toString().ascii().data(), | 143 bfc_offset_.block_offset.toString().ascii().data(), |
| 141 AvailableSize().inline_size.toString().ascii().data(), | 144 AvailableSize().inline_size.toString().ascii().data(), |
| 142 AvailableSize().block_size.toString().ascii().data(), | 145 AvailableSize().block_size.toString().ascii().data(), |
| 143 margin_strut_.ToString().ascii().data(), | 146 margin_strut_.ToString().ascii().data(), |
| 144 clearance_offset_.has_value() | 147 clearance_offset_.has_value() |
| 145 ? clearance_offset_.value().toString().ascii().data() | 148 ? clearance_offset_.value().toString().ascii().data() |
| 146 : "none"); | 149 : "none"); |
| 147 } | 150 } |
| 148 | 151 |
| 149 } // namespace blink | 152 } // namespace blink |
| OLD | NEW |