Bug 1389295 - Confine BCDamageArea while appending cells to within the table area and remove assert for test 460637-2.xhtml r?mats draft
authorNeerja Pancholi <npancholi@mozilla.com>
Thu, 24 Aug 2017 17:39:44 -0700
changeset 656977 8325fa62a4ea6a6dfc4d41e783d7ceeb684103e8
parent 656976 13d241d08912be31884f9d0d0e805b25343d6c0a
child 729302 97190d8497f09e32a3840f4021971e77564295b2
push id77392
push userbmo:npancholi@mozilla.com
push dateThu, 31 Aug 2017 22:56:51 +0000
reviewersmats
bugs1389295, 460637
milestone57.0a1
Bug 1389295 - Confine BCDamageArea while appending cells to within the table area and remove assert for test 460637-2.xhtml r?mats MozReview-Commit-ID: 6lJahcAmlIN
layout/tables/crashtests/crashtests.list
layout/tables/nsCellMap.cpp
--- a/layout/tables/crashtests/crashtests.list
+++ b/layout/tables/crashtests/crashtests.list
@@ -112,17 +112,17 @@ load 444431-1.html
 load 444702-1.html
 load 448988-1.xhtml
 load 450311-1.html
 load 451170.html
 load 451355-1.html
 load 456041.html
 load 457115.html
 load 460637-1.xhtml
-asserts(1) load 460637-2.xhtml # bug 1389295
+load 460637-2.xhtml
 load 460637-3.xhtml
 load 462849.xhtml
 load 467141-1.html
 load 488388-1.html
 load 501870-1.html
 load 509562-1.xhtml
 load 512749-1.html
 load 513732-1.html
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -1486,18 +1486,18 @@ nsCellMap::AppendCell(nsTableCellMap&   
     if (!origData) ABORT1(origData);
     SetDataAt(aMap, *origData, aRowIndex, startColIndex);
   }
 
   if (aRebuildIfNecessary) {
     //the caller depends on the damageArea
     // The special case for zeroRowSpan is to adjust for the '2' in
     // GetRowSpanForNewCell.
-    uint32_t height = zeroRowSpan ? endRowIndex - aRowIndex  :
-                                    1 + endRowIndex - aRowIndex;
+    uint32_t height = std::min(zeroRowSpan ? rowSpan - 1 : rowSpan,
+                               GetRowCount() - aRowIndex);
     SetDamageArea(startColIndex, aRgFirstRowIndex + aRowIndex,
                   1 + endColIndex - startColIndex, height, aDamageArea);
   }
 
   if (!aCellFrame) {
     return origData;
   }