Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(242)

Unified Diff: third_party/WebKit/Source/core/layout/ng/ng_layout_input_node.cc

Issue 2519263002: [layout-ng] Convert ng_block_layout_algorithm to yield to the coordinator (Closed)
Patch Set: sync to head Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
}
}

Powered by Google App Engine
This is Rietveld 408576698