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/inline/ng_inline_node.h" | 5 #include "core/layout/ng/inline/ng_inline_node.h" |
6 | 6 |
7 #include "core/layout/BidiRun.h" | 7 #include "core/layout/BidiRun.h" |
8 #include "core/layout/LayoutBlockFlow.h" | 8 #include "core/layout/LayoutBlockFlow.h" |
9 #include "core/layout/LayoutObject.h" | 9 #include "core/layout/LayoutObject.h" |
10 #include "core/layout/LayoutText.h" | 10 #include "core/layout/LayoutText.h" |
(...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 | 223 |
224 RefPtr<NGLayoutResult> NGInlineNode::Layout(NGConstraintSpace* constraint_space, | 224 RefPtr<NGLayoutResult> NGInlineNode::Layout(NGConstraintSpace* constraint_space, |
225 NGBreakToken* break_token) { | 225 NGBreakToken* break_token) { |
226 // TODO(kojii): Invalidate PrepareLayout() more efficiently. | 226 // TODO(kojii): Invalidate PrepareLayout() more efficiently. |
227 InvalidatePrepareLayout(); | 227 InvalidatePrepareLayout(); |
228 PrepareLayout(); | 228 PrepareLayout(); |
229 | 229 |
230 NGInlineLayoutAlgorithm algorithm(this, constraint_space, | 230 NGInlineLayoutAlgorithm algorithm(this, constraint_space, |
231 ToNGInlineBreakToken(break_token)); | 231 ToNGInlineBreakToken(break_token)); |
232 RefPtr<NGLayoutResult> result = algorithm.Layout(); | 232 RefPtr<NGLayoutResult> result = algorithm.Layout(); |
233 CopyFragmentDataToLayoutBox(*constraint_space, result.Get()); | 233 |
| 234 block_->root_fragment_ = result->PhysicalFragment(); |
| 235 |
| 236 // CopyFragmentDataToLayoutBox(*constraint_space, result.Get()); |
234 return result; | 237 return result; |
235 } | 238 } |
236 | 239 |
237 enum class ContentSizeMode { Max, Sum }; | 240 enum class ContentSizeMode { Max, Sum }; |
238 | 241 |
239 static LayoutUnit ComputeContentSize(NGInlineNode* node, | 242 static LayoutUnit ComputeContentSize(NGInlineNode* node, |
240 ContentSizeMode mode, | 243 ContentSizeMode mode, |
241 LayoutUnit available_inline_size, | 244 LayoutUnit available_inline_size, |
242 NGConstraintSpaceBuilder* space_builder, | 245 NGConstraintSpaceBuilder* space_builder, |
243 NGWritingMode writing_mode) { | 246 NGWritingMode writing_mode) { |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 String NGInlineNode::ToString() const { | 452 String NGInlineNode::ToString() const { |
450 return String::Format("NGInlineNode"); | 453 return String::Format("NGInlineNode"); |
451 } | 454 } |
452 | 455 |
453 DEFINE_TRACE(NGInlineNode) { | 456 DEFINE_TRACE(NGInlineNode) { |
454 visitor->Trace(next_sibling_); | 457 visitor->Trace(next_sibling_); |
455 NGLayoutInputNode::Trace(visitor); | 458 NGLayoutInputNode::Trace(visitor); |
456 } | 459 } |
457 | 460 |
458 } // namespace blink | 461 } // namespace blink |
OLD | NEW |