| 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" |
| 11 #include "core/layout/ng/ng_layout_inline_items_builder.h" | 11 #include "core/layout/ng/ng_layout_inline_items_builder.h" |
| 12 #include "core/layout/ng/ng_text_layout_algorithm.h" | 12 #include "core/layout/ng/ng_text_layout_algorithm.h" |
| 13 #include "core/layout/ng/ng_constraint_space_builder.h" | 13 #include "core/layout/ng/ng_constraint_space_builder.h" |
| 14 #include "core/layout/ng/ng_constraint_space.h" | 14 #include "core/layout/ng/ng_constraint_space.h" |
| 15 #include "core/layout/ng/ng_physical_text_fragment.h" | 15 #include "core/layout/ng/ng_physical_text_fragment.h" |
| 16 #include "core/layout/ng/ng_text_fragment.h" | 16 #include "core/layout/ng/ng_text_fragment.h" |
| 17 #include "core/layout/ng/ng_fragment_builder.h" | 17 #include "core/layout/ng/ng_fragment_builder.h" |
| 18 #include "core/layout/ng/ng_length_utils.h" | 18 #include "core/layout/ng/ng_length_utils.h" |
| 19 #include "core/layout/ng/ng_writing_mode.h" | 19 #include "core/layout/ng/ng_writing_mode.h" |
| 20 #include "platform/text/TextDirection.h" | 20 #include "platform/text/TextDirection.h" |
| 21 #include "platform/fonts/shaping/CachingWordShaper.h" | 21 #include "platform/fonts/shaping/CachingWordShaper.h" |
| 22 #include "platform/fonts/shaping/CachingWordShapeIterator.h" | 22 #include "platform/fonts/shaping/CachingWordShapeIterator.h" |
| 23 #include "wtf/text/CharacterNames.h" | 23 #include "wtf/text/CharacterNames.h" |
| 24 | 24 |
| 25 namespace blink { | 25 namespace blink { |
| 26 | 26 |
| 27 NGInlineNode::NGInlineNode(LayoutObject* start_inline, | 27 NGInlineNode::NGInlineNode(LayoutObject* start_inline, |
| 28 ComputedStyle* block_style) | 28 ComputedStyle* block_style) |
| 29 : NGLayoutInputNode(NGLayoutInputNodeType::LegacyInline), | 29 : NGLayoutInputNode(NGLayoutInputNodeType::kLegacyInline), |
| 30 start_inline_(start_inline), | 30 start_inline_(start_inline), |
| 31 last_inline_(nullptr), | 31 last_inline_(nullptr), |
| 32 block_style_(block_style) { | 32 block_style_(block_style) { |
| 33 DCHECK(start_inline); | 33 DCHECK(start_inline); |
| 34 PrepareLayout(); // TODO(layout-dev): Shouldn't be called here. | 34 PrepareLayout(); // TODO(layout-dev): Shouldn't be called here. |
| 35 } | 35 } |
| 36 | 36 |
| 37 NGInlineNode::NGInlineNode() | 37 NGInlineNode::NGInlineNode() |
| 38 : NGLayoutInputNode(NGLayoutInputNodeType::LegacyInline), | 38 : NGLayoutInputNode(NGLayoutInputNodeType::kLegacyInline), |
| 39 start_inline_(nullptr), | 39 start_inline_(nullptr), |
| 40 last_inline_(nullptr), | 40 last_inline_(nullptr), |
| 41 block_style_(nullptr) {} | 41 block_style_(nullptr) {} |
| 42 | 42 |
| 43 NGInlineNode::~NGInlineNode() {} | 43 NGInlineNode::~NGInlineNode() {} |
| 44 | 44 |
| 45 void NGInlineNode::PrepareLayout() { | 45 void NGInlineNode::PrepareLayout() { |
| 46 // Scan list of siblings collecting all in-flow non-atomic inlines. A single | 46 // Scan list of siblings collecting all in-flow non-atomic inlines. A single |
| 47 // NGInlineNode represent a collection of adjacent non-atomic inlines. | 47 // NGInlineNode represent a collection of adjacent non-atomic inlines. |
| 48 last_inline_ = start_inline_; | 48 last_inline_ = start_inline_; |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 return next_sibling_; | 243 return next_sibling_; |
| 244 } | 244 } |
| 245 | 245 |
| 246 DEFINE_TRACE(NGInlineNode) { | 246 DEFINE_TRACE(NGInlineNode) { |
| 247 visitor->trace(next_sibling_); | 247 visitor->trace(next_sibling_); |
| 248 visitor->trace(layout_algorithm_); | 248 visitor->trace(layout_algorithm_); |
| 249 NGLayoutInputNode::trace(visitor); | 249 NGLayoutInputNode::trace(visitor); |
| 250 } | 250 } |
| 251 | 251 |
| 252 } // namespace blink | 252 } // namespace blink |
| OLD | NEW |