Bug 1157569 - Followup to address review nits (renamings, comment updates) from parts 13 and 14.
authorJonathan Kew <jkew@mozilla.com>
Sat, 27 Jun 2015 11:16:18 -0700
changeset 250409 8d7c0d471925a7449db469d949f58c9c0d852564
parent 250408 90f43905ea1260152612e2cc5923df11226daaa4
child 250410 89a655d703783fbbbeb26770f9fcf9ef1107f26f
push id61551
push userjkew@mozilla.com
push dateSat, 27 Jun 2015 18:17:08 +0000
treeherdermozilla-inbound@89a655d70378 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1157569
milestone41.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1157569 - Followup to address review nits (renamings, comment updates) from parts 13 and 14.
layout/tables/nsCellMap.cpp
layout/tables/nsCellMap.h
layout/tables/nsTableFrame.cpp
layout/tables/nsTableFrame.h
layout/tables/nsTablePainter.cpp
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -88,54 +88,54 @@ nsTableCellMap::~nsTableCellMap()
   nsCellMap* cellMap = mFirstMap;
   while (cellMap) {
     nsCellMap* next = cellMap->GetNextSibling();
     delete cellMap;
     cellMap = next;
   }
 
   if (mBCInfo) {
-    DeleteRightBottomBorders();
+    DeleteIEndBEndBorders();
     delete mBCInfo;
   }
 }
 
-// Get the bcData holding the border segments of the right edge of the table
+// Get the bcData holding the border segments of the iEnd edge of the table
 BCData*
-nsTableCellMap::GetRightMostBorder(int32_t aRowIndex)
+nsTableCellMap::GetIEndMostBorder(int32_t aRowIndex)
 {
   if (!mBCInfo) ABORT1(nullptr);
 
   int32_t numRows = mBCInfo->mIEndBorders.Length();
   if (aRowIndex < numRows) {
     return &mBCInfo->mIEndBorders.ElementAt(aRowIndex);
   }
 
   mBCInfo->mIEndBorders.SetLength(aRowIndex+1);
   return &mBCInfo->mIEndBorders.ElementAt(aRowIndex);
 }
 
-// Get the bcData holding the border segments of the bottom edge of the table
+// Get the bcData holding the border segments of the bEnd edge of the table
 BCData*
-nsTableCellMap::GetBottomMostBorder(int32_t aColIndex)
+nsTableCellMap::GetBEndMostBorder(int32_t aColIndex)
 {
   if (!mBCInfo) ABORT1(nullptr);
 
   int32_t numCols = mBCInfo->mBEndBorders.Length();
   if (aColIndex < numCols) {
     return &mBCInfo->mBEndBorders.ElementAt(aColIndex);
   }
 
   mBCInfo->mBEndBorders.SetLength(aColIndex+1);
   return &mBCInfo->mBEndBorders.ElementAt(aColIndex);
 }
 
-// delete the borders corresponding to the right and bottom edges of the table
+// delete the borders corresponding to the iEnd and bEnd edges of the table
 void
-nsTableCellMap::DeleteRightBottomBorders()
+nsTableCellMap::DeleteIEndBEndBorders()
 {
   if (mBCInfo) {
     mBCInfo->mBEndBorders.Clear();
     mBCInfo->mIEndBorders.Clear();
   }
 }
 
 void
@@ -486,17 +486,17 @@ nsTableCellMap::InsertRows(nsTableRowGro
       if (mBCInfo) {
         int32_t count = mBCInfo->mIEndBorders.Length();
         if (aFirstRowIndex < count) {
           for (int32_t rowX = aFirstRowIndex; rowX < aFirstRowIndex + numNewRows; rowX++) {
             mBCInfo->mIEndBorders.InsertElementAt(rowX);
           }
         }
         else {
-          GetRightMostBorder(aFirstRowIndex); // this will create missing entries
+          GetIEndMostBorder(aFirstRowIndex); // this will create missing entries
           for (int32_t rowX = aFirstRowIndex + 1; rowX < aFirstRowIndex + numNewRows; rowX++) {
             mBCInfo->mIEndBorders.AppendElement();
           }
         }
       }
       return;
     }
     int32_t rowCount = cellMap->GetRowCount();
@@ -721,17 +721,17 @@ nsTableCellMap::Dump(char* aString) cons
   }
   printf(" cols in cache %d\n", int(mTableFrame.GetColCache().Length()));
   nsCellMap* cellMap = mFirstMap;
   while (cellMap) {
     cellMap->Dump(nullptr != mBCInfo);
     cellMap = cellMap->GetNextSibling();
   }
   if (nullptr != mBCInfo) {
-    printf("***** bottom borders *****\n");
+    printf("***** block-end borders *****\n");
     nscoord       size;
     BCBorderOwner owner;
     LogicalSide side;
     bool          segStart;
     bool          bevel;
     int32_t       colIndex;
     int32_t numCols = mBCInfo->mBEndBorders.Length();
     for (int32_t i = 0; i <= 2; i++) {
@@ -907,23 +907,23 @@ void nsTableCellMap::ExpandZeroColSpans(
   nsCellMap* cellMap = mFirstMap;
   while (cellMap) {
     cellMap->ExpandZeroColSpans(*this);
     cellMap = cellMap->GetNextSibling();
   }
 }
 
 void
-nsTableCellMap::ResetTopStart(LogicalSide    aSide,
-                              nsCellMap& aCellMap,
-                              uint32_t   aRowIndex,
-                              uint32_t   aColIndex,
-                              bool       aIsLowerRight)
+nsTableCellMap::ResetBStartStart(LogicalSide aSide,
+                                 nsCellMap&  aCellMap,
+                                 uint32_t    aRowIndex,
+                                 uint32_t    aColIndex,
+                                 bool        aIsBEndIEnd)
 {
-  if (!mBCInfo || aIsLowerRight) ABORT0();
+  if (!mBCInfo || aIsBEndIEnd) ABORT0();
 
   BCCellData* cellData;
   BCData* bcData = nullptr;
 
   switch(aSide) {
   case eLogicalSideBEnd:
     aRowIndex++;
     // FALLTHROUGH
@@ -937,44 +937,44 @@ nsTableCellMap::ResetTopStart(LogicalSid
       // try the next row group
       nsCellMap* cellMap = aCellMap.GetNextSibling();
       if (cellMap) {
         cellData = (BCCellData*)cellMap->GetDataAt(0, aColIndex);
         if (cellData) {
           bcData = &cellData->mData;
         }
         else {
-          bcData = GetBottomMostBorder(aColIndex);
+          bcData = GetBEndMostBorder(aColIndex);
         }
       }
     }
     break;
   case eLogicalSideIEnd:
     aColIndex++;
     // FALLTHROUGH
   case eLogicalSideIStart:
     cellData = (BCCellData*)aCellMap.GetDataAt(aRowIndex, aColIndex);
     if (cellData) {
       bcData = &cellData->mData;
     }
     else {
       NS_ASSERTION(aSide == eLogicalSideIEnd, "program error");
-      bcData = GetRightMostBorder(aRowIndex);
+      bcData = GetIEndMostBorder(aRowIndex);
     }
     break;
   }
   if (bcData) {
     bcData->SetBStartStart(false);
   }
 }
 
-// store the aSide border segment at coord = (aRowIndex, aColIndex). For top/left, store
-// the info at coord. For bottom/left store it at the adjacent location so that it is
-// top/left at that location. If the new location is at the right or bottom edge of the
-// table, then store it one of the special arrays (right most borders, bottom most borders).
+// store the aSide border segment at coord = (aRowIndex, aColIndex). For bStart/iStart, store
+// the info at coord. For bEnd/iStart store it at the adjacent location so that it is
+// bStart/iStart at that location. If the new location is at the iEnd or bEnd edge of the
+// table, then store it one of the special arrays (iEnd-most borders, bEnd-most borders).
 void
 nsTableCellMap::SetBCBorderEdge(LogicalSide aSide,
                                 nsCellMap&    aCellMap,
                                 uint32_t      aCellMapStart,
                                 uint32_t      aRowIndex,
                                 uint32_t      aColIndex,
                                 uint32_t      aLength,
                                 BCBorderOwner aOwner,
@@ -1020,56 +1020,56 @@ nsTableCellMap::SetBCBorderEdge(LogicalS
             if (!cellData) { // add a dead cell
               TableArea damageArea;
               cellData = (BCCellData*)cellMap->AppendCell(*this, nullptr, 0,
                                                            false, 0,
                                                            damageArea);
             }
           }
           else { // must be at the end of the table
-            bcData = GetBottomMostBorder(xIndex);
+            bcData = GetBEndMostBorder(xIndex);
           }
         }
       }
       if (!bcData && cellData) {
         bcData = &cellData->mData;
       }
       if (bcData) {
         bcData->SetBStartEdge(aOwner, aSize, changed);
       }
-      else NS_ERROR("Cellmap: Top edge not found");
+      else NS_ERROR("Cellmap: BStart edge not found");
     }
     break;
   case eLogicalSideIEnd:
     xPos++;
   case eLogicalSideIStart:
