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

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

Issue 2782603003: Add NGColumnLayoutAlgorithm skeleton implementation. (Closed)
Patch Set: update TestExpectations Created 3 years, 9 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
Index: third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
diff --git a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
index 709418b065560c2b3aa87bc89db0ad58620113c1..a22cbda1f39230492c9c7a24ee14995ec2a683d0 100644
--- a/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
+++ b/third_party/WebKit/Source/core/layout/ng/ng_block_node.cc
@@ -11,6 +11,7 @@
#include "core/layout/ng/ng_block_break_token.h"
#include "core/layout/ng/ng_block_layout_algorithm.h"
#include "core/layout/ng/ng_box_fragment.h"
+#include "core/layout/ng/ng_column_layout_algorithm.h"
#include "core/layout/ng/ng_constraint_space.h"
#include "core/layout/ng/ng_constraint_space_builder.h"
#include "core/layout/ng/ng_fragment_builder.h"
@@ -26,6 +27,18 @@ namespace blink {
namespace {
+RefPtr<NGLayoutResult> LayoutWithAlgorithm(const ComputedStyle& style,
+ NGBlockNode* node,
+ NGConstraintSpace* space,
+ NGBreakToken* break_token) {
+ if (style.specifiesColumns())
+ return NGColumnLayoutAlgorithm(node, space,
+ toNGBlockBreakToken(break_token))
+ .Layout();
+ return NGBlockLayoutAlgorithm(node, space, toNGBlockBreakToken(break_token))
+ .Layout();
+}
+
// Copies data back to the legacy layout tree for a given child fragment.
void FragmentPositionUpdated(const NGPhysicalFragment& fragment) {
LayoutBox* layout_box = toLayoutBox(fragment.GetLayoutObject());
@@ -91,9 +104,7 @@ RefPtr<NGLayoutResult> NGBlockNode::Layout(NGConstraintSpace* constraint_space,
}
RefPtr<NGLayoutResult> layout_result =
- NGBlockLayoutAlgorithm(this, constraint_space,
- toNGBlockBreakToken(break_token))
- .Layout();
+ LayoutWithAlgorithm(Style(), this, constraint_space, break_token);
CopyFragmentDataToLayoutBox(*constraint_space, layout_result.get());
return layout_result;

Powered by Google App Engine
This is Rietveld 408576698