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

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: Move stuff to UpdateLegacyMultiColumnFlowThread() 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp ('k') | 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_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..088d892106717c0c9b99d662aaa6d44649ad1406 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"
@@ -83,6 +85,32 @@ void FloatingObjectPositionedUpdated(NGFloatingObject* ng_floating_object,
}
}
+void UpdateLegacyMultiColumnFlowThread(LayoutBox* layout_box,
+ const NGPhysicalBoxFragment* fragment) {
+ LayoutBlockFlow* multicol = toLayoutBlockFlow(layout_box);
+ LayoutMultiColumnFlowThread* flow_thread = multicol->multiColumnFlowThread();
+ if (!flow_thread)
+ return;
+ if (LayoutMultiColumnSet* 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();
+}
+
} // namespace
NGBlockNode::NGBlockNode(LayoutObject* layout_object)
@@ -238,6 +266,8 @@ void NGBlockNode::CopyFragmentDataToLayoutBox(
NGPhysicalBoxFragment* fragment =
toNGPhysicalBoxFragment(layout_result->PhysicalFragment().get());
+ if (layout_box_->style()->specifiesColumns())
+ UpdateLegacyMultiColumnFlowThread(layout_box_, fragment);
layout_box_->setWidth(fragment->Width());
layout_box_->setHeight(fragment->Height());
NGBoxStrut border_and_padding = ComputeBorders(constraint_space, Style()) +
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698