bug 378935 the border collapse code relies on having mutliple dead cell data entries in a row r=bzbarsky
authorBernd <bmlk@gmx.de>
Sat, 06 Mar 2010 10:53:04 +0100
changeset 39021 db38e530c170da57052b5cce7d90f47655bb0490
parent 39020 76ff2857fdafeb93d3310b290651bf6f9736662b
child 39022 26e6af3b3df7ae39c5c2ea6652ede0bfcc4d7aa0
push id11981
push userbmlk@gmx.de
push dateSat, 06 Mar 2010 09:54:28 +0000
treeherderautoland@db38e530c170 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbzbarsky
bugs378935
milestone1.9.3a3pre
bug 378935 the border collapse code relies on having mutliple dead cell data entries in a row r=bzbarsky
layout/reftests/bugs/378933-1-ref.html
layout/reftests/bugs/378933-1.html
layout/reftests/bugs/378935-1-ref.html
layout/reftests/bugs/378935-1.html
layout/reftests/bugs/378937-1-ref.html
layout/reftests/bugs/378937-1.html
layout/reftests/bugs/reftest.list
layout/tables/nsCellMap.cpp
layout/tables/nsTableFrame.cpp
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/378933-1-ref.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Testcase, border-collapse invalidation/repaint bug</title>
+<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html">
+<!--
+Reduced from
+http://en.wikipedia.org/wiki/French_presidential_election%2C_2007
+-->
+<style type="text/css">
+
+html, body { height: 100%; }
+td { border: thin solid; }
+td.noborder{border: thin none;}
+</style>
+</head>
+<body>
+
+
+<table style="width: 95%; height: 95%; border-collapse: collapse;">
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td class="noborder">&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td class="noborder">&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td class="noborder">&nbsp;</td>
+<td class="noborder">&nbsp;</td>
+
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td class="noborder">&nbsp;</td>
+<td class="noborder">&nbsp;</td>
+
+</tr>
+</table>
+
+
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/378933-1.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Testcase, border-collapse invalidation/repaint bug</title>
+<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html">
+<!--
+Reduced from
+http://en.wikipedia.org/wiki/French_presidential_election%2C_2007
+-->
+<style type="text/css">
+
+html, body { height: 100%; }
+td { border: thin solid; }
+
+
+</style>
+</head>
+<body>
+
+
+<table style="width: 95%; height: 95%; border-collapse: collapse;">
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+</tr>
+</table>
+
+
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/378935-1-ref.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Testcase, border-collapse invalidation/repaint bug</title>
+<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html">
+<!--
+Reduced from
+http://en.wikipedia.org/wiki/French_presidential_election%2C_2007
+-->
+<style type="text/css">
+
+html, body { height: 100%; }
+col { border: thin solid; }
+
+</style>
+</head>
+<body>
+
+
+<table style="width: 95%; height: 95%; border-collapse: collapse;">
+<col></col>
+<col></col>
+<col></col>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+</table>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/378935-1.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Testcase, border-collapse invalidation/repaint bug</title>
+<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html">
+<!--
+Reduced from
+http://en.wikipedia.org/wiki/French_presidential_election%2C_2007
+-->
+<style type="text/css">
+
+html, body { height: 100%; }
+col { border: thin solid; }
+
+</style>
+</head>
+<body>
+
+
+<table style="width: 95%; height: 95%; border-collapse: collapse;">
+<col></col>
+<col></col>
+<col></col>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+</tr>
+</table>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/378937-1-ref.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Testcase, border-collapse invalidation/repaint bug</title>
+<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html">
+<!--
+Reduced from
+http://en.wikipedia.org/wiki/French_presidential_election%2C_2007
+-->
+<style type="text/css">
+
+html, body { height: 100%; }
+col { border: thin solid; }
+
+</style>
+</head>
+<body>
+
+<table style="width: 50%; height: 50%; border-collapse: collapse;">
+<col></col>
+<col></col>
+<col></col>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+</table>
+
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/378937-1.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title>Testcase, border-collapse invalidation/repaint bug</title>
+<link rel="copyright" href="http://www.gnu.org/copyleft/fdl.html">
+<!--
+Reduced from
+http://en.wikipedia.org/wiki/French_presidential_election%2C_2007
+-->
+<style type="text/css">
+
+html, body { height: 100%; }
+col { border: thin solid; }
+
+</style>
+</head>
+<body>
+
+<table style="width: 50%; height: 50%; border-collapse: collapse;">
+<col></col>
+<col></col>
+<col></col>
+<tr>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+<tr>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+<td>&nbsp;</td>
+</tr>
+</table>
+
+</body>
+</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -631,16 +631,19 @@ fails == 374927-1.html 374927-1-ref.html
 == 376375-1.html 376375-1-ref.html
 == 376484-1.html 376484-1-ref.html
 == 376532-1.html 376532-1-ref.html
 != 376532-2.html 376532-2-ref.html
 != 376532-3.html 376532-3-ref.html
 == 377603-1.html 377603-1-ref.html
 == 377918.html 377918-ref.html
 == 378535-1.html 378535-1-ref.html
+== 378933-1.html 378933-1-ref.html
+== 378935-1.html 378935-1-ref.html
+== 378937-1.html 378937-1-ref.html
 == 379178-xhtml.xhtml 379178-xhtml-ref.xhtml
 == 379178-html.html 379178-html-ref.html
 == 379178-svg.svg 379178-svg-ref.svg
 == 379316-1.html 379316-1-ref.html
 random-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 379316-2.html 379316-2-ref.html # bug 379786
 == 379328-1.html 379328-1-ref.html
 == 379349-1a.xhtml 379349-1-ref.xhtml
 == 379349-1b.xhtml 379349-1-ref.xhtml
--- a/layout/tables/nsCellMap.cpp
+++ b/layout/tables/nsCellMap.cpp
@@ -1469,17 +1469,19 @@ nsCellMap::AppendCell(nsTableCellMap&   
   CellData* origData = nsnull;
   PRInt32 startColIndex = 0;
   if (aColToBeginSearch)
     startColIndex = *aColToBeginSearch;
   for (; startColIndex < origNumCols; startColIndex++) {
     CellData* data = GetDataAt(aRowIndex, startColIndex);
     if (!data) 
       break;
-    if (data->IsDead()) {
+    // The border collapse code relies on having multiple dead cell data entries
+    // in a row.
+    if (data->IsDead() && aCellFrame) {
       origData = data;
       break; 
     }
     if (data->IsZeroColSpan() ) {
       // appending a cell collapses zerospans.
       CollapseZeroColSpan(aMap, data, aRowIndex, startColIndex);
       // ask again for the data as it should be modified
       origData = GetDataAt(aRowIndex, startColIndex);
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -6892,17 +6892,17 @@ void
 BCHorizontalSeg::Paint(BCPaintBorderIterator& aIter,
                        nsIRenderingContext&   aRenderingContext)
 {
   // get the border style, color and paint the segment
   PRUint8 side = (aIter.IsDamageAreaBottomMost()) ? NS_SIDE_BOTTOM :
                                                      NS_SIDE_TOP;
   nsIFrame* rg   = aIter.mRg;  if (!rg) ABORT0();
   nsIFrame* row  = aIter.mRow; if (!row) ABORT0();
-  nsIFrame* cell = mFirstCell; if (!cell) ABORT0(); // ????
+  nsIFrame* cell = mFirstCell;
   nsIFrame* col;
   nsIFrame* owner = nsnull;
 
   PRUint8 style = NS_STYLE_BORDER_STYLE_SOLID;
   nscolor color = 0xFFFFFFFF;
  
   
   switch (mOwner) {