Bug 1784208 Part 3 - Remove checking mIsBalancing in FindBestBalanceBSize(). r=emilio

According to our code coverage, the `if` statement is not reachable via any
tests on our CI.
https://coverage.moz.tools/#view=file&revision=7169b8faa7e112c9c4323753434324b93270fc3d&path=layout%2Fgeneric%2FnsColumnSetFrame.cpp&line=1129

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
FindBestBalanceBSize().

Differential Revision: https://phabricator.services.mozilla.com/D154429
This commit is contained in:
Ting-Yu Lin 2022-08-12 05:04:03 +00:00
Родитель 474a3b0b9e
Коммит 5cdc372fbb
1 изменённых файлов: 4 добавлений и 8 удалений

Просмотреть файл

@ -945,6 +945,9 @@ void nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowInput,
ReflowOutput& aDesiredSize,
bool aUnboundedLastColumn,
nsReflowStatus& aStatus) {
MOZ_ASSERT(aConfig.mIsBalancing,
"Why are we here if we are not balancing columns?");
const nscoord availableContentBSize = aReflowInput.AvailableBSize();
// Termination of the algorithm below is guaranteed because
@ -1097,16 +1100,9 @@ void nsColumnSetFrame::FindBestBalanceBSize(const ReflowInput& aReflowInput,
if (!foundFeasibleBSizeCloserToBest && aColData.mFeasible) {
foundFeasibleBSizeCloserToBest = true;
}
if (!aConfig.mIsBalancing) {
// Looks like we had excess block-size when balancing, so we gave up on
// trying to balance.
break;
}
}
if (aConfig.mIsBalancing && !aColData.mFeasible &&
!aPresContext->HasPendingInterrupt()) {
if (!aColData.mFeasible && !aPresContext->HasPendingInterrupt()) {
// We need to reflow one more time at the feasible block-size to
// get a valid layout.
if (aConfig.mKnownInfeasibleBSize >= availableContentBSize) {