Bug 1575106 Part 2 - Rename blockReflowInput to childReflowInput in nsBlockFrame::ReflowBlockFrame(). r=dbaron

Every time I read the code, the name `blockReflowInput` makes me think
the variable is an instance of `BlockReflowInput`, but it is not.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Ting-Yu Lin 2019-08-26 06:10:21 +00:00
parent def57daecd
commit ffad323296

View File

@ -3538,7 +3538,7 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
}
// Construct the reflow input for the block.
Maybe<ReflowInput> blockReflowInput;
Maybe<ReflowInput> childReflowInput;
Maybe<LogicalSize> cbSize;
LogicalSize availSize = availSpace.Size(wm);
if (Style()->GetPseudoType() == PseudoStyleType::columnContent) {
@ -3599,15 +3599,15 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
}
}
blockReflowInput.emplace(aState.mPresContext, aState.mReflowInput, frame,
childReflowInput.emplace(aState.mPresContext, aState.mReflowInput, frame,
availSize.ConvertTo(frame->GetWritingMode(), wm),
cbSize);
if (aLine->MovedFragments()) {
// We only need to set this the first reflow, since if we reflow
// again (and replace blockReflowInput) we'll be reflowing it
// again (and replace childReflowInput) we'll be reflowing it
// again in the same fragment as the previous time.
blockReflowInput->mFlags.mMovedBlockFragments = true;
childReflowInput->mFlags.mMovedBlockFragments = true;
}
nsFloatManager::SavedState floatManagerState;
@ -3633,16 +3633,16 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
}
if (mayNeedRetry) {
blockReflowInput->mDiscoveredClearance = &clearanceFrame;
childReflowInput->mDiscoveredClearance = &clearanceFrame;
} else if (!applyBStartMargin) {
blockReflowInput->mDiscoveredClearance =
childReflowInput->mDiscoveredClearance =
aState.mReflowInput.mDiscoveredClearance;
}
frameReflowStatus.Reset();
brc.ReflowBlock(availSpace, applyBStartMargin, aState.mPrevBEndMargin,
clearance, aState.IsAdjacentWithTop(), aLine.get(),
*blockReflowInput, frameReflowStatus, aState);
*childReflowInput, frameReflowStatus, aState);
// Now the block has a height. Using that height, get the
// available space again and call ComputeBlockAvailSpace again.
@ -3727,8 +3727,8 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
clearance = 0;
}
blockReflowInput.reset();
blockReflowInput.emplace(
childReflowInput.reset();
childReflowInput.emplace(
aState.mPresContext, aState.mReflowInput, frame,
availSpace.Size(wm).ConvertTo(frame->GetWritingMode(), wm));
} while (true);
@ -3742,7 +3742,7 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
aState.mPrevChild = frame;
if (blockReflowInput->WillReflowAgainForClearance()) {
if (childReflowInput->WillReflowAgainForClearance()) {
// If an ancestor of ours is going to reflow for clearance, we
// need to avoid calling PlaceBlock, because it unsets dirty bits
// on the child block (both itself, and through its call to
@ -3780,7 +3780,7 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
nsCollapsingMargin collapsedBEndMargin;
nsOverflowAreas overflowAreas;
*aKeepReflowGoing =
brc.PlaceBlock(*blockReflowInput, forceFit, aLine.get(),
brc.PlaceBlock(*childReflowInput, forceFit, aLine.get(),
collapsedBEndMargin, overflowAreas, frameReflowStatus);
if (!frameReflowStatus.IsFullyComplete() &&
ShouldAvoidBreakInside(aState.mReflowInput)) {