-    // since top, bottom borders were set, there should already be a cellData entry
+    // since bStart, bEnd borders were set, there should already be a cellData entry
     lastIndex = rgYPos + aLength - 1;
     for (yIndex = rgYPos; yIndex <= lastIndex; yIndex++) {
       changed = aChanged && (yIndex == rgYPos);
       cellData = (BCCellData*)aCellMap.GetDataAt(yIndex, xPos);
       if (cellData) {
         cellData->mData.SetIStartEdge(aOwner, aSize, changed);
       }
       else {
         NS_ASSERTION(aSide == eLogicalSideIEnd, "program error");
-        BCData* bcData = GetRightMostBorder(yIndex + aCellMapStart);
+        BCData* bcData = GetIEndMostBorder(yIndex + aCellMapStart);
         if (bcData) {
           bcData->SetIStartEdge(aOwner, aSize, changed);
         }
-        else NS_ERROR("Cellmap: Left edge not found");
+        else NS_ERROR("Cellmap: IStart edge not found");
       }
     }
     break;
   }
 }
 
-// store corner info (aOwner, aSubSize, aBevel). For aCorner = eTopLeft, store the info at
-// (aRowIndex, aColIndex). For eTopRight, store it in the entry to the right where
-// it would be top left. For eBottomRight, store it in the entry to the bottom. etc.
+// store corner info (aOwner, aSubSize, aBevel). For aCorner = eBStartIStart, store the info at
+// (aRowIndex, aColIndex). For eBStartIEnd, store it in the entry to the iEnd-wards where
+// it would be BStartIStart. For eBEndIEnd, store it in the entry to the bEnd-wards. etc.
 void
 nsTableCellMap::SetBCBorderCorner(Corner      aCorner,
                                   nsCellMap&  aCellMap,
                                   uint32_t    aCellMapStart,
                                   uint32_t    aRowIndex,
                                   uint32_t    aColIndex,
                                   LogicalSide aOwner,
                                   nscoord     aSubSize,
@@ -1099,19 +1099,19 @@ nsTableCellMap::SetBCBorderCorner(Corner
     rgYPos++;
     yPos++;
   }
 
   BCCellData* cellData = nullptr;
   BCData*     bcData   = nullptr;
   if (GetColCount() <= xPos) {
     NS_ASSERTION(xPos == GetColCount(), "program error");
-    // at the right edge of the table as we checked the corner before
+    // at the iEnd edge of the table as we checked the corner before
     NS_ASSERTION(!aIsBEndIEnd, "should be handled before");
-    bcData = GetRightMostBorder(yPos);
+    bcData = GetIEndMostBorder(yPos);
   }
   else {
     cellData = (BCCellData*)aCellMap.GetDataAt(rgYPos, xPos);
     if (!cellData) {
       int32_t numRgRows = aCellMap.GetRowCount();
       if (yPos < numRgRows) { // add a dead cell data
         TableArea damageArea;
         cellData = (BCCellData*)aCellMap.AppendCell(*this, nullptr, rgYPos,
@@ -1126,18 +1126,18 @@ nsTableCellMap::SetBCBorderCorner(Corner
         if (cellMap) {
           cellData = (BCCellData*)cellMap->GetDataAt(0, xPos);
           if (!cellData) { // add a dead cell
             TableArea damageArea;
             cellData = (BCCellData*)cellMap->AppendCell(*this, nullptr, 0,
                                                          false, 0, damageArea);
           }
         }
-        else { // must be at the bottom of the table
-          bcData = GetBottomMostBorder(xPos);
+        else { // must be at the bEnd of the table
+          bcData = GetBEndMostBorder(xPos);
         }
       }
     }
   }
   if (!bcData && cellData) {
     bcData = &cellData->mData;
   }
   if (bcData) {
--- a/layout/tables/nsCellMap.h
+++ b/layout/tables/nsCellMap.h
@@ -195,21 +195,21 @@ protected:
                               int32_t                     aStartRowIndex,
                               nsTArray<nsTableRowFrame*>* aRowsToInsert,
                               int32_t                     aNumRowsToRemove,
                               TableArea&                  aDamageArea);
 
 public:
   void ExpandZeroColSpans();
 
-  void ResetTopStart(mozilla::LogicalSide    aSide,
-                     nsCellMap& aCellMap,
-                     uint32_t   aYPos,
-                     uint32_t   aXPos,
-                     bool       aIsLowerRight = false);
+  void ResetBStartStart(mozilla::LogicalSide aSide,
+                        nsCellMap& aCellMap,
+                        uint32_t   aYPos,
+                        uint32_t   aXPos,
+                        bool       aIsBEndIEnd = false);
 
   void SetBCBorderEdge(mozilla::LogicalSide aEdge,
                        nsCellMap&    aCellMap,
                        uint32_t      aCellMapStart,
                        uint32_t      aYPos,
                        uint32_t      aXPos,
                        uint32_t      aLength,
                        BCBorderOwner aOwner,
@@ -227,31 +227,31 @@ public:
                          bool        aIsBottomRight = false);
 
   /** dump a representation of the cell map to stdout for debugging */
 #ifdef DEBUG
   void Dump(char* aString = nullptr) const;
 #endif
 
 protected:
-  BCData* GetRightMostBorder(int32_t aRowIndex);
-  BCData* GetBottomMostBorder(int32_t aColIndex);
+  BCData* GetIEndMostBorder(int32_t aRowIndex);
+  BCData* GetBEndMostBorder(int32_t aColIndex);
 
   friend class nsCellMap;
   friend class BCMapCellIterator;
   friend class BCPaintBorderIterator;
   friend class nsCellMapColumnIterator;
 
 /** Insert a row group cellmap after aPrevMap, if aPrefMap is null insert it
   * at the beginning, the ordering of the cellmap corresponds to the ordering of
   * rowgroups once OrderRowGroups has been called
   */
   void InsertGroupCellMap(nsCellMap* aPrevMap,
                           nsCellMap& aNewMap);
-  void DeleteRightBottomBorders();
+  void DeleteIEndBEndBorders();
 
   nsTableFrame&               mTableFrame;
   nsAutoTArray<nsColInfo, 8>  mCols;
   nsCellMap*                  mFirstMap;
   // border collapsing info
   BCInfo*                     mBCInfo;
 };
 
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -4101,26 +4101,26 @@ nsTableFrame::SetFullBCDamageArea()
 
   BCPropertyData* value = GetBCProperty(true);
   if (value) {
     value->mDamageArea = TableArea(0, 0, GetColCount(), GetRowCount());
   }
 }
 
 
-/* BCCellBorder represents a border segment which can be either a horizontal
- * or a vertical segment. For each segment we need to know the color, width,
+/* BCCellBorder represents a border segment which can be either an inline-dir
+ * or a block-dir segment. For each segment we need to know the color, width,
  * style, who owns it and how long it is in cellmap coordinates.
  * Ownership of these segments is important to calculate which corners should
  * be bevelled. This structure has dual use, its used first to compute the
- * dominant border for horizontal and vertical segments and to store the
+ * dominant border for inline-dir and block-dir segments and to store the
  * preliminary computed border results in the BCCellBorders structure.
- * This temporary storage is not symmetric with respect to horizontal and
- * vertical border segments, its always column oriented. For each column in
- * the cellmap there is a temporary stored vertical and horizontal segment.
+ * This temporary storage is not symmetric with respect to inline-dir and
+ * block-dir border segments, its always column oriented. For each column in
+ * the cellmap there is a temporary stored block-dir and inline-dir segment.
  * XXX_Bernd this asymmetry is the root of those rowspan bc border errors
  */
 struct BCCellBorder
 {
   BCCellBorder() { Reset(0, 1); }
   void Reset(uint32_t aRowIndex, uint32_t aRowSpan);
   nscolor       color;    // border segment color
   BCPixelSize   width;    // border segment width in pixel coordinates !!
@@ -4821,17 +4821,17 @@ nsTableFrame::BCRecalcNeeded(nsStyleCont
     NS_DispatchToCurrentThread(evt);
     return true;
   }
   return false;
 }
 
 
 // Compare two border segments, this comparison depends whether the two
-// segments meet at a corner and whether the second segment is horizontal.
+// segments meet at a corner and whether the second segment is inline-dir.
 // The return value is whichever of aBorder1 or aBorder2 dominates.
 static const BCCellBorder&
 CompareBorders(bool                aIsCorner, // Pass true for corner calculations
                const BCCellBorder& aBorder1,
                const BCCellBorder& aBorder2,
                bool                aSecondIsInlineDir,
                bool*               aFirstDominates = nullptr)
 {
@@ -5151,18 +5151,18 @@ SetBorder(const BCCellBorder&   aNewBord
   aBorder.color        = aNewBorder.color;
   aBorder.width        = aNewBorder.width;
   aBorder.style        = aNewBorder.style;
   aBorder.owner        = aNewBorder.owner;
 
   return changed;
 }
 
-// this function will set the horizontal border. It will return true if the
-// existing segment will not be continued. Having a vertical owner of a corner
+// this function will set the inline-dir border. It will return true if the
+// existing segment will not be continued. Having a block-dir owner of a corner
 // should also start a new segment.
 static bool
 SetInlineDirBorder(const BCCellBorder& aNewBorder,
                    const BCCornerInfo& aCorner,
                    BCCellBorder&       aBorder)
 {
   bool startSeg = ::SetBorder(aNewBorder, aBorder);
   if (!startSeg) {
@@ -5481,28 +5481,28 @@ BCMapCellInfo::SetTableBStartBorderWidth
 {
   mTableBCData->mBStartBorderWidth = std::max(mTableBCData->mBStartBorderWidth,
                                               aWidth);
 }
 
 void
 BCMapCellInfo::SetTableIStartBorderWidth(int32_t aRowB, BCPixelSize aWidth)
 {
-  // update the left/right first cell border
+  // update the iStart first cell border
   if (aRowB == 0) {
     mTableBCData->mIStartCellBorderWidth = aWidth;
   }
   mTableBCData->mIStartBorderWidth = std::max(mTableBCData->mIStartBorderWidth,
                                               aWidth);
 }
 
 void
 BCMapCellInfo::SetTableIEndBorderWidth(int32_t aRowB, BCPixelSize aWidth)
 {
-  // update the left/right first cell border
+  // update the iEnd first cell border
   if (aRowB == 0) {
     mTableBCData->mIEndCellBorderWidth = aWidth;
   }
   mTableBCData->mIEndBorderWidth = std::max(mTableBCData->mIEndBorderWidth,
                                             aWidth);
 }
 
 void
@@ -5979,17 +5979,17 @@ nsTableFrame::CalcBCBorders()
     for (int32_t colIdx = info.mColIndex + 1;
          colIdx <= info.GetCellEndColIndex(); colIdx++) {
       lastBlockDirBorders[colIdx].Reset(0,1);
     }
 
     // find the dominant border considering the cell's bEnd border, adjacent
     // cells and the table, row group, row
     if (info.mNumTableRows == info.GetCellEndRowIndex() + 1) {
-      // touches bottom edge of table
+      // touches bEnd edge of table
       if (!tableBorderReset[eLogicalSideBEnd]) {
         propData->mBEndBorderWidth = 0;
         tableBorderReset[eLogicalSideBEnd] = true;
       }
       for (int32_t colIdx = info.mColIndex;
            colIdx <= info.GetCellEndColIndex(); colIdx++) {
         info.SetColumn(colIdx);
         currentBorder = info.GetBEndEdgeBorder();
@@ -6150,19 +6150,19 @@ nsTableFrame::CalcBCBorders()
         BCCellBorder& thisBorder = lastBEndBorder;
         BCCellBorder& nextBorder = lastBEndBorders[info.mColIndex + 1];
         if ((thisBorder.color == nextBorder.color) &&
             (thisBorder.width == nextBorder.width) &&
             (thisBorder.style == nextBorder.style)) {
           // set the flag on the next border indicating it is not the start of a
           // new segment
           if (iter.mCellMap) {
-            tableCellMap->ResetTopStart(eLogicalSideBEnd, *iter.mCellMap,
-                                        info.GetCellEndRowIndex(),
-                                        info.GetCellEndColIndex() + 1);
+            tableCellMap->ResetBStartStart(eLogicalSideBEnd, *iter.mCellMap,
+                                           info.GetCellEndRowIndex(),
+                                           info.GetCellEndColIndex() + 1);
           }
         }
       }
     }
   } // for (iter.First(info); info.mCell; iter.Next(info)) {
   // reset the bc flag and damage area
   SetNeedToCalcBCBorders(false);
   propData->mDamageArea = TableArea(0, 0, 0, 0);
@@ -6227,21 +6227,21 @@ struct BCBlockDirSeg
 };
 
 struct BCInlineDirSeg
 {
   BCInlineDirSeg();
 
   void Start(BCPaintBorderIterator& aIter,
              BCBorderOwner          aBorderOwner,
-             BCPixelSize            aBEndBlockSegWidth,
+             BCPixelSize            aBEndBlockSegISize,
              BCPixelSize            aInlineSegBSize);
    void GetIEndCorner(BCPaintBorderIterator& aIter,
-                      BCPixelSize            aIStartSegWidth);
-   void AdvanceOffsetI(int32_t aIncrement);
+                      BCPixelSize            aIStartSegISize);
+   void AdvanceOffsetI();
    void IncludeCurrentBorder(BCPaintBorderIterator& aIter);
    void Paint(BCPaintBorderIterator& aIter,
               nsRenderingContext&    aRenderingContext);
 
   nscoord            mOffsetI;       // i-offset with respect to the table edge
   nscoord            mOffsetB;       // b-offset with respect to the table edge
   nscoord            mLength;        // inline-dir length including corners
   BCPixelSize        mWidth;         // border thickness in pixels
@@ -6264,18 +6264,18 @@ struct BCInlineDirSeg
 
 // Iterates over borders (iStart border, corner, bStart border) in the cell map within a damage area
 // from iStart to iEnd, bStart to bEnd. All members are in terms of the 1st in flow frames, except
 // where suffixed by InFlow.
 class BCPaintBorderIterator
 {
 public:
   explicit BCPaintBorderIterator(nsTableFrame* aTable);
-  ~BCPaintBorderIterator() { if (mVerInfo) {
-                              delete [] mVerInfo;
+  ~BCPaintBorderIterator() { if (mBlockDirInfo) {
+                              delete [] mBlockDirInfo;
                            }}
   void Reset();
 
   /**
    * Determine the damage area in terms of rows and columns and finalize
    * mInitialOffsetI and mInitialOffsetB.
    * @param aDirtyRect - dirty rect in table coordinates
    * @return - true if we need to paint something given dirty rect
@@ -6331,45 +6331,46 @@ public:
 
   // cell properties
   nsTableCellFrame*     mPrevCell;
   nsTableCellFrame*     mCell;
   BCCellData*           mPrevCellData;
   BCCellData*           mCellData;
   BCData*               mBCData;
 
-  bool                  IsTableTopMost()    {return (mRowIndex == 0) && !mTable->GetPrevInFlow();}
-  bool                  IsTableRightMost()  {return (mColIndex >= mNumTableCols);}
-  bool                  IsTableBottomMost() {return (mRowIndex >= mNumTableRows) && !mTable->GetNextInFlow();}
-  bool                  IsTableLeftMost()   {return (mColIndex == 0);}
+  bool                  IsTableBStartMost() {return (mRowIndex == 0) && !mTable->GetPrevInFlow();}
+  bool                  IsTableIEndMost()   {return (mColIndex >= mNumTableCols);}
+  bool                  IsTableBEndMost()   {return (mRowIndex >= mNumTableRows) && !mTable->GetNextInFlow();}
+  bool                  IsTableIStartMost() {return (mColIndex == 0);}
   bool IsDamageAreaBStartMost() const
     { return mRowIndex == mDamageArea.StartRow(); }
   bool IsDamageAreaIEndMost() const
     { return mColIndex >= mDamageArea.EndCol(); }
   bool IsDamageAreaBEndMost() const
     { return mRowIndex >= mDamageArea.EndRow(); }
   bool IsDamageAreaIStartMost() const
     { return mColIndex == mDamageArea.StartCol(); }
   int32_t GetRelativeColIndex() const
     { return mColIndex - mDamageArea.StartCol(); }
 
   TableArea             mDamageArea;        // damageArea in cellmap coordinates
-  bool                  IsAfterRepeatedHeader() { return !mIsRepeatedHeader && (mRowIndex == (mRepeatedHeaderRowIndex + 1));}
+  bool IsAfterRepeatedHeader()
+    { return !mIsRepeatedHeader && (mRowIndex == (mRepeatedHeaderRowIndex + 1)); }
   bool StartRepeatedFooter() const
   {
     return mIsRepeatedFooter && mRowIndex == mRgFirstRowIndex &&
       mRowIndex != mDamageArea.StartRow();
   }
 
   nscoord               mInitialOffsetI;    // offsetI of the first border with
                                             // respect to the table
   nscoord               mInitialOffsetB;    // offsetB of the first border with
                                             // respect to the table
   nscoord               mNextOffsetB;       // offsetB of the next segment
-  BCBlockDirSeg*        mVerInfo; // this array is used differently when
+  BCBlockDirSeg*        mBlockDirInfo; // this array is used differently when
                                   // inline-dir and block-dir borders are drawn
                                   // When inline-dir border are drawn we cache
                                   // the column widths and the width of the
                                   // block-dir borders that arrive from bStart
                                   // When we draw block-dir borders we store
                                   // lengths and width for block-dir borders
                                   // before they are drawn while we  move over
                                   // the columns in the damage area
@@ -6391,17 +6392,17 @@ private:
 
 
 BCPaintBorderIterator::BCPaintBorderIterator(nsTableFrame* aTable)
   : mTable(aTable)
   , mTableFirstInFlow(static_cast<nsTableFrame*>(aTable->FirstInFlow()))
   , mTableCellMap(aTable->GetCellMap())
   , mTableWM(aTable->StyleContext())
 {
-  mVerInfo    = nullptr;
+  mBlockDirInfo    = nullptr;
   LogicalMargin childAreaOffset = mTable->GetChildAreaOffset(mTableWM, nullptr);
   // y position of first row in damage area
   mInitialOffsetB =
     mTable->GetPrevInFlow() ? 0 : childAreaOffset.BStart(mTableWM);
   mNumTableRows  = mTable->GetRowCount();
   mNumTableCols  = mTable->GetColCount();
 
   // Get the ordered row groups
@@ -6469,64 +6470,61 @@ BCPaintBorderIterator::SetDamageArea(con
   // target to other areas as the NS_FRAME_OUTSIDE_CHILDREN is set
   // on the table
   if (!haveIntersect)
     return false;
   // find startColIndex, endColIndex, startColX
   haveIntersect = false;
   if (0 == mNumTableCols)
     return false;
-  int32_t leftCol, rightCol; // columns are in the range [leftCol, rightCol)
 
   LogicalMargin childAreaOffset = mTable->GetChildAreaOffset(mTableWM, nullptr);
 
-  // x position of first col in damage area
+  // inline position of first col in damage area
   mInitialOffsetI = childAreaOffset.IStart(mTableWM);
-  leftCol = 0;
-  rightCol = mNumTableCols;
 
   nscoord x = 0;
-  int32_t colX;
-  for (colX = leftCol; colX != rightCol; colX++) {
-    nsTableColFrame* colFrame = mTableFirstInFlow->GetColFrame(colX);
+  int32_t colIdx;
+  for (colIdx = 0; colIdx != mNumTableCols; colIdx++) {
+    nsTableColFrame* colFrame = mTableFirstInFlow->GetColFrame(colIdx);
     if (!colFrame) ABORT1(false);
     // get the col rect relative to the table rather than the col group
     nscoord colISize = colFrame->ISize(mTableWM);
     if (haveIntersect) {
       // conservatively estimate the iStart half border width outside the col
       nscoord iStartBorderHalf = nsPresContext::
         CSSPixelsToAppUnits(colFrame->GetIStartBorderWidth() + 1);
       if (dirtyRect.IEnd(mTableWM) >= x - iStartBorderHalf) {
-        endColIndex = colX;
+        endColIndex = colIdx;
       }
       else break;
     }
     else {
       // conservatively estimate the iEnd half border width outside the col
       nscoord iEndBorderHalf = nsPresContext::
         CSSPixelsToAppUnits(colFrame->GetIEndBorderWidth() + 1);
       if (x + colISize + iEndBorderHalf >= dirtyRect.IStart(mTableWM)) {
-        startColIndex = endColIndex = colX;
+        startColIndex = endColIndex = colIdx;
         haveIntersect = true;
       }
       else {
         mInitialOffsetI += colISize;
       }
     }
     x += colISize;
   }
   if (!haveIntersect)
     return false;
   mDamageArea = TableArea(startColIndex, startRowIndex,
                           1 + DeprecatedAbs<int32_t>(endColIndex - startColIndex),
                           1 + endRowIndex - startRowIndex);
 
   Reset();
-  mVerInfo = new BCBlockDirSeg[mDamageArea.ColCount() + 1];
-  if (!mVerInfo)
+  mBlockDirInfo = new BCBlockDirSeg[mDamageArea.ColCount() + 1];
+  if (!mBlockDirInfo)
     return false;
   return true;
 }
 
 void
 BCPaintBorderIterator::Reset()
 {
   mAtEnd = true; // gets reset when First() is called
@@ -6553,25 +6551,25 @@ void
 BCPaintBorderIterator::SetNewData(int32_t aY,
                                   int32_t aX)
 {
   if (!mTableCellMap || !mTableCellMap->mBCInfo) ABORT0();
 
   mColIndex    = aX;
   mRowIndex    = aY;
   mPrevCellData = mCellData;
-  if (IsTableRightMost() && IsTableBottomMost()) {
+  if (IsTableIEndMost() && IsTableBEndMost()) {
    mCell = nullptr;
    mBCData = &mTableCellMap->mBCInfo->mBEndIEndCorner;
   }
-  else if (IsTableRightMost()) {
+  else if (IsTableIEndMost()) {
     mCellData = nullptr;
     mBCData = &mTableCellMap->mBCInfo->mIEndBorders.ElementAt(aY);
   }
-  else if (IsTableBottomMost()) {
+  else if (IsTableBEndMost()) {
     mCellData = nullptr;
     mBCData = &mTableCellMap->mBCInfo->mBEndBorders.ElementAt(aX);
   }
   else {
     if (uint32_t(mRowIndex - mFifRgFirstRowIndex) < mCellMap->mRows.Length()) {
       mBCData = nullptr;
       mCellData =
         (BCCellData*)mCellMap->mRows[mRowIndex - mFifRgFirstRowIndex].SafeElementAt(mColIndex);
@@ -6835,67 +6833,67 @@ BCBlockDirSeg::Start(BCPaintBorderIterat
                      BCPixelSize            aInlineSegBSize)
 {
   LogicalSide ownerSide   = eLogicalSideBStart;
   bool bevel       = false;
 
   nscoord cornerSubWidth  = (aIter.mBCData) ?
                                aIter.mBCData->GetCorner(ownerSide, bevel) : 0;
 
-  bool    topBevel        = (aBlockSegISize > 0) ? bevel : false;
+  bool    bStartBevel     = (aBlockSegISize > 0) ? bevel : false;
   BCPixelSize maxInlineSegBSize = std::max(aIter.mPrevInlineSegBSize, aInlineSegBSize);
   nscoord offset          = CalcVerCornerOffset(ownerSide, cornerSubWidth,
                                                 maxInlineSegBSize, true,
-                                                topBevel);
-
-  mBStartBevelOffset = topBevel ?
+                                                bStartBevel);
+
+  mBStartBevelOffset = bStartBevel ?
     nsPresContext::CSSPixelsToAppUnits(maxInlineSegBSize): 0;
   // XXX this assumes that only corners where 2 segments join can be beveled
   mBStartBevelSide     = (aInlineSegBSize > 0) ? eLogicalSideIEnd : eLogicalSideIStart;
   mOffsetB      += offset;
   mLength        = -offset;
   mWidth         = aBlockSegISize;
   mOwner         = aBorderOwner;
   mFirstCell     = aIter.mCell;
   mFirstRowGroup = aIter.mRg;
   mFirstRow      = aIter.mRow;
   if (aIter.GetRelativeColIndex() > 0) {
-    mAjaCell = aIter.mVerInfo[aIter.GetRelativeColIndex() - 1].mLastCell;
+    mAjaCell = aIter.mBlockDirInfo[aIter.GetRelativeColIndex() - 1].mLastCell;
   }
 }
 
 /**
- * Initialize the vertical segments with information that will persist for any
- * vertical segment in this column
+ * Initialize the block-dir segments with information that will persist for any
+ * block-dir segment in this column
  * @param aIter - iterator containing the structural information
  */
 void
 BCBlockDirSeg::Initialize(BCPaintBorderIterator& aIter)
 {
   int32_t relColIndex = aIter.GetRelativeColIndex();
-  mCol = aIter.IsTableRightMost() ? aIter.mVerInfo[relColIndex - 1].mCol :
+  mCol = aIter.IsTableIEndMost() ? aIter.mBlockDirInfo[relColIndex - 1].mCol :
            aIter.mTableFirstInFlow->GetColFrame(aIter.mColIndex);
   if (!mCol) ABORT0();
   if (0 == relColIndex) {
     mOffsetI = aIter.mInitialOffsetI;
   }
-  // set colX for the next column
+  // set mOffsetI for the next column
   if (!aIter.IsDamageAreaIEndMost()) {
-    aIter.mVerInfo[relColIndex + 1].mOffsetI =
+    aIter.mBlockDirInfo[relColIndex + 1].mOffsetI =
       mOffsetI + mCol->ISize(aIter.mTableWM);
   }
   mOffsetB = aIter.mInitialOffsetB;
   mLastCell = aIter.mCell;
 }
 
 /**
- * Compute the offsets for the bottom corner of a vertical segment
- * @param aIter         - iterator containing the structural information
- * @param aInlineSegBSize - the width of the horizontal segment joining the corner
- *                        at the start
+ * Compute the offsets for the bEnd corner of a block-dir segment
+ * @param aIter           - iterator containing the structural information
+ * @param aInlineSegBSize - the width of the inline-dir segment joining the corner
+ *                          at the start
  */
 void
 BCBlockDirSeg::GetBEndCorner(BCPaintBorderIterator& aIter,
                                BCPixelSize            aInlineSegBSize)
 {
    LogicalSide ownerSide = eLogicalSideBStart;
    nscoord cornerSubWidth = 0;
    bool bevel = false;
@@ -6906,21 +6904,21 @@ BCBlockDirSeg::GetBEndCorner(BCPaintBord
    mBEndInlineSegBSize = std::max(aIter.mPrevInlineSegBSize, aInlineSegBSize);
    mBEndOffset = CalcVerCornerOffset(ownerSide, cornerSubWidth,
                                     mBEndInlineSegBSize,
                                     false, mIsBEndBevel);
    mLength += mBEndOffset;
 }
 
 /**
- * Paint the vertical segment
- * @param aIter         - iterator containing the structural information
+ * Paint the block-dir segment
+ * @param aIter             - iterator containing the structural information
  * @param aRenderingContext - the rendering context
- * @param aInlineSegBSize - the width of the horizontal segment joining the corner
- *                        at the start
+ * @param aInlineSegBSize   - the width of the inline-dir segment joining the corner
+ *                            at the start
  */
 void
 BCBlockDirSeg::Paint(BCPaintBorderIterator& aIter,
                      nsRenderingContext&   aRenderingContext,
                      BCPixelSize            aInlineSegBSize)
 {
   // get the border style, color and paint the segment
   LogicalSide side =
@@ -6937,44 +6935,44 @@ BCBlockDirSeg::Paint(BCPaintBorderIterat
   int32_t appUnitsPerDevPixel = col->PresContext()->AppUnitsPerDevPixel();
 
   switch (mOwner) {
     case eTableOwner:
       owner = aIter.mTable;
       break;
     case eAjaColGroupOwner:
       side = eLogicalSideIEnd;
-      if (!aIter.IsTableRightMost() && (relColIndex > 0)) {
-        col = aIter.mVerInfo[relColIndex - 1].mCol;
+      if (!aIter.IsTableIEndMost() && (relColIndex > 0)) {
+        col = aIter.mBlockDirInfo[relColIndex - 1].mCol;
       } // and fall through
     case eColGroupOwner:
       if (col) {
         owner = col->GetParent();
       }
       break;
     case eAjaColOwner:
       side = eLogicalSideIEnd;
-      if (!aIter.IsTableRightMost() && (relColIndex > 0)) {
-        col = aIter.mVerInfo[relColIndex - 1].mCol;
+      if (!aIter.IsTableIEndMost() && (relColIndex > 0)) {
+        col = aIter.mBlockDirInfo[relColIndex - 1].mCol;
       } // and fall through
     case eColOwner:
       owner = col;
       break;
     case eAjaRowGroupOwner:
       NS_ERROR("a neighboring rowgroup can never own a vertical border");
       // and fall through
     case eRowGroupOwner:
-      NS_ASSERTION(aIter.IsTableLeftMost() || aIter.IsTableRightMost(),
+      NS_ASSERTION(aIter.IsTableIStartMost() || aIter.IsTableIEndMost(),
                   "row group can own border only at table edge");
       owner = mFirstRowGroup;
       break;
     case eAjaRowOwner:
       NS_ERROR("program error"); // and fall through
     case eRowOwner:
-      NS_ASSERTION(aIter.IsTableLeftMost() || aIter.IsTableRightMost(),
+      NS_ASSERTION(aIter.IsTableIStartMost() || aIter.IsTableIEndMost(),
                    "row can own border only at table edge");
       owner = mFirstRow;
       break;
     case eAjaCellOwner:
       side = eLogicalSideIEnd;
       cell = mAjaCell; // and fall through
     case eCellOwner:
       owner = cell;
@@ -7029,86 +7027,87 @@ BCInlineDirSeg::BCInlineDirSeg()
   mOffsetI = mOffsetB = mLength = mWidth =  mIStartBevelOffset = 0;
   mIStartBevelSide = eLogicalSideBStart;
   mFirstCell = mAjaCell = nullptr;
 }
 
 /** Initialize an inline-dir border segment for painting
   * @param aIter              - iterator storing the current and adjacent frames
   * @param aBorderOwner       - which frame owns the border
-  * @param aBEndBlockSegWidth - block-dir segment width coming from up
+  * @param aBEndBlockSegISize - block-dir segment width coming from up
   * @param aInlineSegBSize    - the thickness of the segment
   +  */
 void
 BCInlineDirSeg::Start(BCPaintBorderIterator& aIter,
                       BCBorderOwner          aBorderOwner,
-                      BCPixelSize            aBEndBlockSegWidth,
+                      BCPixelSize            aBEndBlockSegISize,
                       BCPixelSize            aInlineSegBSize)
 {
   LogicalSide cornerOwnerSide = eLogicalSideBStart;
   bool bevel     = false;
 
   mOwner = aBorderOwner;
   nscoord cornerSubWidth  = (aIter.mBCData) ?
                              aIter.mBCData->GetCorner(cornerOwnerSide,
                                                        bevel) : 0;
 
-  bool    leftBevel = (aInlineSegBSize > 0) ? bevel : false;
+  bool    iStartBevel = (aInlineSegBSize > 0) ? bevel : false;
   int32_t relColIndex = aIter.GetRelativeColIndex();
-  nscoord maxBlockSegISize = std::max(aIter.mVerInfo[relColIndex].mWidth,
-                                  aBEndBlockSegWidth);
+  nscoord maxBlockSegISize = std::max(aIter.mBlockDirInfo[relColIndex].mWidth,
+                                      aBEndBlockSegISize);
   nscoord offset = CalcHorCornerOffset(cornerOwnerSide, cornerSubWidth,
-                                       maxBlockSegISize, true, leftBevel);
-  mIStartBevelOffset = (leftBevel && (aInlineSegBSize > 0)) ? maxBlockSegISize : 0;
+                                       maxBlockSegISize, true, iStartBevel);
+  mIStartBevelOffset = (iStartBevel && (aInlineSegBSize > 0)) ? maxBlockSegISize : 0;
   // XXX this assumes that only corners where 2 segments join can be beveled
-  mIStartBevelSide   = (aBEndBlockSegWidth > 0) ? eLogicalSideBEnd : eLogicalSideBStart;
+  mIStartBevelSide   = (aBEndBlockSegISize > 0) ? eLogicalSideBEnd : eLogicalSideBStart;
   mOffsetI += offset;
   mLength          = -offset;
   mWidth           = aInlineSegBSize;
   mFirstCell       = aIter.mCell;
   mAjaCell         = (aIter.IsDamageAreaBStartMost()) ? nullptr :
-                     aIter.mVerInfo[relColIndex].mLastCell;
+                     aIter.mBlockDirInfo[relColIndex].mLastCell;
 }
 
 /**
- * Compute the offsets for the right corner of a horizontal segment
+ * Compute the offsets for the iEnd corner of an inline-dir segment
  * @param aIter         - iterator containing the structural information
- * @param aIStartSegWidth - the width of the vertical segment joining the corner
+ * @param aIStartSegISize - the iSize of the block-dir segment joining the corner
  *                        at the start
  */
 void
 BCInlineDirSeg::GetIEndCorner(BCPaintBorderIterator& aIter,
-                              BCPixelSize            aIStartSegWidth)
+                              BCPixelSize            aIStartSegISize)
 {
   LogicalSide ownerSide = eLogicalSideBStart;
   nscoord cornerSubWidth = 0;
   bool bevel = false;
   if (aIter.mBCData) {
     cornerSubWidth = aIter.mBCData->GetCorner(ownerSide, bevel);
   }
 
   mIsIEndBevel = (mWidth > 0) ? bevel : 0;
   int32_t relColIndex = aIter.GetRelativeColIndex();
-  nscoord verWidth = std::max(aIter.mVerInfo[relColIndex].mWidth, aIStartSegWidth);
+  nscoord verWidth = std::max(aIter.mBlockDirInfo[relColIndex].mWidth,
+                              aIStartSegISize);
   mEndOffset = CalcHorCornerOffset(ownerSide, cornerSubWidth, verWidth,
                                    false, mIsIEndBevel);
   mLength += mEndOffset;
   mIEndBevelOffset = (mIsIEndBevel) ?
                        nsPresContext::CSSPixelsToAppUnits(verWidth) : 0;
-  mIEndBevelSide = (aIStartSegWidth > 0) ? eLogicalSideBEnd : eLogicalSideBStart;
+  mIEndBevelSide = (aIStartSegISize > 0) ? eLogicalSideBEnd : eLogicalSideBStart;
 }
 
 /**
  * Paint the inline-dir segment
- * @param aIter         - iterator containing the structural information
+ * @param aIter             - iterator containing the structural information
  * @param aRenderingContext - the rendering context
  */
 void
 BCInlineDirSeg::Paint(BCPaintBorderIterator& aIter,
-                       nsRenderingContext&   aRenderingContext)
+                      nsRenderingContext&    aRenderingContext)
 {
   // get the border style, color and paint the segment
   LogicalSide side =
     aIter.IsDamageAreaBEndMost() ? eLogicalSideBEnd : eLogicalSideBStart;
   nsIFrame* rg   = aIter.mRg;  if (!rg) ABORT0();
   nsIFrame* row  = aIter.mRow; if (!row) ABORT0();
   nsIFrame* cell = mFirstCell;
   nsIFrame* col;
@@ -7116,49 +7115,48 @@ BCInlineDirSeg::Paint(BCPaintBorderItera
 
   // All the tables frames have the same presContext, so we just use any one
   // that exists here:
   int32_t appUnitsPerDevPixel = row->PresContext()->AppUnitsPerDevPixel();
 
   uint8_t style = NS_STYLE_BORDER_STYLE_SOLID;
   nscolor color = 0xFFFFFFFF;
 
-
   switch (mOwner) {
     case eTableOwner:
       owner = aIter.mTable;
       break;
     case eAjaColGroupOwner:
-      NS_ERROR("neighboring colgroups can never own a horizontal border");
+      NS_ERROR("neighboring colgroups can never own an inline-dir border");
       // and fall through
     case eColGroupOwner:
-      NS_ASSERTION(aIter.IsTableTopMost() || aIter.IsTableBottomMost(),
+      NS_ASSERTION(aIter.IsTableBStartMost() || aIter.IsTableBEndMost(),
                    "col group can own border only at the table edge");
       col = aIter.mTableFirstInFlow->GetColFrame(aIter.mColIndex - 1);
       if (!col) ABORT0();
       owner = col->GetParent();
       break;
     case eAjaColOwner:
-      NS_ERROR("neighboring column can never own a horizontal border");
+      NS_ERROR("neighboring column can never own an inline-dir border");
       // and fall through
     case eColOwner:
-      NS_ASSERTION(aIter.IsTableTopMost() || aIter.IsTableBottomMost(),
+      NS_ASSERTION(aIter.IsTableBStartMost() || aIter.IsTableBEndMost(),
                    "col can own border only at the table edge");
       owner = aIter.mTableFirstInFlow->GetColFrame(aIter.mColIndex - 1);
       break;
     case eAjaRowGroupOwner:
       side = eLogicalSideBEnd;
-      rg = (aIter.IsTableBottomMost()) ? aIter.mRg : aIter.mPrevRg;
+      rg = (aIter.IsTableBEndMost()) ? aIter.mRg : aIter.mPrevRg;
       // and fall through
     case eRowGroupOwner:
       owner = rg;
       break;
     case eAjaRowOwner:
       side = eLogicalSideBEnd;
-      row = (aIter.IsTableBottomMost()) ? aIter.mRow : aIter.mPrevRow;
+      row = (aIter.IsTableBEndMost()) ? aIter.mRow : aIter.mPrevRow;
       // and fall through
     case eRowOwner:
       owner = row;
       break;
     case eAjaCellOwner:
       side = eLogicalSideBEnd;
       // if this is null due to the damage area origin-y > 0, then the border
       // won't show up anyway
@@ -7201,47 +7199,47 @@ BCInlineDirSeg::Paint(BCPaintBorderItera
                                            nsPresContext::CSSPixelsToAppUnits(mIStartBevelOffset));
   }
 }
 
 /**
  * Advance the start point of a segment
  */
 void
-BCInlineDirSeg::AdvanceOffsetI(int32_t aIncrement)
-{
-  mOffsetI += aIncrement * (mLength - mEndOffset);
+BCInlineDirSeg::AdvanceOffsetI()
+{
+  mOffsetI += (mLength - mEndOffset);
 }
 
 /**
  * Accumulate the current segment
  */
 void
 BCInlineDirSeg::IncludeCurrentBorder(BCPaintBorderIterator& aIter)
 {
-  mLength += aIter.mVerInfo[aIter.GetRelativeColIndex()].mColWidth;
+  mLength += aIter.mBlockDirInfo[aIter.GetRelativeColIndex()].mColWidth;
 }
 
 /**
- * store the column width information while painting horizontal segment
+ * store the column width information while painting inline-dir segment
  */
 void
 BCPaintBorderIterator::StoreColumnWidth(int32_t aIndex)
 {
-  if (IsTableRightMost()) {
-      mVerInfo[aIndex].mColWidth = mVerInfo[aIndex - 1].mColWidth;
+  if (IsTableIEndMost()) {
+    mBlockDirInfo[aIndex].mColWidth = mBlockDirInfo[aIndex - 1].mColWidth;
   }
   else {
     nsTableColFrame* col = mTableFirstInFlow->GetColFrame(mColIndex);
     if (!col) ABORT0();
-    mVerInfo[aIndex].mColWidth = col->ISize(mTableWM);
+    mBlockDirInfo[aIndex].mColWidth = col->ISize(mTableWM);
   }
 }
 /**
- * Determine if a vertical segment owns the corder
+ * Determine if a block-dir segment owns the corner
  */
 bool
 BCPaintBorderIterator::BlockDirSegmentOwnsCorner()
 {
   LogicalSide cornerOwnerSide = eLogicalSideBStart;
   bool bevel = false;
   if (mBCData) {
     mBCData->GetCorner(cornerOwnerSide, bevel);
@@ -7256,17 +7254,17 @@ BCPaintBorderIterator::BlockDirSegmentOw
  * @param aRenderingContext - the rendering context
  */
 void
 BCPaintBorderIterator::AccumulateOrPaintInlineDirSegment(nsRenderingContext& aRenderingContext)
 {
 
   int32_t relColIndex = GetRelativeColIndex();
   // store the current col width if it hasn't been already
-  if (mVerInfo[relColIndex].mColWidth < 0) {
+  if (mBlockDirInfo[relColIndex].mColWidth < 0) {
     StoreColumnWidth(relColIndex);
   }
 
   BCBorderOwner borderOwner = eCellOwner;
   BCBorderOwner ignoreBorderOwner;
   bool isSegStart = true;
   bool ignoreSegStart;
 
@@ -7279,84 +7277,84 @@ BCPaintBorderIterator::AccumulateOrPaint
     // reset for every new row and on the bottom of the last row
     mInlineSeg.mOffsetB = mNextOffsetB;
     mNextOffsetB     = mNextOffsetB + mRow->BSize(mTableWM);
     mInlineSeg.mOffsetI = mInitialOffsetI;
     mInlineSeg.Start(*this, borderOwner, iStartSegISize, bStartSegBSize);
   }
 
   if (!IsDamageAreaIStartMost() && (isSegStart || IsDamageAreaIEndMost() ||
-                                  BlockDirSegmentOwnsCorner())) {
+                                    BlockDirSegmentOwnsCorner())) {
     // paint the previous seg or the current one if IsDamageAreaIEndMost()
     if (mInlineSeg.mLength > 0) {
       mInlineSeg.GetIEndCorner(*this, iStartSegISize);
       if (mInlineSeg.mWidth > 0) {
         mInlineSeg.Paint(*this, aRenderingContext);
       }
-      mInlineSeg.AdvanceOffsetI(1);
+      mInlineSeg.AdvanceOffsetI();
     }
     mInlineSeg.Start(*this, borderOwner, iStartSegISize, bStartSegBSize);
   }
   mInlineSeg.IncludeCurrentBorder(*this);
-  mVerInfo[relColIndex].mWidth = iStartSegISize;
-  mVerInfo[relColIndex].mLastCell = mCell;
+  mBlockDirInfo[relColIndex].mWidth = iStartSegISize;
+  mBlockDirInfo[relColIndex].mLastCell = mCell;
 }
 /**
- * Paint if necessary a block-dir segment, otherwise  it
+ * Paint if necessary a block-dir segment, otherwise accumulate it
  * @param aRenderingContext - the rendering context
  */
 void
 BCPaintBorderIterator::AccumulateOrPaintBlockDirSegment(nsRenderingContext& aRenderingContext)
 {
   BCBorderOwner borderOwner = eCellOwner;
   BCBorderOwner ignoreBorderOwner;
   bool isSegStart = true;
   bool ignoreSegStart;
 
   nscoord blockSegISize  =
     mBCData ? mBCData->GetIStartEdge(borderOwner, isSegStart) : 0;
   nscoord inlineSegBSize =
     mBCData ? mBCData->GetBStartEdge(ignoreBorderOwner, ignoreSegStart) : 0;
 
   int32_t relColIndex = GetRelativeColIndex();
-  BCBlockDirSeg& verSeg = mVerInfo[relColIndex];
-  if (!verSeg.mCol) { // on the first damaged row and the first segment in the
-                      // col
-    verSeg.Initialize(*this);
-    verSeg.Start(*this, borderOwner, blockSegISize, inlineSegBSize);
+  BCBlockDirSeg& blockDirSeg = mBlockDirInfo[relColIndex];
+  if (!blockDirSeg.mCol) { // on the first damaged row and the first segment in the
+                           // col
+    blockDirSeg.Initialize(*this);
+    blockDirSeg.Start(*this, borderOwner, blockSegISize, inlineSegBSize);
   }
 
   if (!IsDamageAreaBStartMost() && (isSegStart || IsDamageAreaBEndMost() ||
-                                 IsAfterRepeatedHeader() ||
-                                 StartRepeatedFooter())) {
+                                    IsAfterRepeatedHeader() ||
+                                    StartRepeatedFooter())) {
     // paint the previous seg or the current one if IsDamageAreaBEndMost()
-    if (verSeg.mLength > 0) {
-      verSeg.GetBEndCorner(*this, inlineSegBSize);
-      if (verSeg.mWidth > 0) {
-        verSeg.Paint(*this, aRenderingContext, inlineSegBSize);
+    if (blockDirSeg.mLength > 0) {
+      blockDirSeg.GetBEndCorner(*this, inlineSegBSize);
+      if (blockDirSeg.mWidth > 0) {
+        blockDirSeg.Paint(*this, aRenderingContext, inlineSegBSize);
       }
-      verSeg.AdvanceOffsetB();
-    }
-    verSeg.Start(*this, borderOwner, blockSegISize, inlineSegBSize);
-  }
-  verSeg.IncludeCurrentBorder(*this);
+      blockDirSeg.AdvanceOffsetB();
+    }
+    blockDirSeg.Start(*this, borderOwner, blockSegISize, inlineSegBSize);
+  }
+  blockDirSeg.IncludeCurrentBorder(*this);
   mPrevInlineSegBSize = inlineSegBSize;
 }
 
 /**
  * Reset the block-dir information cache
  */
 void
 BCPaintBorderIterator::ResetVerInfo()
 {
-  if (mVerInfo) {
-    memset(mVerInfo, 0, mDamageArea.ColCount() * sizeof(BCBlockDirSeg));
+  if (mBlockDirInfo) {
+    memset(mBlockDirInfo, 0, mDamageArea.ColCount() * sizeof(BCBlockDirSeg));
     // XXX reinitialize properly
     for (auto xIndex : MakeRange(mDamageArea.ColCount())) {
-      mVerInfo[xIndex].mColWidth = -1;
+      mBlockDirInfo[xIndex].mColWidth = -1;
     }
   }
 }
 
 /**
  * Method to paint BCBorders, this does not use currently display lists although
  * it will do this in future
  * @param aRenderingContext - the rendering context
@@ -7376,23 +7374,23 @@ nsTableFrame::PaintBCBorders(nsRendering
   // First, paint all of the vertical borders from top to bottom and left to
   // right as they become complete. They are painted first, since they are less
   // efficient to paint than horizontal segments. They were stored with as few
   // segments as possible (since horizontal borders are painted last and
   // possibly over them). For every cell in a row that fails in the damage are
   // we look up if the current border would start a new segment, if so we paint
   // the previously stored vertical segment and start a new segment. After
   // this we  the now active segment with the current border. These
-  // segments are stored in mVerInfo to be used on the next row
+  // segments are stored in mBlockDirInfo to be used on the next row
   for (iter.First(); !iter.mAtEnd; iter.Next()) {
     iter.AccumulateOrPaintBlockDirSegment(aRenderingContext);
   }
 
   // Next, paint all of the inline-dir border segments from bStart to bEnd reuse
-  // the mVerInfo array to keep track of col widths and block-dir segments for
+  // the mBlockDirInfo array to keep track of col widths and block-dir segments for
   // corner calculations
   iter.Reset();
   for (iter.First(); !iter.mAtEnd; iter.Next()) {
     iter.AccumulateOrPaintInlineDirSegment(aRenderingContext);
   }
 }
 
 bool
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -295,17 +295,17 @@ public:
 
   /**
    * In quirks mode, the size of the table background is reduced
    * by the outer BC border. Compute the reduction needed.
    */
   nsMargin GetDeflationForBackground(nsPresContext* aPresContext) const;
 
   /** Get width of table + colgroup + col collapse: elements that
-   *  continue along the length of the whole left side.
+   *  continue along the length of the whole iStart side.
    *  see nsTablePainter about continuous borders
    */
   nscoord GetContinuousIStartBCBorderWidth() const;
   void SetContinuousIStartBCBorderWidth(nscoord aValue);
 
   friend class nsDelayedCalcBCBorders;
 
   void AddBCDamageArea(const mozilla::TableArea& aValue);
--- a/layout/tables/nsTablePainter.cpp
+++ b/layout/tables/nsTablePainter.cpp
@@ -314,41 +314,41 @@ TableBackgroundPainter::PaintTable(nsTab
     }
 
     // Ensure that mColGroups won't reallocate during the loop below, because
     // we grab references to its contents and need those to stay valid until
     // mColGroups is destroyed as part of TablePainter destruction.
     mColGroups.SetCapacity(colGroupFrames.Length());
 
     LogicalMargin border(wm);
-    /* BC left borders aren't stored on cols, but the previous column's
-       right border is the next one's left border.*/
-    //Start with table's left border.
-    nscoord lastLeftBorder = aTableFrame->GetContinuousIStartBCBorderWidth();
+    /* BC iStart borders aren't stored on cols, but the previous column's
+       iEnd border is the next one's iStart border.*/
+    //Start with table's iStart border.
+    nscoord lastIStartBorder = aTableFrame->GetContinuousIStartBCBorderWidth();
 
     for (nsTableColGroupFrame* cgFrame : colGroupFrames) {
       /*Create data struct for column group*/
       TableBackgroundData& cgData = *mColGroups.AppendElement(TableBackgroundData(cgFrame));
       if (mIsBorderCollapse && cgData.ShouldSetBCBorder()) {
-        border.IStart(wm) = lastLeftBorder;
+        border.IStart(wm) = lastIStartBorder;
         cgFrame->GetContinuousBCBorderWidth(wm, border);
         cgData.SetBCBorder(border.GetPhysicalMargin(wm));
       }
 
       /*Loop over columns in this colgroup*/
       for (nsTableColFrame* col = cgFrame->GetFirstColumn(); col;
            col = static_cast<nsTableColFrame*>(col->GetNextSibling())) {
         MOZ_ASSERT(size_t(col->GetColIndex()) == mCols.Length());
         // Store a reference to the colGroup in the ColData element.
         ColData& colData = *mCols.AppendElement(ColData(col, cgData));
         //Bring column mRect into table's coord system
         colData.mCol.mRect.MoveBy(cgData.mRect.x, cgData.mRect.y);
         if (mIsBorderCollapse) {
-          border.IStart(wm) = lastLeftBorder;
-          lastLeftBorder = col->GetContinuousBCBorderWidth(wm, border);
+          border.IStart(wm) = lastIStartBorder;
+          lastIStartBorder = col->GetContinuousBCBorderWidth(wm, border);
           if (colData.mCol.ShouldSetBCBorder()) {
             colData.mCol.SetBCBorder(border.GetPhysicalMargin(wm));
           }
         }
       }
     }
   }