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

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

Issue 2631513002: [LayoutNG] Make NGLayoutInputNode::AlgorithmForInputNode() more readable. (Closed)
Patch Set: Created 3 years, 11 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 daa83de168526255a5fdbffc61fd3199c6a5d647..e3ae6c62163f493b3c3c3a0d4eb27a5db17d726c 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
@@ -23,16 +23,14 @@ NGLayoutAlgorithm* NGLayoutInputNode::AlgorithmForInputNode(
// it makes sense to do this here.
DCHECK(input_node->Type() == kLegacyBlock);
NGBlockNode* block = toNGBlockNode(input_node);
-
- if (block->CanUseNewLayout()) {
- if (block->HasInlineChildren())
- return new NGInlineLayoutAlgorithm(block->Style(),
- toNGInlineNode(block->FirstChild()),
- constraint_space);
- return new NGBlockLayoutAlgorithm(
- block->Style(), toNGBlockNode(block->FirstChild()), constraint_space);
+ if (!block->CanUseNewLayout())
+ return new NGLegacyBlockLayoutAlgorithm(block, constraint_space);
+ const ComputedStyle* style = block->Style();
+ if (block->HasInlineChildren()) {
+ NGInlineNode* child = toNGInlineNode(block->FirstChild());
+ return new NGInlineLayoutAlgorithm(style, child, constraint_space);
}
-
- return new NGLegacyBlockLayoutAlgorithm(block, constraint_space);
+ NGBlockNode* child = toNGBlockNode(block->FirstChild());
+ return new NGBlockLayoutAlgorithm(style, child, constraint_space);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698