Index: third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.cc |
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.cc |
index 71273e9d8812b1c873050872c0045554fbebd6ec..6a0798da84b98e9f86163489d85895d2a2fc2576 100644 |
--- a/third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.cc |
+++ b/third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.cc |
@@ -10,6 +10,7 @@ |
#include "core/layout/ng/ng_inline_node.h" |
#include "core/layout/ng/ng_inline_layout_algorithm.h" |
#include "core/layout/ng/ng_layout_algorithm.h" |
+#include "core/layout/ng/ng_legacy_block_layout_algorithm.h" |
#include "core/style/ComputedStyle.h" |
namespace blink { |
@@ -23,12 +24,16 @@ NGLayoutAlgorithm* NGLayoutInputNode::AlgorithmForInputNode( |
DCHECK(input_node->Type() == kLegacyBlock); |
NGBlockNode* block = toNGBlockNode(input_node); |
- if (block->HasInlineChildren()) |
- return new NGInlineLayoutAlgorithm( |
- block->Style(), toNGInlineNode(block->FirstChild()), |
+ if (block->CanUseNewLayout()) { |
+ if (block->HasInlineChildren()) |
+ return new NGInlineLayoutAlgorithm( |
+ block->Style(), toNGInlineNode(block->FirstChild()), |
+ constraint_space->ChildSpace(block->Style())); |
+ return new NGBlockLayoutAlgorithm( |
+ block->Style(), toNGBlockNode(block->FirstChild()), |
constraint_space->ChildSpace(block->Style())); |
- return new NGBlockLayoutAlgorithm( |
- block->Style(), toNGBlockNode(block->FirstChild()), |
- constraint_space->ChildSpace(block->Style())); |
+ } |
+ |
+ return new NGLegacyBlockLayoutAlgorithm(block, constraint_space); |
} |
} |