Bug 1575054 - Disable column balancing for nested multicol containers of depth more than two. r=dbaron

That is, for the multicol container of depth two and more, we lay them
out by using "column-fill:auto" and "column-count:1".

I've check bug 725376 comment 9 for the previous approaches. Thanks to
bug 1555818, this solution is feasible because the fragmentation with
"column-fill:auto" is now possible.

Differential Revision: https://phabricator.services.mozilla.com/D47011

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2019-09-24 21:38:00 +00:00
parent 660aac23aa
commit 1e019098f5

View File

@ -323,13 +323,14 @@ nsColumnSetFrame::ReflowConfig nsColumnSetFrame::ChooseColumnStrategy(
int32_t numColumns = colStyle->mColumnCount;
// If column-fill is set to 'balance', then we want to balance the columns.
const bool isBalancing =
bool isBalancing =
colStyle->mColumnFill == StyleColumnFill::Balance && !aForceAuto;
if (isBalancing) {
const uint32_t kMaxNestedColumnBalancingDepth = 2;
const uint32_t balancingDepth =
ColumnBalancingDepth(aReflowInput, kMaxNestedColumnBalancingDepth);
if (balancingDepth == kMaxNestedColumnBalancingDepth) {
isBalancing = false;
numColumns = 1;
}
}