зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1288992 Part 3 - Rename local variables named metrics to reflowOutput. r=dholbert
This patch is edited manually. MozReview-Commit-ID: 1IsLGrgmDIY --HG-- extra : rebase_source : 52ad416a2ae56f312976cef6f30a45f03d77c4d1
This commit is contained in:
Родитель
73c4dfa06c
Коммит
4f426feb17
|
@ -1235,7 +1235,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||
mLines.front() != mLines.back() &&
|
||||
mLines.begin().next()->IsBlock()))) {
|
||||
// Reflow the bullet
|
||||
ReflowOutput metrics(aReflowInput);
|
||||
ReflowOutput reflowOutput(aReflowInput);
|
||||
// XXX Use the entire line when we fix bug 25888.
|
||||
nsLayoutUtils::LinePosition position;
|
||||
WritingMode wm = aReflowInput.GetWritingMode();
|
||||
|
@ -1245,8 +1245,8 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||
position.mBStart :
|
||||
reflowInput->ComputedLogicalBorderPadding().BStart(wm);
|
||||
nsIFrame* bullet = GetOutsideBullet();
|
||||
ReflowBullet(bullet, state, metrics, lineBStart);
|
||||
NS_ASSERTION(!BulletIsEmpty() || metrics.BSize(wm) == 0,
|
||||
ReflowBullet(bullet, state, reflowOutput, lineBStart);
|
||||
NS_ASSERTION(!BulletIsEmpty() || reflowOutput.BSize(wm) == 0,
|
||||
"empty bullet took up space");
|
||||
|
||||
if (havePosition && !BulletIsEmpty()) {
|
||||
|
@ -1256,9 +1256,9 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
|||
// bullets that are placed next to a child block (bug 92896)
|
||||
|
||||
// Tall bullets won't look particularly nice here...
|
||||
LogicalRect bbox = bullet->GetLogicalRect(wm, metrics.PhysicalSize());
|
||||
bbox.BStart(wm) = position.mBaseline - metrics.BlockStartAscent();
|
||||
bullet->SetRect(wm, bbox, metrics.PhysicalSize());
|
||||
LogicalRect bbox = bullet->GetLogicalRect(wm, reflowOutput.PhysicalSize());
|
||||
bbox.BStart(wm) = position.mBaseline - reflowOutput.BlockStartAscent();
|
||||
bullet->SetRect(wm, bbox, reflowOutput.PhysicalSize());
|
||||
}
|
||||
// Otherwise just leave the bullet where it is, up against our
|
||||
// block-start padding.
|
||||
|
|
|
@ -675,12 +675,12 @@ nsBulletFrame::Reflow(nsPresContext* aPresContext,
|
|||
nsBulletFrame::GetMinISize(nsRenderingContext *aRenderingContext)
|
||||
{
|
||||
WritingMode wm = GetWritingMode();
|
||||
ReflowOutput metrics(wm);
|
||||
DISPLAY_MIN_WIDTH(this, metrics.ISize(wm));
|
||||
ReflowOutput reflowOutput(wm);
|
||||
DISPLAY_MIN_WIDTH(this, reflowOutput.ISize(wm));
|
||||
LogicalMargin padding(wm);
|
||||
GetDesiredSize(PresContext(), aRenderingContext, metrics, 1.0f, &padding);
|
||||
metrics.ISize(wm) += padding.IStartEnd(wm);
|
||||
return metrics.ISize(wm);
|
||||
GetDesiredSize(PresContext(), aRenderingContext, reflowOutput, 1.0f, &padding);
|
||||
reflowOutput.ISize(wm) += padding.IStartEnd(wm);
|
||||
return reflowOutput.ISize(wm);
|
||||
}
|
||||
|
||||
/* virtual */ nscoord
|
||||
|
|
|
@ -692,19 +692,19 @@ nsHTMLFramesetFrame::ReflowPlaceChild(nsIFrame* aChild,
|
|||
LogicalSize(aChild->GetWritingMode(), aSize));
|
||||
reflowInput.SetComputedWidth(std::max(0, aSize.width - reflowInput.ComputedPhysicalBorderPadding().LeftRight()));
|
||||
reflowInput.SetComputedHeight(std::max(0, aSize.height - reflowInput.ComputedPhysicalBorderPadding().TopBottom()));
|
||||
ReflowOutput metrics(aReflowInput);
|
||||
metrics.Width() = aSize.width;
|
||||
metrics.Height() = aSize.height;
|
||||
ReflowOutput reflowOutput(aReflowInput);
|
||||
reflowOutput.Width() = aSize.width;
|
||||
reflowOutput.Height() = aSize.height;
|
||||
nsReflowStatus status;
|
||||
|
||||
ReflowChild(aChild, aPresContext, metrics, reflowInput, aOffset.x,
|
||||
ReflowChild(aChild, aPresContext, reflowOutput, reflowInput, aOffset.x,
|
||||
aOffset.y, 0, status);
|
||||
NS_ASSERTION(NS_FRAME_IS_COMPLETE(status), "bad status");
|
||||
|
||||
// Place and size the child
|
||||
metrics.Width() = aSize.width;
|
||||
metrics.Height() = aSize.height;
|
||||
FinishReflowChild(aChild, aPresContext, metrics, nullptr, aOffset.x, aOffset.y, 0);
|
||||
reflowOutput.Width() = aSize.width;
|
||||
reflowOutput.Height() = aSize.height;
|
||||
FinishReflowChild(aChild, aPresContext, reflowOutput, nullptr, aOffset.x, aOffset.y, 0);
|
||||
}
|
||||
|
||||
static
|
||||
|
|
|
@ -924,10 +924,10 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
// going to end up moving it when we do the block-direction alignment.
|
||||
|
||||
// Adjust spacemanager coordinate system for the frame.
|
||||
ReflowOutput metrics(lineWM);
|
||||
ReflowOutput reflowOutput(lineWM);
|
||||
#ifdef DEBUG
|
||||
metrics.ISize(lineWM) = nscoord(0xdeadbeef);
|
||||
metrics.BSize(lineWM) = nscoord(0xdeadbeef);
|
||||
reflowOutput.ISize(lineWM) = nscoord(0xdeadbeef);
|
||||
reflowOutput.BSize(lineWM) = nscoord(0xdeadbeef);
|
||||
#endif
|
||||
nscoord tI = pfd->mBounds.LineLeft(lineWM, ContainerSize());
|
||||
nscoord tB = pfd->mBounds.BStart(lineWM);
|
||||
|
@ -940,12 +940,12 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
&savedOptionalBreakPriority);
|
||||
|
||||
if (!isText) {
|
||||
aFrame->Reflow(mPresContext, metrics, *reflowInputHolder, aReflowStatus);
|
||||
aFrame->Reflow(mPresContext, reflowOutput, *reflowInputHolder, aReflowStatus);
|
||||
} else {
|
||||
static_cast<nsTextFrame*>(aFrame)->
|
||||
ReflowText(*this, availableSpaceOnLine,
|
||||
psd->mReflowInput->mRenderingContext->GetDrawTarget(),
|
||||
metrics, aReflowStatus);
|
||||
reflowOutput, aReflowStatus);
|
||||
}
|
||||
|
||||
pfd->mJustificationInfo = mJustificationInfo;
|
||||
|
@ -1020,31 +1020,31 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
|
||||
mFloatManager->Translate(-tI, -tB);
|
||||
|
||||
NS_ASSERTION(metrics.ISize(lineWM) >= 0, "bad inline size");
|
||||
NS_ASSERTION(metrics.BSize(lineWM) >= 0,"bad block size");
|
||||
if (metrics.ISize(lineWM) < 0) {
|
||||
metrics.ISize(lineWM) = 0;
|
||||
NS_ASSERTION(reflowOutput.ISize(lineWM) >= 0, "bad inline size");
|
||||
NS_ASSERTION(reflowOutput.BSize(lineWM) >= 0,"bad block size");
|
||||
if (reflowOutput.ISize(lineWM) < 0) {
|
||||
reflowOutput.ISize(lineWM) = 0;
|
||||
}
|
||||
if (metrics.BSize(lineWM) < 0) {
|
||||
metrics.BSize(lineWM) = 0;
|
||||
if (reflowOutput.BSize(lineWM) < 0) {
|
||||
reflowOutput.BSize(lineWM) = 0;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
// Note: break-before means ignore the reflow metrics since the
|
||||
// frame will be reflowed another time.
|
||||
if (!NS_INLINE_IS_BREAK_BEFORE(aReflowStatus)) {
|
||||
if ((CRAZY_SIZE(metrics.ISize(lineWM)) ||
|
||||
CRAZY_SIZE(metrics.BSize(lineWM))) &&
|
||||
if ((CRAZY_SIZE(reflowOutput.ISize(lineWM)) ||
|
||||
CRAZY_SIZE(reflowOutput.BSize(lineWM))) &&
|
||||
!LineContainerFrame()->GetParent()->IsCrazySizeAssertSuppressed()) {
|
||||
printf("nsLineLayout: ");
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(" metrics=%d,%d!\n", metrics.Width(), metrics.Height());
|
||||
printf(" metrics=%d,%d!\n", reflowOutput.Width(), reflowOutput.Height());
|
||||
}
|
||||
if ((metrics.Width() == nscoord(0xdeadbeef)) ||
|
||||
(metrics.Height() == nscoord(0xdeadbeef))) {
|
||||
if ((reflowOutput.Width() == nscoord(0xdeadbeef)) ||
|
||||
(reflowOutput.Height() == nscoord(0xdeadbeef))) {
|
||||
printf("nsLineLayout: ");
|
||||
nsFrame::ListTag(stdout, aFrame);
|
||||
printf(" didn't set w/h %d,%d!\n", metrics.Width(), metrics.Height());
|
||||
printf(" didn't set w/h %d,%d!\n", reflowOutput.Width(), reflowOutput.Height());
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -1054,10 +1054,10 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
// descendants' bounds. Nor does it include the outline area; it's
|
||||
// just the union of the bounds of any absolute children. That is
|
||||
// added in later by nsLineLayout::ReflowInlineFrames.
|
||||
pfd->mOverflowAreas = metrics.mOverflowAreas;
|
||||
pfd->mOverflowAreas = reflowOutput.mOverflowAreas;
|
||||
|
||||
pfd->mBounds.ISize(lineWM) = metrics.ISize(lineWM);
|
||||
pfd->mBounds.BSize(lineWM) = metrics.BSize(lineWM);
|
||||
pfd->mBounds.ISize(lineWM) = reflowOutput.ISize(lineWM);
|
||||
pfd->mBounds.BSize(lineWM) = reflowOutput.BSize(lineWM);
|
||||
|
||||
// Size the frame, but |RelativePositionFrames| will size the view.
|
||||
aFrame->SetRect(lineWM, pfd->mBounds, ContainerSizeForSpan(psd));
|
||||
|
@ -1068,7 +1068,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
nsDidReflowStatus::FINISHED);
|
||||
|
||||
if (aMetrics) {
|
||||
*aMetrics = metrics;
|
||||
*aMetrics = reflowOutput;
|
||||
}
|
||||
|
||||
if (!NS_INLINE_IS_BREAK_BEFORE(aReflowStatus)) {
|
||||
|
@ -1104,7 +1104,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
"How'd we get a floated inline frame? "
|
||||
"The frame ctor should've dealt with this.");
|
||||
if (CanPlaceFrame(pfd, notSafeToBreak, continuingTextRun,
|
||||
savedOptionalBreakFrame != nullptr, metrics,
|
||||
savedOptionalBreakFrame != nullptr, reflowOutput,
|
||||
aReflowStatus, &optionalBreakAfterFits)) {
|
||||
if (!isEmpty) {
|
||||
psd->mHasNonemptyContent = true;
|
||||
|
@ -1122,7 +1122,7 @@ nsLineLayout::ReflowFrame(nsIFrame* aFrame,
|
|||
// Place the frame, updating aBounds with the final size and
|
||||
// location. Then apply the bottom+right margins (as
|
||||
// appropriate) to the frame.
|
||||
PlaceFrame(pfd, metrics);
|
||||
PlaceFrame(pfd, reflowOutput);
|
||||
PerSpanData* span = pfd->mSpan;
|
||||
if (span) {
|
||||
// The frame we just finished reflowing is an inline
|
||||
|
|
|
@ -132,9 +132,9 @@ nsMathMLContainerFrame::SaveReflowAndBoundingMetricsFor(nsIFrame*
|
|||
const ReflowOutput& aReflowOutput,
|
||||
const nsBoundingMetrics& aBoundingMetrics)
|
||||
{
|
||||
ReflowOutput *metrics = new ReflowOutput(aReflowOutput);
|
||||
metrics->mBoundingMetrics = aBoundingMetrics;
|
||||
aFrame->Properties().Set(HTMLReflowOutputProperty(), metrics);
|
||||
ReflowOutput* reflowOutput = new ReflowOutput(aReflowOutput);
|
||||
reflowOutput->mBoundingMetrics = aBoundingMetrics;
|
||||
aFrame->Properties().Set(HTMLReflowOutputProperty(), reflowOutput);
|
||||
}
|
||||
|
||||
// helper method to facilitate getting the reflow and bounding metrics
|
||||
|
@ -146,16 +146,16 @@ nsMathMLContainerFrame::GetReflowAndBoundingMetricsFor(nsIFrame* aFra
|
|||
{
|
||||
NS_PRECONDITION(aFrame, "null arg");
|
||||
|
||||
ReflowOutput* metrics =
|
||||
ReflowOutput* reflowOutput =
|
||||
aFrame->Properties().Get(HTMLReflowOutputProperty());
|
||||
|
||||
// IMPORTANT: This function is only meant to be called in Place() methods
|
||||
// where it is assumed that SaveReflowAndBoundingMetricsFor has recorded the
|
||||
// information.
|
||||
NS_ASSERTION(metrics, "Didn't SaveReflowAndBoundingMetricsFor frame!");
|
||||
if (metrics) {
|
||||
aReflowOutput = *metrics;
|
||||
aBoundingMetrics = metrics->mBoundingMetrics;
|
||||
NS_ASSERTION(reflowOutput, "Didn't SaveReflowAndBoundingMetricsFor frame!");
|
||||
if (reflowOutput) {
|
||||
aReflowOutput = *reflowOutput;
|
||||
aBoundingMetrics = reflowOutput->mBoundingMetrics;
|
||||
}
|
||||
|
||||
if (aMathMLFrameType) {
|
||||
|
@ -196,9 +196,9 @@ nsMathMLContainerFrame::GetPreferredStretchSize(DrawTarget* aDrawTarget
|
|||
}
|
||||
else if (aOptions & STRETCH_CONSIDER_EMBELLISHMENTS) {
|
||||
// compute our up-to-date size using Place()
|
||||
ReflowOutput metrics(GetWritingMode()); // ???
|
||||
Place(aDrawTarget, false, metrics);
|
||||
aPreferredStretchSize = metrics.mBoundingMetrics;
|
||||
ReflowOutput reflowOutput(GetWritingMode());
|
||||
Place(aDrawTarget, false, reflowOutput);
|
||||
aPreferredStretchSize = reflowOutput.mBoundingMetrics;
|
||||
}
|
||||
else {
|
||||
// compute a size that includes embellishments iff the container stretches
|
||||
|
|
Загрузка…
Ссылка в новой задаче