Bug 1288992 Part 1 - Rename mSize and ReflowMetrics() in nsMathMLContainerFrame::RowChildFrameIterator. draft
authorTing-Yu Lin <tlin@mozilla.com>
Tue, 26 Jul 2016 15:39:03 +0800
changeset 393171 ca729a8a4c61fe19fd0a0de62a0f22c676af5cdf
parent 393170 98087ced0bea2f955c674d6fc2f74a093bd1541a
child 393172 17289657aed70447366326f7500e73d9f75045c8
push id24239
push userbmo:tlin@mozilla.com
push dateWed, 27 Jul 2016 05:48:34 +0000
bugs1288992
milestone50.0a1
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
layout/mathml/nsMathMLContainerFrame.cpp
--- 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 {