expand the cellmap to cover empty content rows when rebuilding the cellmap bug 351326 r/sr=bzbarsky a=mtschrep
authorbmlk@gmx.de
Wed, 20 Feb 2008 21:11:36 -0800
changeset 11996 85b5439188ecacf21cc34e0c8d98690eec58b86c
parent 11995 42fd1dcee6d2cad8d5f42f087805c150e662e033
child 11997 2b49e8083d943eac928c12a11d949c64183af385
push id1
push userbsmedberg@mozilla.com
push dateThu, 20 Mar 2008 16:49:24 +0000
treeherdermozilla-central@61007906a1f8 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmtschrep
bugs351326
milestone1.9b4pre
expand the cellmap to cover empty content rows when rebuilding the cellmap bug 351326 r/sr=bzbarsky a=mtschrep
layout/tables/nsCellMap.cpp
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -2437,25 +2437,30 @@ void nsCellMap::RebuildConsideringCells(
     NS_ASSERTION (numOrigRows == aRowIndex, "Appending cells far beyond the last row");
     for (PRInt32 cellX = 0; cellX < numNewCells; cellX++) {
       nsTableCellFrame* cell = (nsTableCellFrame*)aCellFrames->ElementAt(cellX);
       if (cell) {
         AppendCell(aMap, cell, aRowIndex, PR_FALSE, aDamageArea);
       }
     }
   } 
-
+  
   // delete the old cell map
   for (rowX = 0; rowX < numOrigRows; rowX++) {
     CellDataArray& row = origRows[rowX];
     PRUint32 len = row.Length();
     for (PRUint32 colX = 0; colX < len; colX++) {
       DestroyCellData(row.SafeElementAt(colX));
     }
   }
+  // expand the cellmap to cover empty content rows
+  if (mRows.Length() < mContentRowCount) {
+    Grow(aMap, mContentRowCount - mRows.Length());
+  }
+
 }
 
 void nsCellMap::RemoveCell(nsTableCellMap&   aMap,
                            nsTableCellFrame* aCellFrame,
                            PRInt32           aRowIndex,
                            nsRect&           aDamageArea)
 {
   PRUint32 numRows = mRows.Length();