Bug 1583639 Part 1 - De-indent an else-block inside the while-loop in nsColumnSetFrame::ReflowChild. r=dbaron

The associated if-block has a "break" statement at the end of the scope
to break the while-loop, making the else-block redundant.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2019-09-24 21:09:20 +00:00
Родитель 3802e22be1
Коммит eded32bd45
1 изменённых файлов: 44 добавлений и 46 удалений

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

@ -851,60 +851,58 @@ nsColumnSetFrame::ColumnBalanceData nsColumnSetFrame::ReflowChildren(
NS_ASSERTION(!kidNextInFlow, "next in flow should have been deleted"); NS_ASSERTION(!kidNextInFlow, "next in flow should have been deleted");
child = nullptr; child = nullptr;
break; break;
} else { }
// Make sure that the column has a next-in-flow. If not, we must
// create one to hold the overflowing stuff, even if we're just
// going to put it on our overflow list and let *our*
// next in flow handle it.
if (!kidNextInFlow) {
NS_ASSERTION(aStatus.NextInFlowNeedsReflow(),
"We have to create a continuation, but the block doesn't "
"want us to reflow it?");
// We need to create a continuing column // Make sure that the column has a next-in-flow. If not, we must
kidNextInFlow = CreateNextInFlow(child); // create one to hold the overflowing stuff, even if we're just
} // going to put it on our overflow list and let *our*
// next in flow handle it.
if (!kidNextInFlow) {
NS_ASSERTION(aStatus.NextInFlowNeedsReflow(),
"We have to create a continuation, but the block doesn't "
"want us to reflow it?");
// Make sure we reflow a next-in-flow when it switches between being // We need to create a continuing column
// normal or overflow container kidNextInFlow = CreateNextInFlow(child);
if (aStatus.IsOverflowIncomplete()) { }
if (!(kidNextInFlow->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) {
aStatus.SetNextInFlowNeedsReflow(); // Make sure we reflow a next-in-flow when it switches between being
reflowNext = true; // normal or overflow container
kidNextInFlow->AddStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER); if (aStatus.IsOverflowIncomplete()) {
} if (!(kidNextInFlow->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) {
} else if (kidNextInFlow->GetStateBits() &
NS_FRAME_IS_OVERFLOW_CONTAINER) {
aStatus.SetNextInFlowNeedsReflow(); aStatus.SetNextInFlowNeedsReflow();
reflowNext = true; reflowNext = true;
kidNextInFlow->RemoveStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER); kidNextInFlow->AddStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);
} }
} else if (kidNextInFlow->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER) {
aStatus.SetNextInFlowNeedsReflow();
reflowNext = true;
kidNextInFlow->RemoveStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER);
}
if ((contentBEnd > aReflowInput.ComputedMaxBSize() || if ((contentBEnd > aReflowInput.ComputedMaxBSize() ||
contentBEnd > aReflowInput.ComputedBSize() || contentBEnd > aReflowInput.ComputedBSize() ||
(StaticPrefs::layout_css_column_span_enabled() && (StaticPrefs::layout_css_column_span_enabled() &&
contentBEnd > aReflowInput.mCBReflowInput->ComputedMaxBSize())) && contentBEnd > aReflowInput.mCBReflowInput->ComputedMaxBSize())) &&
aConfig.mIsBalancing) { aConfig.mIsBalancing) {
// We overflowed vertically, but have not exceeded the number of // We overflowed vertically, but have not exceeded the number of
// columns. We're going to go into overflow columns now, so balancing // columns. We're going to go into overflow columns now, so balancing
// no longer applies. // no longer applies.
colData.mHasExcessBSize = true; colData.mHasExcessBSize = true;
} }
if (columnCount >= aConfig.mBalanceColCount - 1) { if (columnCount >= aConfig.mBalanceColCount - 1) {
// No more columns allowed here. Stop. // No more columns allowed here. Stop.
aStatus.SetNextInFlowNeedsReflow(); aStatus.SetNextInFlowNeedsReflow();
kidNextInFlow->MarkSubtreeDirty(); kidNextInFlow->MarkSubtreeDirty();
// Move any of our leftover columns to our overflow list. Our // Move any of our leftover columns to our overflow list. Our
// next-in-flow will eventually pick them up. // next-in-flow will eventually pick them up.
const nsFrameList& continuationColumns = const nsFrameList& continuationColumns = mFrames.RemoveFramesAfter(child);
mFrames.RemoveFramesAfter(child); if (continuationColumns.NotEmpty()) {
if (continuationColumns.NotEmpty()) { SetOverflowFrames(continuationColumns);
SetOverflowFrames(continuationColumns);
}
child = nullptr;
break;
} }
child = nullptr;
break;
} }
if (PresContext()->HasPendingInterrupt()) { if (PresContext()->HasPendingInterrupt()) {