Bug 1484126 - part 11: Make all CellData users refer CellData.mRowSpan directly r=m_kato
authorMasayuki Nakano <masayuki@d-toybox.com>
Mon, 15 Oct 2018 08:14:18 +0000
changeset 499836 6ab5dd75fbf4c7d8b02ee5d538ab69bc26fc087d
parent 499835 3e9c08f4f705ff9c789de57b68207d87b6045416
child 499837 e0cea47221b84d9ad48ad0f54bffaa5b280d76cd
push id1864
push userffxbld-merge
push dateMon, 03 Dec 2018 15:51:40 +0000
treeherdermozilla-release@f040763d99ad [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato
bugs1484126
milestone64.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 1484126 - part 11: Make all CellData users refer CellData.mRowSpan directly r=m_kato Differential Revision: https://phabricator.services.mozilla.com/D8348
editor/libeditor/HTMLTableEditor.cpp
--- a/editor/libeditor/HTMLTableEditor.cpp
+++ b/editor/libeditor/HTMLTableEditor.cpp
@@ -206,17 +206,16 @@ HTMLEditor::InsertTableCellsWithTransact
   IgnoredErrorResult ignoredError;
   CellData cellDataAtSelection(*this, *table, startRowIndex, startColIndex,
                                ignoredError);
   if (NS_WARN_IF(cellDataAtSelection.FailedOrNotFound())) {
     return NS_ERROR_FAILURE;
   }
   MOZ_ASSERT(curCell == cellDataAtSelection.mElement);
 
-  // int32_t rowSpan =          cellDataAtSelection.mRowSpan;
   int32_t    colSpan =          cellDataAtSelection.mColSpan;
   // int32_t actualRowSpan =    cellDataAtSelection.mEffectiveRowSpan;
   // int32_t actualColSpan =    cellDataAtSelection.mEffectiveColSpan;
   // bool    isSelected =       cellDataAtSelection.mIsSelected;
 
   int32_t newCellIndex;
   switch (aInsertPosition) {
     case InsertPosition::eBeforeSelectedCell:
@@ -443,17 +442,16 @@ HTMLEditor::InsertTableColumnsWithTransa
   IgnoredErrorResult ignoredError;
   CellData cellDataAtSelection(*this, *table, startRowIndex, startColIndex,
                                ignoredError);
   if (NS_WARN_IF(cellDataAtSelection.FailedOrNotFound())) {
     return NS_ERROR_FAILURE;
   }
   MOZ_ASSERT(curCell == cellDataAtSelection.mElement);
 
-  // int32_t rowSpan =          cellDataAtSelection.mRowSpan;
   int32_t    colSpan =          cellDataAtSelection.mColSpan;
   // int32_t actualRowSpan =    cellDataAtSelection.mEffectiveRowSpan;
   int32_t    actualColSpan =    cellDataAtSelection.mEffectiveColSpan;
   // bool    isSelected =       cellDataAtSelection.mIsSelected;
 
   ErrorResult error;
   TableSize tableSize(*this, *table, error);
   if (NS_WARN_IF(error.Failed())) {
@@ -511,17 +509,16 @@ HTMLEditor::InsertTableColumnsWithTransa
   for (int32_t rowIndex = 0; rowIndex < tableSize.mRowCount; rowIndex++) {
     if (startColIndex < tableSize.mColumnCount) {
       // We are inserting before an existing column.
       CellData cellData(*this, *table, rowIndex, startColIndex, ignoredError);
       if (NS_WARN_IF(cellData.FailedOrNotFound())) {
         return NS_ERROR_FAILURE;
       }
 
-      // int32_t rowSpan =                cellData.mRowSpan;
       int32_t    colSpan =                cellData.mColSpan;
       // int32_t actualRowSpan =          cellData.mEffectiveRowSpan;
       // int32_t actualColSpan =          cellData.mEffectiveColSpan;
       // bool    isSelected =             cellData.mIsSelected;
 
       // Don't fail entire process if we fail to find a cell (may fail just in
       // particular rows with < adequate cells per row).
       // XXX So, here wants to know whether the CellData actually failed above.
@@ -642,17 +639,16 @@ HTMLEditor::InsertTableRowsWithTransacti
   IgnoredErrorResult ignoredError;
   CellData cellDataAtSelection(*this, *table, startRowIndex, startColIndex,
                                ignoredError);
   if (NS_WARN_IF(cellDataAtSelection.FailedOrNotFound())) {
     return NS_ERROR_FAILURE;
   }
   MOZ_ASSERT(curCell == cellDataAtSelection.mElement);
 
-  int32_t    rowSpan =          cellDataAtSelection.mRowSpan;
   // int32_t colSpan =          cellDataAtSelection.mColSpan;
   int32_t    actualRowSpan =    cellDataAtSelection.mEffectiveRowSpan;
   // int32_t actualColSpan =    cellDataAtSelection.mEffectiveColSpan;
   // bool isSelected =          cellDataAtSelection.mIsSelected;
 
   ErrorResult error;
   TableSize tableSize(*this, *table, error);
   if (NS_WARN_IF(error.Failed())) {
@@ -672,17 +668,17 @@ HTMLEditor::InsertTableRowsWithTransacti
       break;
     case InsertPosition::eAfterSelectedCell:
       // Use row after current cell.
       startRowIndex += actualRowSpan;
 
       // Detect when user is adding after a rowspan=0 case.
       // Assume they want to stop the "0" behavior and really add a new row.
       // Thus we set the rowspan to its true value.
-      if (!rowSpan) {
+      if (!cellDataAtSelection.mRowSpan) {
         SetRowSpan(cellDataAtSelection.mElement, actualRowSpan);
       }
       break;
     default:
       MOZ_ASSERT_UNREACHABLE("Invalid InsertPosition");
   }
 
   // We control selection resetting after the insert.
@@ -699,34 +695,34 @@ HTMLEditor::InsertTableRowsWithTransacti
     // row to adjust for colspan effects while we count how many cells are
     // needed.
     for (int32_t colIndex = 0, actualColSpan = 0;; colIndex += actualColSpan) {
       CellData cellData(*this, *table, startRowIndex, colIndex, ignoredError);
       if (cellData.FailedOrNotFound()) {
         break; // Perhaps, we reach end of the row.
       }
 
-      int32_t    rowSpan =                    cellData.mRowSpan;
       // int32_t colSpan =                    cellData.mColSpan;
       // int32_t actualRowSpan =              cellData.mEffectiveRowSpan;
                  actualColSpan =              cellData.mEffectiveColSpan;
       // bool    isSelected =                 cellData.mIsSelected;
 
       // XXX So, this is impossible case. Will be removed.
       if (NS_WARN_IF(!cellData.mElement)) {
         actualColSpan = 1;
         continue;
       }
 
       if (cellData.IsSpannedFromOtherRow()) {
         // We have a cell spanning this location.  Increase its rowspan.
         // Note that if rowspan is 0, we do nothing since that cell should
         // automatically extend into the new row.
-        if (rowSpan > 0) {
-          SetRowSpan(cellData.mElement, rowSpan + aNumberOfRowsToInsert);
+        if (cellData.mRowSpan > 0) {
+          SetRowSpan(cellData.mElement,
+                     cellData.mRowSpan + aNumberOfRowsToInsert);
         }
         continue;
       }
 
       cellsInRow += actualColSpan;
       if (!cellForRowParent) {
         cellForRowParent = std::move(cellData.mElement);
       }
@@ -742,23 +738,22 @@ HTMLEditor::InsertTableRowsWithTransacti
     // but we must compensate for all cells with rowspan = 0 in the last row.
     const int32_t kLastRowIndex = tableSize.mRowCount - 1;
     for (int32_t colIndex = 0, actualColSpan = 0;; colIndex += actualColSpan) {
       CellData cellData(*this, *table, kLastRowIndex, colIndex, ignoredError);
       if (cellData.FailedOrNotFound()) {
         break; // Perhaps, we reach end of the row.
       }
 
-      int32_t    rowSpan =                    cellData.mRowSpan;
       // int32_t colSpan =                    cellData.mColSpan;
       // int32_t actualRowSpan =              cellData.mEffectiveRowSpan;
                  actualColSpan =              cellData.mEffectiveColSpan;
       // bool    isSelected =                 cellData.mIsSelected;
 
-      if (!rowSpan) {
+      if (!cellData.mRowSpan) {
         MOZ_ASSERT(cellsInRow >= actualColSpan);
         cellsInRow -= actualColSpan;
       }
 
       // Save cell from the last row that we will use below
       if (!cellForRowParent && !cellData.IsSpannedFromOtherRow()) {
         cellForRowParent = std::move(cellData.mElement);
       }
@@ -1394,17 +1389,16 @@ HTMLEditor::DeleteTableColumnWithTransac
     // Failure means that there is no more row in the table.  In this case,
     // we shouldn't return error since we just reach the end of the table.
     // XXX Should distinguish whether CellData returns error or just not found
     //     later.
     if (cellData.FailedOrNotFound()) {
       return NS_OK;
     }
 
-    // int32_t rowSpan =             cellData.mRowSpan;
     int32_t    colSpan =             cellData.mColSpan;
     int32_t    actualRowSpan =       cellData.mEffectiveRowSpan;
     // int32_t actualColSpan =       cellData.mEffectiveColSpan;
     // bool    isSelected =          cellData.mIsSelected;
 
     // Find cells that don't start in column we are deleting.
     MOZ_ASSERT(colSpan >= 0);
     if (cellData.IsSpannedFromOtherColumn() || colSpan != 1) {
@@ -1668,17 +1662,16 @@ HTMLEditor::DeleteTableRowWithTransactio
   while (aRowIndex < tableSize.mRowCount &&
          columnIndex < tableSize.mColumnCount) {
     CellData cellData(*this, aTableElement, aRowIndex, columnIndex,
                       ignoredError);
     if (NS_WARN_IF(cellData.FailedOrNotFound())) {
       return NS_ERROR_FAILURE;
     }
 
-    int32_t    rowSpan =             cellData.mRowSpan;
     // int32_t colSpan =             cellData.mColSpan;
     int32_t    actualRowSpan =       cellData.mEffectiveRowSpan;
     int32_t    actualColSpan =       cellData.mEffectiveColSpan;
     // bool    isSelected =          cellData.mIsSelected;
 
     // XXX So, we should distinguish if CellDate returns error or just not
     //     found later.
     if (!cellData.mElement) {
@@ -1686,26 +1679,26 @@ HTMLEditor::DeleteTableRowWithTransactio
     }
 
     // Compensate for cells that don't start or extend below the row we are
     // deleting.
     if (cellData.IsSpannedFromOtherRow()) {
       // If a cell starts in row above us, decrease its rowspan to keep table
       // rectangular but we don't need to do this if rowspan=0, since it will
       // be automatically adjusted.
-      if (rowSpan > 0) {
+      if (cellData.mRowSpan > 0) {
         // Build list of cells to change rowspan.  We can't do it now since
         // it upsets cell map, so we will do it after deleting the row.
         int32_t newRowSpanValue =
           std::max(cellData.NumberOfPrecedingRows(), actualRowSpan - 1);
         spanCellArray.AppendElement(
                         SpanCell(cellData.mElement, newRowSpanValue));
       }
     } else {
-      if (rowSpan > 1) {
+      if (cellData.mRowSpan > 1) {
         // Cell spans below row to delete, so we must insert new cells to
         // keep rows below.  Note that we test "rowSpan" so we don't do this
         // if rowSpan = 0 (automatic readjustment).
         int32_t aboveRowToInsertNewCellInto =
           cellData.NumberOfPrecedingRows() + 1;
         int32_t numOfRawSpanRemainingBelow = actualRowSpan - 1;
         nsresult rv =
           SplitCellIntoRows(&aTableElement,
@@ -1890,17 +1883,16 @@ HTMLEditor::SelectBlockOfCells(Element* 
     for (int32_t col = minColumn, actualColSpan = 0;
          col <= maxColumn;
          col += std::max(actualColSpan, 1)) {
       CellData cellData(*this, *table, row, col, ignoredError);
       if (cellData.FailedOrNotFound()) {
         return NS_ERROR_FAILURE;
       }
 
-      // int32_t rowSpan =             cellData.mRowSpan;
       // int32_t colSpan =             cellData.mColSpan;
       // int32_t actualRowSpan =       cellData.mEffectiveRowSpan;
                  actualColSpan =       cellData.mEffectiveColSpan;
       bool       isSelected =          cellData.mIsSelected;
 
       // Skip cells that already selected or are spanned from previous locations
       // XXX So, we should distinguish whether CellData returns error or just
       //     not found later.
@@ -1962,17 +1954,16 @@ HTMLEditor::SelectAllTableCells()
          col < tableSize.mColumnCount;
          col += std::max(actualColSpan, 1)) {
       CellData cellData(*this, *table, row, col, ignoredError);
       if (NS_WARN_IF(cellData.FailedOrNotFound())) {
         rv = NS_ERROR_FAILURE;
         break;
       }
 
-      // int32_t rowSpan =             cellData.mRowSpan;
       // int32_t colSpan =             cellData.mColSpan;
       // int32_t actualRowSpan =       cellData.mEffectiveRowSpan;
                  actualColSpan =       cellData.mEffectiveColSpan;
       // bool    isSelected =          cellData.mIsSelected;
 
       // Skip cells that are spanned from previous rows or columns
       // XXX So, we should distinguish whether CellData returns error or just
       //     not found later.
@@ -2053,17 +2044,16 @@ HTMLEditor::SelectTableRow()
        col < tableSize.mColumnCount;
        col += std::max(actualColSpan, 1)) {
     CellData cellData(*this, *table, startRowIndex, col, ignoredError);
     if (NS_WARN_IF(cellData.FailedOrNotFound())) {
       rv = NS_ERROR_FAILURE;
       break;
     }
 
-    // int32_t rowSpan =             cellData.mRowSpan;
     // int32_t colSpan =             cellData.mColSpan;
     // int32_t actualRowSpan =       cellData.mEffectiveRowSpan;
                actualColSpan =       cellData.mEffectiveColSpan;
     // bool    isSelected =          cellData.mIsSelected;
 
     // Skip cells that are spanned from previous rows or columns
     // XXX So, we should distinguish whether CellData returns error or just
     //     not found later.
@@ -2139,17 +2129,16 @@ HTMLEditor::SelectTableColumn()
        row < tableSize.mRowCount;
        row += std::max(actualRowSpan, 1)) {
     CellData cellData(*this, *table, row, startColIndex, ignoredError);
     if (NS_WARN_IF(cellData.FailedOrNotFound())) {
       rv = NS_ERROR_FAILURE;
       break;
     }
 
-    // int32_t rowSpan =             cellData.mRowSpan;
     // int32_t colSpan =             cellData.mColSpan;
                actualRowSpan =       cellData.mEffectiveRowSpan;
     // int32_t actualColSpan =       cellData.mEffectiveColSpan;
     // bool    isSelected =          cellData.mIsSelected;
 
     // Skip cells that are spanned from previous rows or columns
     // XXX So, we should distinguish whether CellData returns error or just
     //     not found later.
@@ -2279,17 +2268,16 @@ HTMLEditor::SplitCellIntoColumns(Element
   }
 
   IgnoredErrorResult ignoredError;
   CellData cellData(*this, *aTable, aRowIndex, aColIndex, ignoredError);
   if (NS_WARN_IF(cellData.FailedOrNotFound())) {
     return NS_ERROR_FAILURE;
   }
 
-  // int32_t rowSpan =             cellData.mRowSpan;
   // int32_t colSpan =             cellData.mColSpan;
   int32_t    actualRowSpan =       cellData.mEffectiveRowSpan;
   int32_t    actualColSpan =       cellData.mEffectiveColSpan;
   // bool    isSelected =          cellData.mIsSelected;
 
   // We can't split!
   if (actualColSpan <= 1 || (aColSpanLeft + aColSpanRight) > actualColSpan) {
     return NS_OK;
@@ -2339,17 +2327,16 @@ HTMLEditor::SplitCellIntoRows(Element* a
   }
 
   IgnoredErrorResult ignoredError;
   CellData cellData(*this, *aTable, aRowIndex, aColIndex, ignoredError);
   if (NS_WARN_IF(cellData.FailedOrNotFound())) {
     return NS_ERROR_FAILURE;
   }
 
-  // int32_t rowSpan =             cellData.mRowSpan;
   // int32_t colSpan =             cellData.mColSpan;
   int32_t    actualRowSpan =       cellData.mEffectiveRowSpan;
   int32_t    actualColSpan =       cellData.mEffectiveColSpan;
   // bool    isSelected =          cellData.mIsSelected;
 
   // We can't split!
   if (actualRowSpan <= 1 || (aRowSpanAbove + aRowSpanBelow) > actualRowSpan) {
     return NS_OK;
@@ -2376,17 +2363,16 @@ HTMLEditor::SplitCellIntoRows(Element* a
     // XXX According to the comment, this does not assume that
     //     FixRowSpan() doesn't work well and user can create non-rectangular
     //     table.  So, we should not return error when CellData cannot find
     //     a cell.
     if (NS_WARN_IF(cellDataAtInsertionPoint.FailedOrNotFound())) {
       return NS_ERROR_FAILURE;
     }
 
-    // int32_t rowSpan2 =       cellDataAtInsertionPoint.mRowSpan;
     // int32_t colSpan2 =       cellDataAtInsertionPoint.mColSpan;
     // int32_t actualRowSpan2 = cellDataAtInsertionPoint.mEffectiveRowSpan;
                actualColSpan2 = cellDataAtInsertionPoint.mEffectiveColSpan;
     // bool    isSelected2 =    cellDataAtInsertionPoint.mIsSelected;
 
     // FYI: Don't use std::move() here since the following checks will use
     //      utility methods of cellDataAtInsertionPoint, but some of them
     //      check whether its mElement is not nullptr.
@@ -2600,17 +2586,16 @@ HTMLEditor::JoinTableCells(bool aMergeNo
       for (int32_t actualColSpan2 = 0;
            colIndex < tableSize.mColumnCount;
            colIndex += std::max(actualColSpan2, 1)) {
         CellData cellData(*this, *table, rowIndex, colIndex, ignoredError);
         if (NS_WARN_IF(cellData.FailedOrNotFound())) {
           return NS_ERROR_FAILURE;
         }
 
-        // int32_t rowSpan2 =                cellData.mRowSpan;
         // int32_t colSpan2 =                cellData.mColSpan;
         // int32_t actualRowSpan2 =          cellData.mEffectiveRowSpan;
                    actualColSpan2 =          cellData.mEffectiveColSpan;
         bool       isSelected2 =             cellData.mIsSelected;
 
         if (isSelected2) {
           if (!cellFoundInRow) {
             // We've just found the first selected cell in this row
@@ -2681,17 +2666,16 @@ HTMLEditor::JoinTableCells(bool aMergeNo
       for (int32_t colIndex = 0, actualColSpan2 = 0;
            colIndex < tableSize.mColumnCount;
            colIndex += std::max(actualColSpan2, 1)) {
         CellData cellData(*this, *table, rowIndex, colIndex, ignoredError);
         if (NS_WARN_IF(cellData.FailedOrNotFound())) {
           return NS_ERROR_FAILURE;
         }
 
-        // int32_t rowSpan2 =             cellData.mRowSpan;
         // int32_t colSpan2 =             cellData.mColSpan;
         // int32_t actualRowSpan2 =       cellData.mEffectiveRowSpan;
                    actualColSpan2 =       cellData.mEffectiveColSpan;
         bool       isSelected2 =          cellData.mIsSelected;
 
         // If this is 0, we are past last cell in row, so exit the loop
         if (!actualColSpan2) {
           break;
@@ -2802,32 +2786,30 @@ HTMLEditor::JoinTableCells(bool aMergeNo
     // cell.
     IgnoredErrorResult ignoredError;
     CellData leftCellData(*this, *table, startRowIndex, startColIndex,
                           ignoredError);
     if (NS_WARN_IF(leftCellData.FailedOrNotFound())) {
       return NS_ERROR_FAILURE;
     }
 
-    // int32_t rowSpan =                   leftCellData.mRowSpan;
     // int32_t colSpan =                   leftCellData.mColSpan;
     int32_t    actualRowSpan =             leftCellData.mEffectiveRowSpan;
     int32_t    actualColSpan =             leftCellData.mEffectiveColSpan;
     // bool    isSelected =                leftCellData.mIsSelected;
 
     // Get data for cell to the right.
     CellData rightCellData(*this, *table,
                            leftCellData.mFirst.mRow,
                            leftCellData.mFirst.mColumn + actualColSpan,
                            ignoredError);
     if (NS_WARN_IF(rightCellData.FailedOrNotFound())) {
       return NS_ERROR_FAILURE;
     }
 
-    // int32_t rowSpan2 =             rightCellData.mRowSpan;
     // int32_t colSpan2 =             rightCellData.mColSpan;
     int32_t    actualRowSpan2 =       rightCellData.mEffectiveRowSpan;
     int32_t    actualColSpan2 =       rightCellData.mEffectiveColSpan;
     // bool    isSelected2 =          rightCellData.mIsSelected;
 
     // XXX So, this does not assume that CellData returns error when just not
     //     found.  We need to fix this later.
     if (!rightCellData.mElement) {
@@ -2984,59 +2966,58 @@ HTMLEditor::FixBadRowSpan(Element* aTabl
     // CellData passes if cell is missing from cellmap
     // XXX If <table> has large rowspan value or colspan value than actual
     //     cells, we may hit error.  So, this method is always failed to
     //     "fix" the rowspan...
     if (NS_WARN_IF(cellData.FailedOrNotFound())) {
       return NS_ERROR_FAILURE;
     }
 
-    int32_t    rowSpan =             cellData.mRowSpan;
     // int32_t colSpan =             cellData.mColSpan;
     // int32_t actualRowSpan =       cellData.mEffectiveRowSpan;
                actualColSpan =       cellData.mEffectiveColSpan;
     // bool    isSelected =          cellData.mIsSelected;
 
     // XXX So, this does not assume that CellData returns error when just not
     //     found.  We need to fix this later.
     if (!cellData.mElement) {
       break;
     }
 
-    if (rowSpan > 0 &&
+    if (cellData.mRowSpan > 0 &&
         !cellData.IsSpannedFromOtherRow() &&
-        (rowSpan < minRowSpan || minRowSpan == -1)) {
-      minRowSpan = rowSpan;
+        (cellData.mRowSpan < minRowSpan || minRowSpan == -1)) {
+      minRowSpan = cellData.mRowSpan;
     }
     NS_ASSERTION((actualColSpan > 0),"ActualColSpan = 0 in FixBadRowSpan");
   }
   if (minRowSpan > 1) {
     // The amount to reduce everyone's rowspan
     // so at least one cell has rowspan = 1
     int32_t rowsReduced = minRowSpan - 1;
     for (int32_t colIndex = 0, actualColSpan = 0;
          colIndex < tableSize.mColumnCount;
          colIndex += std::max(actualColSpan, 1)) {
       CellData cellData(*this, *aTable, aRowIndex, colIndex, ignoredError);
       if (NS_WARN_IF(cellData.FailedOrNotFound())) {
         return NS_ERROR_FAILURE;
       }
 
-      int32_t    rowSpan =             cellData.mRowSpan;
       // int32_t colSpan =             cellData.mColSpan;
       // int32_t actualRowSpan =       cellData.mEffectiveRowSpan;
                  actualColSpan =       cellData.mEffectiveColSpan;
       // bool    isSelected =          cellData.mIsSelected;
 
       // Fixup rowspans only for cells starting in current row
       // XXX So, this does not assume that CellData returns error when just
       //     not found a cell.  Fix this later.
-      if (cellData.mElement && rowSpan > 0 &&
+      if (cellData.mElement && cellData.mRowSpan > 0 &&
           !cellData.IsSpannedFromOtherRowOrColumn()) {
-        nsresult rv = SetRowSpan(cellData.mElement, rowSpan-rowsReduced);
+        nsresult rv =
+          SetRowSpan(cellData.mElement, cellData.mRowSpan - rowsReduced);
         if (NS_WARN_IF(NS_FAILED(rv))) {
           return rv;
         }
       }
       NS_ASSERTION((actualColSpan > 0),"ActualColSpan = 0 in FixBadRowSpan");
     }
   }
   tableSize.Update(*this, *aTable, error);
@@ -3072,17 +3053,16 @@ HTMLEditor::FixBadColSpan(Element* aTabl
     // CellData passes if cell is missing from cellmap
     // XXX If <table> has large rowspan value or colspan value than actual
     //     cells, we may hit error.  So, this method is always failed to
     //     "fix" the colspan...
     if (NS_WARN_IF(cellData.FailedOrNotFound())) {
       return NS_ERROR_FAILURE;
     }
 
-    // int32_t rowSpan =             cellData.mRowSpan;
     int32_t    colSpan =             cellData.mColSpan;
                actualRowSpan =       cellData.mEffectiveRowSpan;
     // int32_t actualColSpan =       cellData.mEffectiveColSpan;
     // bool    isSelected =          cellData.mIsSelected;
 
     // XXX So, this does not assume that CellData returns error when just
     //     not found a cell.  Fix this later.
     if (!cellData.mElement) {
@@ -3102,17 +3082,16 @@ HTMLEditor::FixBadColSpan(Element* aTabl
     for (int32_t rowIndex = 0, actualRowSpan = 0;
          rowIndex < tableSize.mRowCount;
          rowIndex += std::max(actualRowSpan, 1)) {
       CellData cellData(*this, *aTable, rowIndex, aColIndex, ignoredError);
       if (NS_WARN_IF(cellData.FailedOrNotFound())) {
         return NS_ERROR_FAILURE;
       }
 
-      // int32_t rowSpan =             cellData.mRowSpan;
       int32_t    colSpan =             cellData.mColSpan;
                  actualRowSpan =       cellData.mEffectiveRowSpan;
       // int32_t actualColSpan =       cellData.mEffectiveColSpan;
       // bool    isSelected =          cellData.mIsSelected;
 
       // Fixup colspans only for cells starting in current column
       // XXX So, this does not assume that CellData returns error when just
       //     not found a cell.  Fix this later.
@@ -3214,17 +3193,16 @@ HTMLEditor::NormalizeTable(Selection& aS
       // NOTE: This is a *real* failure.
       // CellData passes if cell is missing from cellmap
       // XXX So, this method assumes that CellData won't return error when
       //     just not found.  Fix this later.
       if (NS_WARN_IF(cellData.FailedOrNotFound())) {
         return NS_ERROR_FAILURE;
       }
 
-      // int32_t rowSpan =                    cellData.mRowSpan;
       // int32_t colSpan =                    cellData.mColSpan;
       // int32_t actualRowSpan =              cellData.mEffectiveRowSpan;
       // int32_t actualColSpan =              cellData.mEffectiveColSpan;
       // bool    isSelected =                 cellData.mIsSelected;
 
       if (cellData.mElement) {
         // Save the last cell found in the same row we are scanning
         if (!cellData.IsSpannedFromOtherRow()) {
@@ -3367,17 +3345,16 @@ HTMLEditor::GetNumberOfCellsInRow(Elemen
     // Failure means that there is no more cell in the row.  In this case,
     // we shouldn't return error since we just reach the end of the row.
     // XXX So, this method assumes that CellData won't return error when
     //     just not found.  Fix this later.
     if (cellData.FailedOrNotFound()) {
       break;
     }
 
-    // int32_t rowSpan =                    cellData.mRowSpan;
     // int32_t colSpan =                    cellData.mColSpan;
     // int32_t actualRowSpan =              cellData.mEffectiveRowSpan;
     int32_t    actualColSpan =              cellData.mEffectiveColSpan;
     // bool    isSelected =                 cellData.mIsSelected;
 
     if (cellData.mElement) {
       // Only count cells that start in row we are working with
       if (!cellData.IsSpannedFromOtherRow()) {
@@ -4352,17 +4329,16 @@ HTMLEditor::AllCellsInRowSelected(Elemen
   for (int32_t col = 0, actualColSpan = 0;
        col < aNumberOfColumns;
        col += std::max(actualColSpan, 1)) {
     CellData cellData(*this, *aTable, aRowIndex, col, ignoredError);
     if (NS_WARN_IF(cellData.FailedOrNotFound())) {
       return false;
     }
 
-    // int32_t rowSpan =             cellData.mRowSpan;
     // int32_t colSpan =             cellData.mColSpan;
     // int32_t actualRowSpan =       cellData.mEffectiveRowSpan;
                actualColSpan =       cellData.mEffectiveColSpan;
     bool       isSelected =          cellData.mIsSelected;
 
     // If no cell, we may have a "ragged" right edge, so return TRUE only if
     // we already found a cell in the row.
     // XXX So, this does not assume that CellData returns error when just
@@ -4396,17 +4372,16 @@ HTMLEditor::AllCellsInColumnSelected(Ele
   for (int32_t row = 0, actualRowSpan = 0;
        row < aNumberOfRows;
        row += std::max(actualRowSpan, 1)) {
     CellData cellData(*this, *aTable, row, aColIndex, ignoredError);
     if (NS_WARN_IF(cellData.FailedOrNotFound())) {
       return false;
     }
 
-    // int32_t rowSpan =             cellData.mRowSpan;
     // int32_t colSpan =             cellData.mColSpan;
                actualRowSpan =       cellData.mEffectiveRowSpan;
     // int32_t actualColSpan =       cellData.mEffectiveColSpan;
     bool       isSelected =          cellData.mIsSelected;
 
     // If no cell, we must have a "ragged" right edge on the last column so
     // return TRUE only if we already found a cell in the row.
     // XXX So, this does not assume that CellData returns error when just