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_layout_input_node.h" | 5 #include "core/layout/ng/ng_layout_input_node.h" |
6 | 6 |
7 #include "core/layout/ng/ng_block_layout_algorithm.h" | 7 #include "core/layout/ng/ng_block_layout_algorithm.h" |
8 #include "core/layout/ng/ng_block_node.h" | 8 #include "core/layout/ng/ng_block_node.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_inline_node.h" | 10 #include "core/layout/ng/ng_inline_node.h" |
11 #include "core/layout/ng/ng_inline_layout_algorithm.h" | 11 #include "core/layout/ng/ng_inline_layout_algorithm.h" |
12 #include "core/layout/ng/ng_layout_algorithm.h" | 12 #include "core/layout/ng/ng_layout_algorithm.h" |
13 #include "core/style/ComputedStyle.h" | 13 #include "core/style/ComputedStyle.h" |
14 | 14 |
15 namespace blink { | 15 namespace blink { |
16 | 16 |
17 NGLayoutAlgorithm* NGLayoutInputNode::AlgorithmForInputNode( | 17 NGLayoutAlgorithm* NGLayoutInputNode::AlgorithmForInputNode( |
18 NGLayoutInputNode* input_node, | 18 NGLayoutInputNode* input_node, |
19 const NGConstraintSpace* constraint_space) { | 19 const NGConstraintSpace* constraint_space) { |
20 // At least for now, this should never be called on LegacyInline | 20 // At least for now, this should never be called on LegacyInline |
21 // children. However, there will be other kinds of input_node so | 21 // children. However, there will be other kinds of input_node so |
22 // it makes sense to do this here. | 22 // it makes sense to do this here. |
23 DCHECK(input_node->Type() == LegacyBlock); | 23 DCHECK(input_node->Type() == kLegacyBlock); |
24 NGBlockNode* block = toNGBlockNode(input_node); | 24 NGBlockNode* block = toNGBlockNode(input_node); |
25 | 25 |
26 if (block->HasInlineChildren()) | 26 if (block->HasInlineChildren()) |
27 return new NGInlineLayoutAlgorithm( | 27 return new NGInlineLayoutAlgorithm( |
28 block->Style(), toNGInlineNode(block->FirstChild()), | 28 block->Style(), toNGInlineNode(block->FirstChild()), |
29 constraint_space->ChildSpace(block->Style())); | 29 constraint_space->ChildSpace(block->Style())); |
30 return new NGBlockLayoutAlgorithm( | 30 return new NGBlockLayoutAlgorithm( |
31 block->Style(), toNGBlockNode(block->FirstChild()), | 31 block->Style(), toNGBlockNode(block->FirstChild()), |
32 constraint_space->ChildSpace(block->Style())); | 32 constraint_space->ChildSpace(block->Style())); |
33 } | 33 } |
34 } | 34 } |
OLD | NEW |