Closed Bug 1784208 Opened 1 year ago Closed 1 year ago

Remove ColumnBalanceData::mHasExcessBSize


(Core :: Layout: Columns, task)




105 Branch
Tracking Status
firefox105 --- fixed


(Reporter: TYLin, Assigned: TYLin)



(3 files)

This flag is used when the top-level multicol container frame is nsColumnSet. But nowadays (after implementing column-span), the top-lovel multicol container is ColumnSetWrapperFrame.

See the upcoming patches for details.

Remove the flag because it doesn't serve its purpose for current multicolumn
frame hierarchy (i.e. after we introduce ColumnSetWrapperFrame). Nowadays, we
limit the column's block-size with the column container's block-size and
max-block-size in [1]. If the column container has content which exceeds its
max-block-size, we are going to give up column balancing and reach [2] after the
first iteration in the column balancing while loop in FindBestBalanceBSize().

However, the flag can still be set in cases with absurd nscoord values, so
this patch still changes the behavior. For example, in crashtests with bogus
sizes such as 673770.html,

contentBEnd > aReflowInput.mCBReflowInput->ComputedMaxBSize() && aConfig.mIsBalancing

can still be true when contentBEnd is greater than nscoord_MAX. In such
cases, we might spend extra iterations in column balancing. Other than that, our
rendering shouldn't have perceived behavior change.


With part 1, ReflowChildren and ReflowColumns are identical except for the
constness of the ReflowConfig. I choose to remove ReflowChildren because
ReflowColumns is more meaningful and keeping it requires less change to the
existing code.

Depends on D154427

According to our code coverage, this if is not reachable via any tests on our

After part 1 & 2, ReflowColumns can no longer change
ReflowConfig::mIsBalancing from true to false since the ReflowConfig
argument is now a const. Thus, mIsBalancing can never be false in the column
balancing loop.

Depends on D154428

Attachment #9289511 - Attachment description: Bug 1784208 Part 3 - Remove an unreachable `if` branch in FindBestBalanceBSize(). → Bug 1784208 Part 3 - Remove checking mIsBalancing in FindBestBalanceBSize().
Pushed by
Part 1 - Remove ColumnBalanceData::mHasExcessBSize flag. r=emilio
Part 2 - Remove nsColumnSetFrame::ReflowChildren. r=emilio
Part 3 - Remove checking mIsBalancing in FindBestBalanceBSize(). r=emilio
You need to log in before you can comment on or make changes to this bug.