reftests for border collapse implementation of rules and frames
authorBernd <bmlk@gmx.de>
Sun, 08 Feb 2009 17:47:57 +0100
changeset 24769 57eeb5a25f65829044a239b0cada60a0861799e0
parent 24768 fc7431820ea33d0e2ebfa92eccef4ff35c90ea1d
child 24770 b0533f0e301b82f72842af014fa8085a96b279a6
push id5230
push userbmlk@gmx.de
push dateSun, 08 Feb 2009 16:48:36 +0000
treeherdermozilla-central@57eeb5a25f65 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.2a1pre
reftests for border collapse implementation of rules and frames
layout/reftests/table-bordercollapse/349655-ref.html
layout/reftests/table-bordercollapse/349655.html
layout/reftests/table-bordercollapse/bordercol-orig.css
layout/reftests/table-bordercollapse/bordercol.css
layout/reftests/table-bordercollapse/bordercolor.html
layout/reftests/table-bordercollapse/frame_above_rules_all.html
layout/reftests/table-bordercollapse/frame_above_rules_all_ref.html
layout/reftests/table-bordercollapse/frame_above_rules_cols.html
layout/reftests/table-bordercollapse/frame_above_rules_cols_ref.html
layout/reftests/table-bordercollapse/frame_above_rules_groups.html
layout/reftests/table-bordercollapse/frame_above_rules_groups_ref.html
layout/reftests/table-bordercollapse/frame_above_rules_none.html
layout/reftests/table-bordercollapse/frame_above_rules_none_ref.html
layout/reftests/table-bordercollapse/frame_above_rules_rows.html
layout/reftests/table-bordercollapse/frame_above_rules_rows_ref.html
layout/reftests/table-bordercollapse/frame_below_rules_all.html
layout/reftests/table-bordercollapse/frame_below_rules_all_ref.html
layout/reftests/table-bordercollapse/frame_below_rules_cols.html
layout/reftests/table-bordercollapse/frame_below_rules_cols_ref.html
layout/reftests/table-bordercollapse/frame_below_rules_groups.html
layout/reftests/table-bordercollapse/frame_below_rules_groups_ref.html
layout/reftests/table-bordercollapse/frame_below_rules_none.html
layout/reftests/table-bordercollapse/frame_below_rules_none_ref.html
layout/reftests/table-bordercollapse/frame_below_rules_rows.html
layout/reftests/table-bordercollapse/frame_below_rules_rows_ref.html
layout/reftests/table-bordercollapse/frame_border_rules_all.html
layout/reftests/table-bordercollapse/frame_border_rules_all_ref.html
layout/reftests/table-bordercollapse/frame_border_rules_cols.html
layout/reftests/table-bordercollapse/frame_border_rules_cols_ref.html
layout/reftests/table-bordercollapse/frame_border_rules_groups.html
layout/reftests/table-bordercollapse/frame_border_rules_groups_ref.html
layout/reftests/table-bordercollapse/frame_border_rules_none.html
layout/reftests/table-bordercollapse/frame_border_rules_none_ref.html
layout/reftests/table-bordercollapse/frame_border_rules_rows.html
layout/reftests/table-bordercollapse/frame_border_rules_rows_ref.html
layout/reftests/table-bordercollapse/frame_box_rules_all.html
layout/reftests/table-bordercollapse/frame_box_rules_all_ref.html
layout/reftests/table-bordercollapse/frame_box_rules_cols.html
layout/reftests/table-bordercollapse/frame_box_rules_cols_ref.html
layout/reftests/table-bordercollapse/frame_box_rules_groups.html
layout/reftests/table-bordercollapse/frame_box_rules_groups_ref.html
layout/reftests/table-bordercollapse/frame_box_rules_none.html
layout/reftests/table-bordercollapse/frame_box_rules_none_ref.html
layout/reftests/table-bordercollapse/frame_box_rules_rows.html
layout/reftests/table-bordercollapse/frame_box_rules_rows_ref.html
layout/reftests/table-bordercollapse/frame_hsides_rules_all.html
layout/reftests/table-bordercollapse/frame_hsides_rules_all_ref.html
layout/reftests/table-bordercollapse/frame_hsides_rules_cols.html
layout/reftests/table-bordercollapse/frame_hsides_rules_cols_ref.html
layout/reftests/table-bordercollapse/frame_hsides_rules_groups.html
layout/reftests/table-bordercollapse/frame_hsides_rules_groups_ref.html
layout/reftests/table-bordercollapse/frame_hsides_rules_none.html
layout/reftests/table-bordercollapse/frame_hsides_rules_none_ref.html
layout/reftests/table-bordercollapse/frame_hsides_rules_rows.html
layout/reftests/table-bordercollapse/frame_hsides_rules_rows_ref.html
layout/reftests/table-bordercollapse/frame_lhs_rules_all.html
layout/reftests/table-bordercollapse/frame_lhs_rules_all_ref.html
layout/reftests/table-bordercollapse/frame_lhs_rules_cols.html
layout/reftests/table-bordercollapse/frame_lhs_rules_cols_ref.html
layout/reftests/table-bordercollapse/frame_lhs_rules_groups.html
layout/reftests/table-bordercollapse/frame_lhs_rules_groups_ref.html
layout/reftests/table-bordercollapse/frame_lhs_rules_grous.html
layout/reftests/table-bordercollapse/frame_lhs_rules_none.html
layout/reftests/table-bordercollapse/frame_lhs_rules_none_ref.html
layout/reftests/table-bordercollapse/frame_lhs_rules_rows.html
layout/reftests/table-bordercollapse/frame_lhs_rules_rows_ref.html
layout/reftests/table-bordercollapse/frame_rhs_rules_all.html
layout/reftests/table-bordercollapse/frame_rhs_rules_all_ref.html
layout/reftests/table-bordercollapse/frame_rhs_rules_cols.html
layout/reftests/table-bordercollapse/frame_rhs_rules_cols_ref.html
layout/reftests/table-bordercollapse/frame_rhs_rules_groups.html
layout/reftests/table-bordercollapse/frame_rhs_rules_groups_ref.html
layout/reftests/table-bordercollapse/frame_rhs_rules_none.html
layout/reftests/table-bordercollapse/frame_rhs_rules_none_ref.html
layout/reftests/table-bordercollapse/frame_rhs_rules_rows.html
layout/reftests/table-bordercollapse/frame_rhs_rules_rows_ref.html
layout/reftests/table-bordercollapse/frame_void_rules_all.html
layout/reftests/table-bordercollapse/frame_void_rules_all_ref.html
layout/reftests/table-bordercollapse/frame_void_rules_cols.html
layout/reftests/table-bordercollapse/frame_void_rules_cols_ref.html
layout/reftests/table-bordercollapse/frame_void_rules_groups.html
layout/reftests/table-bordercollapse/frame_void_rules_groups_ref.html
layout/reftests/table-bordercollapse/frame_void_rules_none.html
layout/reftests/table-bordercollapse/frame_void_rules_none_ref.html
layout/reftests/table-bordercollapse/frame_void_rules_rows.html
layout/reftests/table-bordercollapse/frame_void_rules_rows_ref.html
layout/reftests/table-bordercollapse/frame_vsides_rules_all.html
layout/reftests/table-bordercollapse/frame_vsides_rules_all_ref.html
layout/reftests/table-bordercollapse/frame_vsides_rules_cols.html
layout/reftests/table-bordercollapse/frame_vsides_rules_cols_ref.html
layout/reftests/table-bordercollapse/frame_vsides_rules_groups.html
layout/reftests/table-bordercollapse/frame_vsides_rules_groups_ref.html
layout/reftests/table-bordercollapse/frame_vsides_rules_none.html
layout/reftests/table-bordercollapse/frame_vsides_rules_none_ref.html
layout/reftests/table-bordercollapse/frame_vsides_rules_rows.html
layout/reftests/table-bordercollapse/frame_vsides_rules_rows_ref.html
layout/reftests/table-bordercollapse/reftest.list
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/349655-ref.html
@@ -0,0 +1,103 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+        <title>Testcase #2 for bug 349655</title>
+<style type="text/css">
+           table table tr { background: yellow; }
+          td.gray table {border-top-style:outset}
+          td.rot table {border-top-style:solid;
+                             border-bottom-style:solid;}
+         table.rl {border-left-style:solid;
+                             border-right-style:solid;}
+
+</style>
+</head>
+<body>
+
+<table ><tr><th colspan="2"><h5>Tables on the left have no bordercolor attribute. Right side is the same but with bordercolor.</h5></th></tr>
+<tr><td class="gray">
+<table border="1" frame="hsides" rules="none">
+        <tr><td>border="1" frame="hsides" rules="none"</td><td>cell2</td></tr>
+</table>
+<br>
+<table border="8" frame="hsides" rules="none">
+        <tr><td>border="8" frame="hsides" rules="none"</td><td>cell2</td></tr>
+</table>
+<br>
+<table border="8" frame="hsides">
+        <tr><td>border="8" frame="hsides"</td><td>cell2</td></tr>
+</table>
+<br>
+<table border="8" rules="none">
+        <tr><td>border="8" rules="none"</td><td>cell2</td></tr>
+</table>
+</td><td class="rot">
+<table bordercolor="red" border="1" frame="hsides" rules="none">
+        <tr><td>border="1" frame="hsides" rules="none"</td><td>cell2</td></tr>
+</table>
+<br>
+<table bordercolor="red" border="8" frame="hsides" rules="none">
+        <tr><td>border="8" frame="hsides" rules="none"</td><td>cell2</td></tr>
+</table>
+<br>
+<table bordercolor="red" border="8" frame="hsides">
+        <tr><td>border="8" frame="hsides"</td><td>cell2</td></tr>
+</table>
+<br>
+<table bordercolor="red" border="8" rules="none" class="rl">
+        <tr><td>border="8" rules="none"</td><td>cell2</td></tr>
+</table>
+</td></tr>
+
+<tr><th colspan="2"><h5>Without "frame"/"rules" attribute.</h5></th></tr>
+<tr><td class="gray">
+<table border="1">
+        <tr><td>border="1"</td><td>cell2</td></tr>
+</table>
+<br>
+<table border="8">
+        <tr><td>border="8"</td><td>cell2</td></tr>
+</table>
+</td><td class="rot">
+<table bordercolor="red"  border="1" class="rl">
+        <tr><td>border="1"</td><td>cell2</td></tr>
+</table>
+<br>
+<table bordercolor="red"  border="8" class="rl">
+        <tr><td>border="8" </td><td>cell2</td></tr>
+</table>
+</td></tr>
+<tr><th colspan="2"><h5>border-collapse</h5></th></tr>
+<tr><td >
+<table style="border-collapse:collapse" border="1">
+        <tr><td>border="1"</td><td>cell2</td></tr>
+</table>
+<br>
+<table style="border-collapse:collapse" border="8">
+        <tr><td>border="8"</td><td>cell2</td></tr>
+</table>
+</td><td class="rot">
+<table style="border-collapse:collapse" bordercolor="red"  border="1" class="rl">
+        <tr><td>border="1"</td><td>cell2</td></tr>
+</table>
+<br>
+<table style="border-collapse:collapse" bordercolor="red"  border="8" class="rl">
+        <tr><td>border="8" </td><td>cell2</td></tr>
+</table>
+</td></tr>
+<tr><td></td><td>
+<h5>bordercolor attribute on other elements</h5>
+<table border="8" style="border-style:outset">
+        <tbody bordercolor="red"><tr><td>TBODY bordercolor</td><td>cell2</td></tr></tbody>
+</table><br>
+<table border="8" style="border-style:outset">
+        <tr bordercolor="red"><td>TR bordercolor</td><td>cell2</td></tr>
+</table>
+<table bordercolor="red" border="8" style="border-style:solid">
+        <tr><td bordercolor="red">TD bordercolor</td><td>cell2</td></tr>
+</table>
+</td></tr>
+</table>
+
+</body>
+</html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/349655.html
@@ -0,0 +1,97 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+        <title>Testcase #2 for bug 349655</title>
+<style type="text/css">
+           table table tr { background: yellow; }
+</style>
+</head>
+<body>
+
+<table><tr><th colspan="2"><h5>Tables on the left have no bordercolor attribute. Right side is the same but with bordercolor.</h5></th></tr>
+<tr><td>
+<table border="1" frame="hsides" rules="none">
+        <tr><td>border="1" frame="hsides" rules="none"</td><td>cell2</td></tr>
+</table>
+<br>
+<table border="8" frame="hsides" rules="none">
+        <tr><td>border="8" frame="hsides" rules="none"</td><td>cell2</td></tr>
+</table>
+<br>
+<table border="8" frame="hsides">
+        <tr><td>border="8" frame="hsides"</td><td>cell2</td></tr>
+</table>
+<br>
+<table border="8" rules="none">
+        <tr><td>border="8" rules="none"</td><td>cell2</td></tr>
+</table>
+</td><td>
+<table bordercolor="red" border="1" frame="hsides" rules="none">
+        <tr><td>border="1" frame="hsides" rules="none"</td><td>cell2</td></tr>
+</table>
+<br>
+<table bordercolor="red" border="8" frame="hsides" rules="none">
+        <tr><td>border="8" frame="hsides" rules="none"</td><td>cell2</td></tr>
+</table>
+<br>
+<table bordercolor="red" border="8" frame="hsides">
+        <tr><td>border="8" frame="hsides"</td><td>cell2</td></tr>
+</table>
+<br>
+<table bordercolor="red" border="8" rules="none">
+        <tr><td>border="8" rules="none"</td><td>cell2</td></tr>
+</table>
+</td></tr>
+
+<tr><th colspan="2"><h5>Without "frame"/"rules" attribute.</h5></th></tr>
+<tr><td>
+<table border="1">
+        <tr><td>border="1"</td><td>cell2</td></tr>
+</table>
+<br>
+<table border="8">
+        <tr><td>border="8"</td><td>cell2</td></tr>
+</table>
+</td><td>
+<table bordercolor="red"  border="1">
+        <tr><td>border="1"</td><td>cell2</td></tr>
+</table>
+<br>
+<table bordercolor="red"  border="8" >
+        <tr><td>border="8" </td><td>cell2</td></tr>
+</table>
+</td></tr>
+<tr><th colspan="2"><h5>border-collapse</h5></th></tr>
+<tr><td>
+<table style="border-collapse:collapse" border="1">
+        <tr><td>border="1"</td><td>cell2</td></tr>
+</table>
+<br>
+<table style="border-collapse:collapse" border="8">
+        <tr><td>border="8"</td><td>cell2</td></tr>
+</table>
+</td><td>
+<table style="border-collapse:collapse" bordercolor="red"  border="1">
+        <tr><td>border="1"</td><td>cell2</td></tr>
+</table>
+<br>
+<table style="border-collapse:collapse" bordercolor="red"  border="8" >
+        <tr><td>border="8" </td><td>cell2</td></tr>
+</table>
+</td></tr>
+<tr><td></td><td>
+<h5>bordercolor attribute on other elements</h5>
+<table border="8">
+        <tbody bordercolor="red"><tr><td>TBODY bordercolor</td><td>cell2</td></tr></tbody>
+</table><br>
+<table border="8">
+        <tr bordercolor="red"><td>TR bordercolor</td><td>cell2</td></tr>
+</table>
+<table bordercolor="red" border="8">
+        <tr><td bordercolor="red">TD bordercolor</td><td>cell2</td></tr>
+</table>
+</td></tr>
+</table>
+
+</body>
+</html>
\ No newline at end of file
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/bordercol-orig.css
@@ -0,0 +1,23 @@
+	
+table {
+	margin-bottom: 0.5in;
+	}
+caption {
+	font-weight: bold;
+	font-style: italic;
+	}
+td {background-color:LightCyan }
+
+table.topLight {border-top: 1px solid #B2B2B2}
+table.bottom {border-bottom: 1px solid #505050}
+table.bottomDark {border-bottom: 1px solid black}
+table.leftLight {border-left: 1px solid #B2B2B2}
+table.right {border-right: 1px solid  #505050}
+table.rightDark {border-right: 1px solid black}
+table.top {border-top: 1px solid  #505050}
+table.left {border-left: 1px solid  #505050}
+table.bc {border-collapse:collapse}
+tbody.border{border-top: 1px solid  #505050; border-bottom: 1px solid #505050; }
+tr.border{border-top: 1px solid  #505050; border-bottom: 1px solid  #505050; }
+td.border{border-left:1px solid #505050;}
+
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/bordercol.css
@@ -0,0 +1,23 @@
+	
+table {
+	margin-bottom: 0.5in;
+	}
+caption {
+	font-weight: bold;
+	font-style: italic;
+	}
+td {background-color:LightCyan }
+
+table.topLight {border-top: 1px solid #AFAFAF}
+table.bottom {border-bottom: 1px solid #505050}
+table.bottomDark {border-bottom: 1px solid #444444}
+table.leftLight {border-left: 1px solid #AFAFAF}
+table.right {border-right: 1px solid  #505050}
+table.rightDark {border-right: 1px solid #444444}
+table.top {border-top: 1px solid  #505050}
+table.left {border-left: 1px solid  #505050}
+table.bc {border-collapse:collapse}
+tbody.border{border-top: 1px solid  #505050; border-bottom: 1px solid #505050; }
+tr.border{border-top: 1px solid  #505050; border-bottom: 1px solid  #505050; }
+td.border{border-left:1px solid #505050;}
+
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/bordercolor.html
@@ -0,0 +1,17 @@
+<!doctype html public "-//w3c//dtd html 3.2//en">
+
+<html>
+
+<head>
+<title>bordercolor</title>
+</head>
+
+<body >
+<table bordercolor="green">
+<tr><td>c1</td></tr>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_above_rules_all.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="above" and Rules="all"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+
+<table rules="all" frame="above">
+	<caption><a name="void-none">Frame="above" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_above_rules_all_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="all"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="top bc">
+	<caption><a name="void-none">Frame="above" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_above_rules_cols.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="above" and Rules="cols"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+
+<table rules="cols" frame="above">
+	<caption><a name="void-none">Frame="above" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_above_rules_cols_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="above" and Rules="cols"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="top bc">
+	<caption><a name="void-none">Frame="above" and Rules="cols"</caption>
+<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_above_rules_groups.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="above" and Rules="groups"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="groups" frame="above">
+	<caption><a name="void-none">Frame="above" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_above_rules_groups_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="groups"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="top bc">
+	<caption><a name="void-none">Frame="above" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody class=border>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_above_rules_none.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="above" and Rules="none"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="none" frame="above">
+	<caption><a name="void-none">Frame="above" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_above_rules_none_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="none"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="topLight">
+	<caption><a name="void-none">Frame="above" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_above_rules_rows.html
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="rows" and Rules="rows"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+
+<table rules="rows" frame="above">
+	<caption><a name="void-none">Frame="above" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_above_rules_rows_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="rows"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="top bc">
+	<caption><a name="void-none">Frame="above" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr  class=border>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr  class=border>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr class=border>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_below_rules_all.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="below" and Rules="all"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="all" frame="below">
+	<caption><a name="void-none">Frame="below" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_below_rules_all_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="below" and Rules="all"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="bottom bc">
+	<caption><a name="void-none">Frame="below" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_below_rules_cols.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="below" and Rules="cols"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="cols" frame="below">
+	<caption><a name="void-none">Frame="below" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_below_rules_cols_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="below" and Rules="cols"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="bottom bc">
+	<caption><a name="void-none">Frame="below" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_below_rules_groups.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="below" and Rules="groups"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="groups" frame="below">
+	<caption><a name="void-none">Frame="below" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_below_rules_groups_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="below" and Rules="groups"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="bottom bc">
+	<caption><a name="void-none">Frame="below" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody class="border">
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_below_rules_none.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="below" and Rules="none"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="none" frame="below">
+	<caption><a name="void-none">Frame="below" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_below_rules_none_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="below" and Rules="none"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="bottomDark">
+	<caption><a name="void-none">Frame="below" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_below_rules_rows.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="below" and Rules="rows"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="rows" frame="below">
+	<caption><a name="void-none">Frame="below" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_below_rules_rows_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="below" and Rules="rows"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="bottom bc">
+	<caption><a name="void-none">Frame="below" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr  class=border>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr  class=border>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr  class=border>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_border_rules_all.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="border" and Rules="all"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="all" frame="border">
+	<caption><a name="void-none">Frame="border" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_border_rules_all_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="border" and Rules="all"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right left top bottom bc">
+	<caption><a name="void-none">Frame="border" and Rules="all"</caption>
+<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_border_rules_cols.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="border" and Rules="cols"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="cols" frame="border">
+	<caption><a name="void-none">Frame="border" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_border_rules_cols_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="border" and Rules="cols"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right left top bottom bc">
+	<caption><a name="void-none">Frame="border" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_border_rules_groups.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="border" and Rules="groups"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="groups" frame="border">
+	<caption><a name="void-none">Frame="border" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_border_rules_groups_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="border" and Rules="groups"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right left top bottom bc">
+	<caption><a name="void-none">Frame="border" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody class="border">
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_border_rules_none.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="border" and Rules="none"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="none" frame="border">
+	<caption><a name="void-none">Frame="border" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_border_rules_none_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="border" and Rules="none"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="leftLight topLight rightDark  bottomDark">
+	<caption><a name="void-none">Frame="border" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_border_rules_rows.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="border" and Rules="rows"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="rows" frame="border">
+	<caption><a name="void-none">Frame="border" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_border_rules_rows_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="border" and Rules="rows"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right left top bottom bc">
+	<caption><a name="void-none">Frame="border" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr  class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr  class="border">
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr  class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_box_rules_all.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="box" and Rules="all"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="all" frame="box">
+	<caption><a name="void-none">Frame="box" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_box_rules_all_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="box" and Rules="all"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right left  top bottom bc">
+	<caption><a name="void-none">Frame="box" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_box_rules_cols.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="box" and Rules="cols"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="cols" frame="box">
+	<caption><a name="void-none">Frame="box" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_box_rules_cols_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="box" and Rules="cols"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right left  top bottom bc">
+	<caption><a name="void-none">Frame="box" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_box_rules_groups.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="box" and Rules="groups"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="groups" frame="box">
+	<caption><a name="void-none">Frame="box" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_box_rules_groups_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="box" and Rules="groups"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right left  top bottom bc">
+	<caption><a name="void-none">Frame="box" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody class="border">
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_box_rules_none.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="box" and Rules="none"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="none" frame="box">
+	<caption><a name="void-none">Frame="box" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_box_rules_none_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="box" and Rules="none"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="rightDark leftLight topLight bottomDark">
+	<caption><a name="void-none">Frame="box" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_box_rules_rows.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="box" and Rules="rows"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="rows" frame="box">
+	<caption><a name="void-none">Frame="box" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_box_rules_rows_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="box" and Rules="rows"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right left  top bottom bc">
+	<caption><a name="void-none">Frame="box" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr  class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_hsides_rules_all.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="hsides" and Rules="all"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="all" frame="hsides">
+	<caption><a name="void-none">Frame="hsides" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_hsides_rules_all_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="hsides" and Rules="all"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="top bottom bc">
+	<caption><a name="void-none">Frame="hsides" and Rules="all"</caption>
+<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_hsides_rules_cols.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="hsides" and Rules="cols"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="cols" frame="hsides">
+	<caption><a name="void-none">Frame="hsides" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_hsides_rules_cols_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="hsides" and Rules="cols"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="top bottom bc">
+	<caption><a name="void-none">Frame="hsides" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_hsides_rules_groups.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="hsides" and Rules="groups"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="groups" frame="hsides">
+	<caption><a name="void-none">Frame="hsides" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_hsides_rules_groups_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="hsides" and Rules="groups"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="top bottom bc">
+	<caption><a name="void-none">Frame="hsides" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody class="border">
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_hsides_rules_none.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="hsides" and Rules="none"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="none" frame="hsides">
+	<caption><a name="void-none">Frame="hsides" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_hsides_rules_none_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="hsides" and Rules="none"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="topLight bottomDark">
+	<caption><a name="void-none">Frame="hsides" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_hsides_rules_rows.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="hsides" and Rules="rows"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="rows" frame="hsides">
+	<caption><a name="void-none">Frame="hsides" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_hsides_rules_rows_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="hsides" and Rules="rows"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="top bottom bc">
+	<caption><a name="void-none">Frame="hsides" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr  class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr  class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_lhs_rules_all.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="lhs" and Rules="all"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="all" frame="lhs">
+	<caption><a name="void-none">Frame="lhs" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_lhs_rules_all_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="lhs" and Rules="all"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+
+
+<table class="left bc">
+	<caption><a name="void-none">Frame="lhs" and Rules="all"</caption>
+<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_lhs_rules_cols.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="lhs" and Rules="cols"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="cols" frame="lhs">
+	<caption><a name="void-none">Frame="lhs" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_lhs_rules_cols_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="lhs" and Rules="cols"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+
+
+<table class="left bc">
+	<caption><a name="void-none">Frame="lhs" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_lhs_rules_groups.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="lhs" and Rules="groups"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="groups" frame="lhs">
+	<caption><a name="void-none">Frame="lhs" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_lhs_rules_groups_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="lhs" and Rules="groups"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+
+
+<table class="left bc">
+	<caption><a name="void-none">Frame="lhs" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody class="border">
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_lhs_rules_grous.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="lhs" and Rules="groups"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="groups" frame="lhs">
+	<caption><a name="void-none">Frame="lhs" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_lhs_rules_none.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="lhs" and Rules="none"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="none" frame="lhs">
+	<caption><a name="void-none">Frame="lhs" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_lhs_rules_none_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="lhs" and Rules="none"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+
+
+<table class="leftLight">
+	<caption><a name="void-none">Frame="lhs" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_lhs_rules_rows.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="lhs" and Rules="rows"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="rows" frame="lhs">
+	<caption><a name="void-none">Frame="lhs" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_lhs_rules_rows_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="lhs" and Rules="rows"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+
+
+<table class="left bc">
+	<caption><a name="void-none">Frame="lhs" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr  class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr  class="border">
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr  class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_rhs_rules_all.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="rhs" and Rules="all"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="all" frame="rhs">
+	<caption><a name="void-none">Frame="rhs" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_rhs_rules_all_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="rhs" and Rules="all"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right bc">
+	<caption><a name="void-none">Frame="rhs" and Rules="all"</caption>
+<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_rhs_rules_cols.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="rhs" and Rules="cols"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="cols" frame="rhs">
+	<caption><a name="void-none">Frame="rhs" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_rhs_rules_cols_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="rhs" and Rules="cols"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right bc">
+	<caption><a name="void-none">Frame="rhs" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_rhs_rules_groups.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="rhs" and Rules="groups"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="groups" frame="rhs">
+	<caption><a name="void-none">Frame="rhs" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_rhs_rules_groups_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="rhs" and Rules="groups"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right bc">
+	<caption><a name="void-none">Frame="rhs" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody class="border">
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_rhs_rules_none.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="rhs" and Rules="none"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="none" frame="rhs">
+	<caption><a name="void-none">Frame="rhs" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_rhs_rules_none_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="rhs" and Rules="none"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="rightDark">
+	<caption><a name="void-none">Frame="rhs" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_rhs_rules_rows.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="rhs" and Rules="rows"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="rows" frame="rhs">
+	<caption><a name="void-none">Frame="rhs" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_rhs_rules_rows_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="rhs" and Rules="rows"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="right bc">
+	<caption><a name="void-none">Frame="rhs" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr  class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr  class="border">
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr  class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_void_rules_all.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="all"</title>
+<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="all" frame="void">
+	<caption><a name="void-none">Frame="void" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_void_rules_all_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="all"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="bc">
+<caption><a name="void-none">Frame="void" and Rules="all"</caption>
+  <thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_void_rules_cols.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="cols"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="cols" frame="void">
+	<caption><a name="void-none">Frame="void" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_void_rules_cols_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="cols"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="bc">
+	<caption><a name="void-none">Frame="void" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_void_rules_groups.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="groups"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="groups" frame="void">
+	<caption><a name="void-none">Frame="void" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_void_rules_groups_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="groups"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="bc">
+	<caption><a name="void-none">Frame="void" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody class="border">
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_void_rules_none.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="none"</title>
+<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="none" frame="void">
+	<caption><a name="void-none">Frame="void" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_void_rules_none_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="none"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table >
+	<caption><a name="void-none">Frame="void" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_void_rules_rows.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="void"</title>
+<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="rows" frame="void">
+	<caption><a name="void-none">Frame="void" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_void_rules_rows_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="void" and Rules="rows"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="bc">
+	<caption><a name="void-none">Frame="void" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_vsides_rules_all.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="vsides" and Rules="all"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="all" frame="vsides">
+	<caption><a name="void-none">Frame="vsides" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_vsides_rules_all_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="vsides" and Rules="all"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="left right bc">
+	<caption><a name="void-none">Frame="vsides" and Rules="all"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr class="border">
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_vsides_rules_cols.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="vsides" and Rules="cols"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="cols" frame="vsides">
+	<caption><a name="void-none">Frame="vsides" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_vsides_rules_cols_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="vsides" and Rules="cols"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="left right bc">
+	<caption><a name="void-none">Frame="vsides" and Rules="cols"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td class="border">Row 1, Cell 2</td>
+			<td class="border">Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2" class="border">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td class="border">Row 3, Cell 2</td>
+			<td rowspan="2" class="border">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td class="border">Row 5, Cell 2</td>
+			<td class="border">Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_vsides_rules_groups.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="vsides" and Rules="groups"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="groups" frame="vsides">
+	<caption><a name="void-none">Frame="vsides" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_vsides_rules_groups_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="vsides" and Rules="groups"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="left right bc">
+	<caption><a name="void-none">Frame="vsides" and Rules="groups"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody class="border">
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_vsides_rules_none.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="vsides" and Rules="none"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="none" frame="vsides">
+	<caption><a name="void-none">Frame="vsides" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_vsides_rules_none_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="vsides" and Rules="none"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="leftLight rightDark">
+	<caption><a name="void-none">Frame="vsides" and Rules="none"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_vsides_rules_rows.html
@@ -0,0 +1,44 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en"><head>
+
+
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="vsides" and Rules="rows"</title>
+	<link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table rules="rows" frame="vsides">
+	<caption><a name="void-none">Frame="vsides" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr>
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr>
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr>
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/table-bordercollapse/frame_vsides_rules_rows_ref.html
@@ -0,0 +1,43 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd">
+<html lang="en">
+<head>
+	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+	<title>Frame="vsides" and Rules="rows"</title>
+      <link rel="stylesheet" type="text/css" href="bordercol.css" />
+</head>
+<body>
+<table class="left right bc">
+	<caption><a name="void-none">Frame="vsides" and Rules="rows"</caption>
+	<thead>
+		<tr>
+			<td>Row 1, Cell 1</td>
+			<td>Row 1, Cell 2</td>
+			<td>Row 1, Cell 3</td>
+		</tr>
+	</thead>
+	<tbody>
+		<tr  class="border">
+			<td rowspan="2">Row 2, Cell 1</td>
+			<td colspan="2">Row 2, Cell 2</td>
+		</tr>
+		<tr  class="border">
+			<td>Row 3, Cell 2</td>
+			<td rowspan="2">Row 3, Cell 3</td>
+		</tr>
+		<tr  class="border">
+			<td colspan="2">Row 4, Cell 1</td>
+		</tr>
+	</tbody>
+	<tfoot>
+		<tr>
+			<td>Row 5, Cell 1</td>
+			<td>Row 5, Cell 2</td>
+			<td>Row 5, Cell 3</td>
+		</tr>
+	</tfoot>
+</table>
+
+
+</body>
+
+</html>
--- a/layout/reftests/table-bordercollapse/reftest.list
+++ b/layout/reftests/table-bordercollapse/reftest.list
@@ -15,8 +15,54 @@
 == bc_dyn_cg1.html bc_dyn_cg1_ref.html
 == bc_dyn_cg2.html bc_dyn_cg2_ref.html
 == bc_dyn_cg3.html bc_dyn_cg3_ref.html
 == bc_dyn_table1.html bc_dyn_table1_ref.html
 == bc_dyn_table2.html bc_dyn_table2_ref.html
 == bc_dyn_table3.html bc_dyn_table3_ref.html
 == bc_borderoffset1.html bc_borderoffset1_ref.html
 == bc_borderoffset2.html bc_borderoffset2_ref.html
+== frame_above_rules_all.html frame_above_rules_all_ref.html
+== frame_above_rules_cols.html frame_above_rules_cols_ref.html
+== frame_above_rules_groups.html frame_above_rules_groups_ref.html
+== frame_above_rules_none.html frame_above_rules_none_ref.html
+== frame_above_rules_rows.html frame_above_rules_rows_ref.html
+== frame_below_rules_all.html frame_below_rules_all_ref.html
+== frame_below_rules_cols.html frame_below_rules_cols_ref.html
+== frame_below_rules_groups.html frame_below_rules_groups_ref.html
+== frame_below_rules_none.html frame_below_rules_none_ref.html
+== frame_below_rules_rows.html frame_below_rules_rows_ref.html
+== frame_border_rules_all.html frame_border_rules_all_ref.html
+== frame_border_rules_cols.html frame_border_rules_cols_ref.html
+== frame_border_rules_groups.html frame_border_rules_groups_ref.html
+== frame_border_rules_none.html frame_border_rules_none_ref.html
+== frame_border_rules_rows.html frame_border_rules_rows_ref.html
+== frame_box_rules_all.html frame_box_rules_all_ref.html
+== frame_box_rules_cols.html frame_box_rules_cols_ref.html
+== frame_box_rules_groups.html frame_box_rules_groups_ref.html
+== frame_box_rules_none.html frame_box_rules_none_ref.html
+== frame_box_rules_rows.html frame_box_rules_rows_ref.html
+== frame_hsides_rules_all.html frame_hsides_rules_all_ref.html
+== frame_hsides_rules_cols.html frame_hsides_rules_cols_ref.html
+== frame_hsides_rules_groups.html frame_hsides_rules_groups_ref.html
+== frame_hsides_rules_none.html frame_hsides_rules_none_ref.html
+== frame_hsides_rules_rows.html frame_hsides_rules_rows_ref.html
+== frame_lhs_rules_all.html frame_lhs_rules_all_ref.html
+== frame_lhs_rules_cols.html frame_lhs_rules_cols_ref.html
+== frame_lhs_rules_groups.html frame_lhs_rules_groups_ref.html
+== frame_lhs_rules_none.html frame_lhs_rules_none_ref.html
+== frame_lhs_rules_rows.html frame_lhs_rules_rows_ref.html
+== frame_rhs_rules_all.html frame_rhs_rules_all_ref.html
+== frame_rhs_rules_cols.html frame_rhs_rules_cols_ref.html
+== frame_rhs_rules_groups.html frame_rhs_rules_groups_ref.html
+== frame_rhs_rules_none.html  frame_rhs_rules_none_ref.html
+== frame_rhs_rules_rows.html frame_rhs_rules_rows_ref.html
+== frame_void_rules_all.html frame_void_rules_all_ref.html
+== frame_void_rules_cols.html frame_void_rules_cols_ref.html
+== frame_void_rules_groups.html frame_void_rules_groups_ref.html
+== frame_void_rules_none.html frame_void_rules_none_ref.html
+== frame_void_rules_rows.html frame_void_rules_rows_ref.html
+== frame_vsides_rules_all.html frame_vsides_rules_all_ref.html
+== frame_vsides_rules_cols.html frame_vsides_rules_cols_ref.html
+== frame_vsides_rules_groups.html frame_vsides_rules_groups_ref.html
+== frame_vsides_rules_none.html frame_vsides_rules_none_ref.html
+== frame_vsides_rules_rows.html frame_vsides_rules_rows_ref.html
+