Bug 1777627 Part 2 - Remove aIsAdjacentWithBStart argument on nsBlockReflowContext::ReflowBlock(). r=emilio

aIsAdjacentWithBStart is used to clear the mIsTopOfPage bit for the ReflowInput
argument `aFrameRI`. However, ReflowBlock() already has aState argument to query
IsAdjacentWithBStart(), so there's no need for aIsAdjacentWithBStart argument.

Differential Revision: https://phabricator.services.mozilla.com/D150832
This commit is contained in:
Ting-Yu Lin 2022-07-05 23:43:52 +00:00
Родитель 6e0a1ac033
Коммит 8197bd4fb0
3 изменённых файлов: 14 добавлений и 20 удалений

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

@ -3904,8 +3904,8 @@ void nsBlockFrame::ReflowBlockFrame(BlockReflowState& aState,
frameReflowStatus.Reset();
brc.ReflowBlock(availSpace, applyBStartMargin, aState.mPrevBEndMargin,
clearance, aState.IsAdjacentWithBStart(), aLine.get(),
*childReflowInput, frameReflowStatus, aState);
clearance, aLine.get(), *childReflowInput,
frameReflowStatus, aState);
if (frameReflowStatus.IsInlineBreakBefore()) {
// No need to retry this loop if there is a break opportunity before the
@ -6674,10 +6674,6 @@ void nsBlockFrame::ReflowFloat(BlockReflowState& aState,
// input. However, when reflowing a float, if we've placed other
// floats that force this float *down* or *narrower*, we should unset
// the mIsTopOfPage state.
// FIXME: This is somewhat redundant with the |isAdjacentWithTop|
// variable below, which has the exact same effect. Perhaps it should
// be merged into that, except that the test for narrowing here is not
// about adjacency with the top, so it seems misleading.
if (floatRS.mFlags.mIsTopOfPage &&
(aFloatPushedDown ||
aAdjustedAvailableSpace.ISize(wm) != aState.ContentISize())) {
@ -6687,9 +6683,6 @@ void nsBlockFrame::ReflowFloat(BlockReflowState& aState,
// Setup a block reflow context to reflow the float.
nsBlockReflowContext brc(aState.mPresContext, aState.mReflowInput);
// Reflow the float
bool isAdjacentWithTop = aState.IsAdjacentWithBStart();
nsIFrame* clearanceFrame = nullptr;
do {
nsCollapsingMargin margin;
@ -6707,8 +6700,8 @@ void nsBlockFrame::ReflowFloat(BlockReflowState& aState,
}
}
brc.ReflowBlock(aAdjustedAvailableSpace, true, margin, 0, isAdjacentWithTop,
nullptr, floatRS, aReflowStatus, aState);
brc.ReflowBlock(aAdjustedAvailableSpace, true, margin, 0, nullptr, floatRS,
aReflowStatus, aState);
} while (clearanceFrame);
if (aFloat->IsLetterFrame()) {

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

@ -209,17 +209,19 @@ done:
return dirtiedLine;
}
void nsBlockReflowContext::ReflowBlock(
const LogicalRect& aSpace, bool aApplyBStartMargin,
nsCollapsingMargin& aPrevMargin, nscoord aClearance,
bool aIsAdjacentWithBStart, nsLineBox* aLine, ReflowInput& aFrameRI,
nsReflowStatus& aFrameReflowStatus, BlockReflowState& aState) {
void nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
bool aApplyBStartMargin,
nsCollapsingMargin& aPrevMargin,
nscoord aClearance, nsLineBox* aLine,
ReflowInput& aFrameRI,
nsReflowStatus& aFrameReflowStatus,
BlockReflowState& aState) {
mFrame = aFrameRI.mFrame;
mWritingMode = aState.mReflowInput.GetWritingMode();
mContainerSize = aState.ContainerSize();
mSpace = aSpace;
if (!aIsAdjacentWithBStart) {
if (!aState.IsAdjacentWithBStart()) {
aFrameRI.mFlags.mIsTopOfPage = false; // make sure this is cleared
}

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

@ -34,9 +34,8 @@ class nsBlockReflowContext {
void ReflowBlock(const mozilla::LogicalRect& aSpace, bool aApplyBStartMargin,
nsCollapsingMargin& aPrevMargin, nscoord aClearance,
bool aIsAdjacentWithBStart, nsLineBox* aLine,
ReflowInput& aReflowInput, nsReflowStatus& aReflowStatus,
BlockReflowState& aState);
nsLineBox* aLine, ReflowInput& aReflowInput,
nsReflowStatus& aReflowStatus, BlockReflowState& aState);
bool PlaceBlock(const ReflowInput& aReflowInput, bool aForceFit,
nsLineBox* aLine,