nsTableCellMap::InsertRows shouldn't make damage area smaller, b=244135 p=malcolm.parsons r+sr=bz a=roc
authorfantasai.cvs@inkedblade.net
Mon, 15 Oct 2007 20:06:36 -0700
changeset 6984 ddffe9aaf5ddda87ba5f7ce9285060386c52be9a
parent 6983 36522a47a4a9aa7725b789adc7c1d7040b1864be
child 6985 aef31a7a7c230728e969d99a937f64d898748ca0
push id1
push userroot
push dateMon, 20 Oct 2014 17:29:22 +0000
reviewersroc
bugs244135
milestone1.9a9pre
nsTableCellMap::InsertRows shouldn't make damage area smaller, b=244135 p=malcolm.parsons r+sr=bz a=roc
layout/reftests/bugs/244135-2-ref.html
layout/reftests/bugs/244135-2.html
layout/reftests/bugs/reftest.list
layout/tables/nsCellMap.cpp
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/244135-2-ref.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>http://bugzilla.mozilla.org/show_bug.cgi?id=244135</title>
+<style type="text/css">
+table { border-collapse: collapse; }
+</style>
+</head>
+<body>
+<table border="1">
+<tbody>
+<tr>
+    <td>text</td>
+    <td>text</td>
+    <td>text</td>
+    <td>text</td>
+</tr>
+<tr>
+<td rowspan="4">td rowspan=4</td>
+<td>text</td>
+<td>text</td>
+<td>text
+</td>
+</tr>
+<tr>
+<td>text</td>
+
+<td>text</td>
+<td>text
+</td>
+</tr>
+<tr>
+<td>text</td>
+<td>text</td>
+<td>text
+
+
+</td>
+</tr>
+<tr>
+<td>text</td>
+<td>text</td>
+<td>text
+</td>
+</tr>
+</tbody>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/244135-2.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<title>http://bugzilla.mozilla.org/show_bug.cgi?id=244135</title>
+<style type="text/css">
+table { border-collapse: collapse; }
+</style>
+</head>
+<body>
+<table border="1">
+<tbody>
+<tr>
+    <td>text</td>
+    <td>text</td>
+    <td>text</td>
+    <td>text</td>
+</tr>
+<tr>
+<td rowspan="4">td rowspan=4</td>
+<td>text</td>
+<td>text</td>
+<td>text
+<script type="text/javascript">var v = document.body.offsetHeight;</script> 
+</td>
+</tr>
+<tr>
+<td>text</td>
+
+<td>text</td>
+<td>text
+</td>
+</tr>
+<tr>
+<td>text</td>
+<td>text</td>
+<td>text
+
+
+</td>
+</tr>
+<tr>
+<td>text</td>
+<td>text</td>
+<td>text
+</td>
+</tr>
+</tbody>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -96,16 +96,17 @@ fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") ==
 == 234964-1.html 234964-1-ref.html
 == 234964-2.html 234964-2-ref.html
 == 235593-1.html 235593-1-ref.html
 == 236539-1.html 236539-1-ref.html
 == 240470-1.html 240470-1-ref.html
 == 243266-1.html 243266-1-ref.html
 == 243302-1.html 243302-1-ref.html
 == 244135-1.html 244135-1-ref.html
+== 244135-2.html 244135-2-ref.html
 == 244932-1.html 244932-1-ref.html
 == 249982-1.html 249982-1-ref.html
 == 253701-1.html 253701-1-ref.html
 == 255820-1.html 255820-1-ref.html
 == 262151-1.html 262151-1-ref.html
 == 267353-1.html 267353-1-ref.html
 == 273681-1.html 273681-1-ref.html
 == 291078-1.html 291078-1-ref.html
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -560,18 +560,18 @@ nsTableCellMap::InsertRows(nsTableRowGro
   if ((numNewRows <= 0) || (aFirstRowIndex < 0)) ABORT0(); 
 
   PRInt32 rowIndex = aFirstRowIndex;
   nsCellMap* cellMap = mFirstMap;
   while (cellMap) {
     nsTableRowGroupFrame* rg = cellMap->GetRowGroup();
     if (rg == &aParent) {
       cellMap->InsertRows(*this, aRows, rowIndex, aConsiderSpans, aDamageArea);
-      aDamageArea.y = aFirstRowIndex;
-      aDamageArea.height = PR_MAX(0, GetRowCount() - aFirstRowIndex);
+      aDamageArea.y = PR_MIN(aFirstRowIndex, aDamageArea.y);
+      aDamageArea.height = PR_MAX(0, GetRowCount() - aDamageArea.y);
 #ifdef DEBUG_TABLE_CELLMAP 
       Dump("after InsertRows");
 #endif
       if (mBCInfo) {
         BCData* bcData;
         PRInt32 count = mBCInfo->mRightBorders.Count();
         if (aFirstRowIndex < count) {
           for (PRInt32 rowX = aFirstRowIndex; rowX < aFirstRowIndex + numNewRows; rowX++) {