Bug 1400421 part 2: Delete unused nsLeafFrame::Reflow override (and its DoReflow helper). r=mats

nsLeafFrame only exists as an abstract superclass, and every subclass actually
brings along its own Reflow impl, so nsLeafFrame's own impl is just dead code.

This patch makes sure it's really dead code by leaving in the Reflow() decl
with " = 0;" so the compiler will enforce that all concrete subclasses *do*
have a more specific override (and that they don't just inherit the stub
nsFrame impl from further up the ancestor chain, for example).

MozReview-Commit-ID: Co36IpuaeOc

--HG--
extra : rebase_source : 036caa3abaed0a1cf75e8674af4ae2e8b55b3b8c
This commit is contained in:
Daniel Holbert 2017-09-15 15:55:21 -07:00
Родитель 5190426fdb
Коммит b3a1c3da2b
2 изменённых файлов: 4 добавлений и 62 удалений

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

@ -48,53 +48,6 @@ nsLeafFrame::ComputeAutoSize(gfxContext* aRenderingContext,
return result.ConvertTo(aWM, wm);
}
void
nsLeafFrame::Reflow(nsPresContext* aPresContext,
ReflowOutput& aMetrics,
const ReflowInput& aReflowInput,
nsReflowStatus& aStatus)
{
MarkInReflow();
DO_GLOBAL_REFLOW_COUNT("nsLeafFrame");
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("enter nsLeafFrame::Reflow: aMaxSize=%d,%d",
aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight()));
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
DoReflow(aPresContext, aMetrics, aReflowInput, aStatus);
FinishAndStoreOverflow(&aMetrics, aReflowInput.mStyleDisplay);
}
void
nsLeafFrame::DoReflow(nsPresContext* aPresContext,
ReflowOutput& aMetrics,
const ReflowInput& aReflowInput,
nsReflowStatus& aStatus)
{
NS_ASSERTION(aReflowInput.ComputedWidth() != NS_UNCONSTRAINEDSIZE,
"Shouldn't have unconstrained stuff here "
"thanks to the rules of reflow");
NS_ASSERTION(NS_INTRINSICSIZE != aReflowInput.ComputedHeight(),
"Shouldn't have unconstrained stuff here "
"thanks to ComputeAutoSize");
// XXX how should border&padding effect baseline alignment?
// => descent = borderPadding.bottom for example
WritingMode wm = aReflowInput.GetWritingMode();
aMetrics.SetSize(wm, aReflowInput.ComputedSizeWithBorderPadding());
aStatus.Reset();
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
("exit nsLeafFrame::DoReflow: size=%d,%d",
aMetrics.ISize(wm), aMetrics.BSize(wm)));
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
aMetrics.SetOverflowAreasToDesiredBounds();
}
nscoord
nsLeafFrame::GetIntrinsicBSize()
{

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

@ -50,23 +50,12 @@ public:
ComputeSizeFlags aFlags) override;
/**
* Reflow our frame. This will use the computed width plus borderpadding for
* the desired width, and use the return value of GetIntrinsicBSize plus
* borderpadding for the desired height. Ascent will be set to the height,
* and descent will be set to 0.
* Each of our subclasses should provide its own Reflow impl:
*/
virtual void Reflow(nsPresContext* aPresContext,
ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput,
nsReflowStatus& aStatus) override;
/**
* This method does most of the work that Reflow() above need done.
*/
virtual void DoReflow(nsPresContext* aPresContext,
ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput,
nsReflowStatus& aStatus);
ReflowOutput& aDesiredSize,
const ReflowInput& aReflowInput,
nsReflowStatus& aStatus) override = 0;
virtual bool IsFrameOfType(uint32_t aFlags) const override
{