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.h" | 9 #include "core/layout/ng/ng_constraint_space.h" |
10 #include "core/layout/ng/ng_constraint_space_builder.h" | 10 #include "core/layout/ng/ng_constraint_space_builder.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 // TODO(layout-ng): Implement. | 124 // TODO(layout-ng): Implement. |
125 } | 125 } |
126 | 126 |
127 NGLayoutOpportunityIterator* NGConstraintSpace::LayoutOpportunities( | 127 NGLayoutOpportunityIterator* NGConstraintSpace::LayoutOpportunities( |
128 unsigned clear, | 128 unsigned clear, |
129 bool for_inline_or_bfc) { | 129 bool for_inline_or_bfc) { |
130 NGLayoutOpportunityIterator* iterator = new NGLayoutOpportunityIterator(this); | 130 NGLayoutOpportunityIterator* iterator = new NGLayoutOpportunityIterator(this); |
131 return iterator; | 131 return iterator; |
132 } | 132 } |
133 | 133 |
134 void NGConstraintSpace::SetOverflowTriggersScrollbar(bool inline_triggers, | |
135 bool block_triggers) { | |
136 if (writing_mode_ == HorizontalTopBottom) { | |
137 physical_space_->width_direction_triggers_scrollbar_ = inline_triggers; | |
138 physical_space_->height_direction_triggers_scrollbar_ = block_triggers; | |
139 } else { | |
140 physical_space_->width_direction_triggers_scrollbar_ = block_triggers; | |
141 physical_space_->height_direction_triggers_scrollbar_ = inline_triggers; | |
142 } | |
143 } | |
144 | |
145 void NGConstraintSpace::SetFixedSize(bool inline_fixed, bool block_fixed) { | |
146 if (writing_mode_ == HorizontalTopBottom) { | |
147 physical_space_->fixed_width_ = inline_fixed; | |
148 physical_space_->fixed_height_ = block_fixed; | |
149 } else { | |
150 physical_space_->fixed_width_ = block_fixed; | |
151 physical_space_->fixed_height_ = inline_fixed; | |
152 } | |
153 } | |
154 | |
155 void NGConstraintSpace::SetFragmentationType(NGFragmentationType type) { | |
156 if (writing_mode_ == HorizontalTopBottom) { | |
157 DCHECK_EQ(static_cast<NGFragmentationType>( | |
158 physical_space_->width_direction_fragmentation_type_), | |
159 FragmentNone); | |
160 physical_space_->height_direction_fragmentation_type_ = type; | |
161 } else { | |
162 DCHECK_EQ(static_cast<NGFragmentationType>( | |
163 physical_space_->height_direction_fragmentation_type_), | |
164 FragmentNone); | |
165 physical_space_->width_direction_triggers_scrollbar_ = type; | |
166 } | |
167 } | |
168 | |
169 void NGConstraintSpace::SetIsNewFormattingContext(bool is_new_fc) { | |
170 physical_space_->is_new_fc_ = is_new_fc; | |
171 } | |
172 | |
173 String NGConstraintSpace::ToString() const { | 134 String NGConstraintSpace::ToString() const { |
174 return String::format("%s,%s %sx%s", | 135 return String::format("%s,%s %sx%s", |
175 offset_.inline_offset.toString().ascii().data(), | 136 offset_.inline_offset.toString().ascii().data(), |
176 offset_.block_offset.toString().ascii().data(), | 137 offset_.block_offset.toString().ascii().data(), |
177 size_.inline_size.toString().ascii().data(), | 138 size_.inline_size.toString().ascii().data(), |
178 size_.block_size.toString().ascii().data()); | 139 size_.block_size.toString().ascii().data()); |
179 } | 140 } |
180 | 141 |
181 } // namespace blink | 142 } // namespace blink |
OLD | NEW |