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_inline_node.h" | 5 #include "core/layout/ng/ng_inline_node.h" |
6 | 6 |
7 #include "core/layout/LayoutBlockFlow.h" | 7 #include "core/layout/LayoutBlockFlow.h" |
8 #include "core/style/ComputedStyle.h" | 8 #include "core/style/ComputedStyle.h" |
9 #include "core/layout/ng/layout_ng_block_flow.h" | 9 #include "core/layout/ng/layout_ng_block_flow.h" |
10 #include "core/layout/ng/ng_bidi_paragraph.h" | 10 #include "core/layout/ng/ng_bidi_paragraph.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 }; | 202 }; |
203 } | 203 } |
204 } | 204 } |
205 | 205 |
206 bool NGInlineNode::Layout(const NGConstraintSpace* constraint_space, | 206 bool NGInlineNode::Layout(const NGConstraintSpace* constraint_space, |
207 NGFragmentBase** out) { | 207 NGFragmentBase** out) { |
208 // TODO(layout-dev): Perform pre-layout text step. | 208 // TODO(layout-dev): Perform pre-layout text step. |
209 | 209 |
210 // NOTE: We don't need to change the coordinate system here as we are an | 210 // NOTE: We don't need to change the coordinate system here as we are an |
211 // inline. | 211 // inline. |
212 NGConstraintSpace* child_constraint_space = new NGConstraintSpace( | 212 NGConstraintSpace* child_constraint_space = |
213 constraint_space->WritingMode(), constraint_space->Direction(), | 213 NGConstraintSpaceBuilder(constraint_space->WritingMode()) |
214 constraint_space->MutablePhysicalSpace()); | 214 .SetTextDirection(constraint_space->Direction()) |
| 215 .ToConstraintSpace(); |
215 | 216 |
216 if (!layout_algorithm_) | 217 if (!layout_algorithm_) |
217 // TODO(layout-dev): If an atomic inline run the appropriate algorithm. | 218 // TODO(layout-dev): If an atomic inline run the appropriate algorithm. |
218 layout_algorithm_ = new NGTextLayoutAlgorithm(this, child_constraint_space); | 219 layout_algorithm_ = new NGTextLayoutAlgorithm(this, child_constraint_space); |
219 | 220 |
220 NGPhysicalFragmentBase* fragment = nullptr; | 221 NGPhysicalFragmentBase* fragment = nullptr; |
221 if (!layout_algorithm_->Layout(nullptr, &fragment, nullptr)) | 222 if (!layout_algorithm_->Layout(nullptr, &fragment, nullptr)) |
222 return false; | 223 return false; |
223 | 224 |
224 // TODO(layout-dev): Implement copying of fragment data to LayoutObject tree. | 225 // TODO(layout-dev): Implement copying of fragment data to LayoutObject tree. |
(...skipping 18 matching lines...) Expand all Loading... |
243 return next_sibling_; | 244 return next_sibling_; |
244 } | 245 } |
245 | 246 |
246 DEFINE_TRACE(NGInlineNode) { | 247 DEFINE_TRACE(NGInlineNode) { |
247 visitor->trace(next_sibling_); | 248 visitor->trace(next_sibling_); |
248 visitor->trace(layout_algorithm_); | 249 visitor->trace(layout_algorithm_); |
249 NGLayoutInputNode::trace(visitor); | 250 NGLayoutInputNode::trace(visitor); |
250 } | 251 } |
251 | 252 |
252 } // namespace blink | 253 } // namespace blink |
OLD | NEW |