Bug 1463977 Part 2 - Call SetComputedBSizeWithoutResettingResizeFlags() in SetComputedBSize(). r=dholbert

This is a preparation for the next part.

Differential Revision: https://phabricator.services.mozilla.com/D155321
This commit is contained in:
Ting-Yu Lin
2022-08-23 05:11:59 +00:00
parent b839339482
commit a5194db566
2 changed files with 12 additions and 10 deletions

View File

@@ -305,13 +305,22 @@ void ReflowInput::SetComputedBSize(nscoord aComputedBSize) {
// (like a text control, for example), we'll end up creating a reflow
// input for the parent while the parent is reflowing.
MOZ_ASSERT(aComputedBSize >= 0, "Invalid computed block-size!");
if (ComputedBSize() != aComputedBSize) {
ComputedBSize() = aComputedBSize;
SetComputedBSizeWithoutResettingResizeFlags(aComputedBSize);
InitResizeFlags(mFrame->PresContext(), mFrame->Type());
}
}
void ReflowInput::SetComputedBSizeWithoutResettingResizeFlags(
nscoord aComputedBSize) {
// Viewport frames reset the computed block size on a copy of their reflow
// input when reflowing fixed-pos kids. In that case we actually don't
// want to mess with the resize flags, because comparing the frame's rect
// to the munged computed isize is pointless.
MOZ_ASSERT(aComputedBSize >= 0, "Invalid computed block-size!");
ComputedBSize() = aComputedBSize;
}
void ReflowInput::Init(nsPresContext* aPresContext,
const Maybe<LogicalSize>& aContainingBlockSize,
const Maybe<LogicalMargin>& aBorder,