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/ng/ng_units.h" | 7 #include "core/layout/ng/ng_units.h" |
8 | 8 |
9 namespace blink { | 9 namespace blink { |
10 | 10 |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 : physical_space_->width_direction_fragmentation_type_); | 74 : physical_space_->width_direction_fragmentation_type_); |
75 } | 75 } |
76 | 76 |
77 void NGConstraintSpace::Subtract(const NGFragment*) { | 77 void NGConstraintSpace::Subtract(const NGFragment*) { |
78 // TODO(layout-ng): Implement. | 78 // TODO(layout-ng): Implement. |
79 } | 79 } |
80 | 80 |
81 NGLayoutOpportunityIterator NGConstraintSpace::LayoutOpportunities( | 81 NGLayoutOpportunityIterator NGConstraintSpace::LayoutOpportunities( |
82 unsigned clear, | 82 unsigned clear, |
83 bool for_inline_or_bfc) { | 83 bool for_inline_or_bfc) { |
84 // TODO(layout-ng): Implement. | |
85 NGLayoutOpportunityIterator iterator(this, clear, for_inline_or_bfc); | 84 NGLayoutOpportunityIterator iterator(this, clear, for_inline_or_bfc); |
86 return iterator; | 85 return iterator; |
87 } | 86 } |
88 | 87 |
89 void NGConstraintSpace::SetContainerSize(NGLogicalSize container_size) { | 88 void NGConstraintSpace::SetContainerSize(NGLogicalSize container_size) { |
90 if (writing_mode_ == HorizontalTopBottom) { | 89 if (writing_mode_ == HorizontalTopBottom) { |
91 physical_space_->container_size_.width = container_size.inline_size; | 90 physical_space_->container_size_.width = container_size.inline_size; |
92 physical_space_->container_size_.height = container_size.block_size; | 91 physical_space_->container_size_.height = container_size.block_size; |
93 } else { | 92 } else { |
94 physical_space_->container_size_.width = container_size.block_size; | 93 physical_space_->container_size_.width = container_size.block_size; |
(...skipping 29 matching lines...) Expand all Loading... |
124 FragmentNone); | 123 FragmentNone); |
125 physical_space_->height_direction_fragmentation_type_ = type; | 124 physical_space_->height_direction_fragmentation_type_ = type; |
126 } else { | 125 } else { |
127 DCHECK_EQ(static_cast<NGFragmentationType>( | 126 DCHECK_EQ(static_cast<NGFragmentationType>( |
128 physical_space_->height_direction_fragmentation_type_), | 127 physical_space_->height_direction_fragmentation_type_), |
129 FragmentNone); | 128 FragmentNone); |
130 physical_space_->width_direction_triggers_scrollbar_ = type; | 129 physical_space_->width_direction_triggers_scrollbar_ = type; |
131 } | 130 } |
132 } | 131 } |
133 | 132 |
| 133 NGConstraintSpace* NGLayoutOpportunityIterator::Next() { |
| 134 auto* exclusions = constraint_space_->PhysicalSpace()->Exclusions(); |
| 135 if (!exclusions->head()) |
| 136 return new NGConstraintSpace(constraint_space_->WritingMode(), |
| 137 constraint_space_->PhysicalSpace()); |
| 138 return nullptr; |
| 139 } |
| 140 |
134 } // namespace blink | 141 } // namespace blink |
OLD | NEW |