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

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

Issue 2693193002: [LayoutNG] A different approach to multi-col. (Closed)
Patch Set: a rebase for myself. 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 b39ecf3700257db6e92fed0aa79b7cf172ef929c..be4d0d51d2ca0a7a2d356e7cc93885bc41b7b5dc 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
@@ -18,6 +18,7 @@
#include "core/layout/ng/ng_layout_result.h"
#include "core/layout/ng/ng_length_utils.h"
#include "core/layout/ng/ng_min_max_content_size.h"
+#include "core/layout/ng/ng_multi_column_layout_algorithm.h"
#include "core/layout/ng/ng_writing_mode.h"
#include "core/paint/PaintLayer.h"
#include "platform/RuntimeEnabledFeatures.h"
@@ -89,10 +90,17 @@ RefPtr<NGLayoutResult> NGBlockNode::Layout(NGConstraintSpace* constraint_space,
return RunOldLayout(*constraint_space);
}
- RefPtr<NGLayoutResult> layout_result =
- NGBlockLayoutAlgorithm(this, constraint_space,
- toNGBlockBreakToken(break_token))
- .Layout();
+ RefPtr<NGLayoutResult> layout_result;
+ if (Style().specifiesColumns()) {
+ layout_result =
+ NGMultiColumnLayoutAlgorithm(this, constraint_space,
+ toNGBlockBreakToken(break_token))
+ .Layout();
+ } else {
+ layout_result = NGBlockLayoutAlgorithm(this, constraint_space,
+ toNGBlockBreakToken(break_token))
+ .Layout();
+ }
CopyFragmentDataToLayoutBox(*constraint_space, layout_result.get());
return layout_result;

Powered by Google App Engine
This is Rietveld 408576698