Bug 1288992 Part 1 - Rename mSize and ReflowMetrics() in nsMathMLContainerFrame::RowChildFrameIterator.
Rename mSize and ReflowMetrics() to mReflowOutput and GetReflowOutput(),
respectively.
The convention for the method name would be ReflowOutput(), but it will conflict
class name ReflowOutput. So we use GetReflowOutput() here.
MozReview-Commit-ID: CHp6vw80IOh
--- a/layout/mathml/nsMathMLContainerFrame.cpp
+++ b/layout/mathml/nsMathMLContainerFrame.cpp
@@ -1165,17 +1165,17 @@ static nscoord GetThinSpace(const nsStyl
{
return NSToCoordRound(float(aStyleFont->mFont.size)*float(3) / float(18));
}
class nsMathMLContainerFrame::RowChildFrameIterator {
public:
explicit RowChildFrameIterator(nsMathMLContainerFrame* aParentFrame) :
mParentFrame(aParentFrame),
- mSize(aParentFrame->GetWritingMode()), // ???
+ mReflowOutput(aParentFrame->GetWritingMode()),
mX(0),
mCarrySpace(0),
mFromFrameType(eMathMLFrameType_UNKNOWN),
mRTL(aParentFrame->StyleVisibility()->mDirection)
{
if (!mRTL) {
mChildFrame = aParentFrame->mFrames.FirstChild();
} else {
@@ -1186,17 +1186,17 @@ public:
return;
InitMetricsForChild();
}
RowChildFrameIterator& operator++()
{
// add child size + italic correction
- mX += mSize.mBoundingMetrics.width + mItalicCorrection;
+ mX += mReflowOutput.mBoundingMetrics.width + mItalicCorrection;
if (!mRTL) {
mChildFrame = mChildFrame->GetNextSibling();
} else {
mChildFrame = mChildFrame->GetPrevSibling();
}
if (!mChildFrame)
@@ -1212,42 +1212,42 @@ public:
prevFrameType, mChildFrameType,
&mFromFrameType, &mCarrySpace);
mX += space * GetThinSpace(font);
return *this;
}
nsIFrame* Frame() const { return mChildFrame; }
nscoord X() const { return mX; }
- const ReflowOutput& ReflowMetrics() const { return mSize; }
- nscoord Ascent() const { return mSize.BlockStartAscent(); }
- nscoord Descent() const { return mSize.Height() - mSize.BlockStartAscent(); }
+ const ReflowOutput& GetReflowOutput() const { return mReflowOutput; }
+ nscoord Ascent() const { return mReflowOutput.BlockStartAscent(); }
+ nscoord Descent() const { return mReflowOutput.Height() - mReflowOutput.BlockStartAscent(); }
const nsBoundingMetrics& BoundingMetrics() const {
- return mSize.mBoundingMetrics;
+ return mReflowOutput.mBoundingMetrics;
}
private:
const nsMathMLContainerFrame* mParentFrame;
nsIFrame* mChildFrame;
- ReflowOutput mSize;
+ ReflowOutput mReflowOutput;
nscoord mX;
nscoord mItalicCorrection;
eMathMLFrameType mChildFrameType;
int32_t mCarrySpace;
eMathMLFrameType mFromFrameType;
bool mRTL;
void InitMetricsForChild()
{
- GetReflowAndBoundingMetricsFor(mChildFrame, mSize, mSize.mBoundingMetrics,
+ GetReflowAndBoundingMetricsFor(mChildFrame, mReflowOutput, mReflowOutput.mBoundingMetrics,
&mChildFrameType);
nscoord leftCorrection, rightCorrection;
- GetItalicCorrection(mSize.mBoundingMetrics,
+ GetItalicCorrection(mReflowOutput.mBoundingMetrics,
leftCorrection, rightCorrection);
if (!mChildFrame->GetPrevSibling() &&
mParentFrame->GetContent()->IsMathMLElement(nsGkAtoms::msqrt_)) {
// Remove leading correction in <msqrt> because the sqrt glyph itself is
// there first.
if (!mRTL) {
leftCorrection = 0;
} else {
@@ -1308,17 +1308,17 @@ nsMathMLContainerFrame::Place(DrawTarget
void
nsMathMLContainerFrame::PositionRowChildFrames(nscoord aOffsetX,
nscoord aBaseline)
{
RowChildFrameIterator child(this);
while (child.Frame()) {
nscoord dx = aOffsetX + child.X();
nscoord dy = aBaseline - child.Ascent();
- FinishReflowChild(child.Frame(), PresContext(), child.ReflowMetrics(),
+ FinishReflowChild(child.Frame(), PresContext(), child.GetReflowOutput(),
nullptr, dx, dy, 0);
++child;
}
}
class ForceReflow : public nsIReflowCallback {
public:
virtual bool ReflowFinished() override {