Fix assertions in the scrollable row group case. (Bug 531461) r=roc
authorL. David Baron <dbaron@dbaron.org>
Sun, 13 Dec 2009 19:40:55 -0800
changeset 35706 89a4f5a6525a48c19277356d271403c80bf3e40c
parent 35705 5b15b904bde9aefe0ec11e67595e2ad685681ae2
child 35707 4700e3c42868ce50db87ded6c7508a54a8043d13
push id10686
push userdbaron@mozilla.com
push dateMon, 14 Dec 2009 03:43:27 +0000
treeherdermozilla-central@4700e3c42868 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs531461
milestone1.9.3a1pre
Fix assertions in the scrollable row group case. (Bug 531461) r=roc
layout/reftests/table-background/reftest.list
layout/reftests/table-background/scrollable-rowgroup-collapse-background.html
layout/reftests/table-background/scrollable-rowgroup-collapse-border.html
layout/reftests/table-background/scrollable-rowgroup-collapse-notref.html
layout/reftests/table-background/scrollable-rowgroup-separate-background.html
layout/reftests/table-background/scrollable-rowgroup-separate-border.html
layout/reftests/table-background/scrollable-rowgroup-separate-notref.html
layout/tables/nsTableFrame.cpp
--- a/layout/reftests/table-background/reftest.list
+++ b/layout/reftests/table-background/reftest.list
@@ -46,8 +46,12 @@ fails == border-collapse-opacity-table-c
 == border-collapse-opacity-table-row.html border-collapse-opacity-table-row-ref.html
 == border-collapse-opacity-table.html border-collapse-opacity-table-ref.html
 == border-separate-opacity-table-cell.html border-separate-opacity-table-cell-ref.html
 fails == border-separate-opacity-table-column-group.html border-separate-opacity-table-column-group-ref.html # bug 424274
 fails == border-separate-opacity-table-column.html border-separate-opacity-table-column-ref.html # bug 424274
 == border-separate-opacity-table-row-group.html border-separate-opacity-table-row-group-ref.html
 == border-separate-opacity-table-row.html border-separate-opacity-table-row-ref.html
 == border-separate-opacity-table.html border-separate-opacity-table-ref.html
+!= scrollable-rowgroup-collapse-background.html scrollable-rowgroup-collapse-notref.html
+!= scrollable-rowgroup-collapse-border.html scrollable-rowgroup-collapse-notref.html
+!= scrollable-rowgroup-separate-background.html scrollable-rowgroup-separate-notref.html
+!= scrollable-rowgroup-separate-border.html scrollable-rowgroup-separate-notref.html
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-background/scrollable-rowgroup-collapse-background.html
@@ -0,0 +1,6 @@
+<title>Testcase for assertion fix in bug 531461</title>
+<table style="border-collapse:collapse">
+  <tbody style="overflow:scroll; background:yellow">
+    <tr><td>Cell</td></tr>
+  </tbody>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-background/scrollable-rowgroup-collapse-border.html
@@ -0,0 +1,6 @@
+<title>Testcase for assertion fix in bug 531461</title>
+<table style="border-collapse:collapse">
+  <tbody style="overflow:scroll; border: medium solid black">
+    <tr><td>Cell</td></tr>
+  </tbody>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-background/scrollable-rowgroup-collapse-notref.html
@@ -0,0 +1,6 @@
+<title>Testcase for assertion fix in bug 531461</title>
+<table style="border-collapse:collapse">
+  <tbody style="overflow:scroll">
+    <tr><td>Cell</td></tr>
+  </tbody>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-background/scrollable-rowgroup-separate-background.html
@@ -0,0 +1,6 @@
+<title>Testcase for assertion fix in bug 531461</title>
+<table>
+  <tbody style="overflow:scroll; background:yellow">
+    <tr><td>Cell</td></tr>
+  </tbody>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-background/scrollable-rowgroup-separate-border.html
@@ -0,0 +1,6 @@
+<title>Testcase for assertion fix in bug 531461</title>
+<table>
+  <tbody style="overflow:scroll; border: medium solid black">
+    <tr><td>Cell</td></tr>
+  </tbody>
+</table>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-background/scrollable-rowgroup-separate-notref.html
@@ -0,0 +1,6 @@
+<title>Testcase for assertion fix in bug 531461</title>
+<table>
+  <tbody style="overflow:scroll">
+    <tr><td>Cell</td></tr>
+  </tbody>
+</table>
--- a/layout/tables/nsTableFrame.cpp
+++ b/layout/tables/nsTableFrame.cpp
@@ -68,16 +68,17 @@
 #include "nsIScrollableFrame.h"
 #include "nsFrameManager.h"
 #include "nsCSSRendering.h"
 #include "nsLayoutErrors.h"
 #include "nsAutoPtr.h"
 #include "nsCSSFrameConstructor.h"
 #include "nsStyleSet.h"
 #include "nsDisplayList.h"
+#include "nsIScrollableFrame.h"
 
 /********************************************************************************
  ** nsTableReflowState                                                         **
  ********************************************************************************/
 
 struct nsTableReflowState {
 
   // the real reflow state
@@ -1328,16 +1329,21 @@ IsFrameAllowedInTable(nsIAtom* aType)
 }
 #endif
 
 static PRBool
 AnyTablePartHasBorderOrBackground(nsIFrame* aFrame)
 {
   NS_ASSERTION(IsFrameAllowedInTable(aFrame->GetType()), "unexpected frame type");
 
+  nsIScrollableFrame *scrollFrame = do_QueryFrame(aFrame);
+  if (scrollFrame) {
+    return AnyTablePartHasBorderOrBackground(scrollFrame->GetScrolledFrame());
+  }
+
   if (aFrame->GetStyleVisibility()->IsVisible() &&
       (!aFrame->GetStyleBackground()->IsTransparent() ||
        aFrame->GetStyleDisplay()->mAppearance ||
        aFrame->HasBorder()))
     return PR_TRUE;
 
   nsTableCellFrame *cellFrame = do_QueryFrame(aFrame);
   if (cellFrame)