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

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

Issue 2786923004: [LayoutNG] WIP on storing layout output in the legacy tree for multicol. (Closed)
Patch Set: Fake a flow thread portion height value. 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 a22cbda1f39230492c9c7a24ee14995ec2a683d0..cb26550411c84fc23a70b9d15de1d96191712d2d 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
@@ -5,6 +5,8 @@
#include "core/layout/ng/ng_block_node.h"
#include "core/layout/LayoutBlockFlow.h"
+#include "core/layout/LayoutMultiColumnFlowThread.h"
+#include "core/layout/LayoutMultiColumnSet.h"
#include "core/layout/api/LineLayoutAPIShim.h"
#include "core/layout/line/InlineIterator.h"
#include "core/layout/ng/layout_ng_block_flow.h"
@@ -238,6 +240,29 @@ void NGBlockNode::CopyFragmentDataToLayoutBox(
NGPhysicalBoxFragment* fragment =
toNGPhysicalBoxFragment(layout_result->PhysicalFragment().get());
+ if (layout_box_->style()->specifiesColumns()) {
+ LayoutBlockFlow* multicol = toLayoutBlockFlow(layout_box_);
Gleb Lanbin 2017/03/31 22:33:29 can you move this logic into a separate function d
mstensho (USE GERRIT) 2017/04/03 10:20:11 Done.
+ if (auto* flow_thread = multicol->multiColumnFlowThread()) {
+ if (auto* column_set = flow_thread->firstMultiColumnSet()) {
+ column_set->setWidth(fragment->Width());
+ column_set->setHeight(fragment->Height());
+
+ // TODO(mstensho): This value has next to nothing to do with the flow
+ // thread portion size, but at least it's usually better than zero.
+ column_set->endFlow(fragment->Height());
+
+ column_set->clearNeedsLayout();
+ }
+ // TODO(mstensho): Fix the relatively nonsensical values here (the
+ // content box size of the multicol container has very little to do with
+ // the price of eggs).
+ flow_thread->setWidth(fragment->Width());
+ flow_thread->setHeight(fragment->Height());
+
+ flow_thread->validateColumnSets();
+ flow_thread->clearNeedsLayout();
+ }
+ }
layout_box_->setWidth(fragment->Width());
layout_box_->setHeight(fragment->Height());
NGBoxStrut border_and_padding = ComputeBorders(constraint_space, Style()) +

Powered by Google App Engine
This is Rietveld 408576698