2009-02-15 00:29:45 -08:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html>
|
|
|
|
<!--
|
|
|
|
https://bugzilla.mozilla.org/show_bug.cgi?id=410052
|
|
|
|
-->
|
|
|
|
<head>
|
|
|
|
<title>Table indexes chrome tests</title>
|
2009-05-18 01:35:21 -07:00
|
|
|
<link rel="stylesheet" type="text/css"
|
|
|
|
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
2009-02-15 00:29:45 -08:00
|
|
|
|
2009-05-18 01:35:21 -07:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/MochiKit/packed.js"></script>
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
|
2009-02-15 00:29:45 -08:00
|
|
|
|
2009-05-18 01:35:21 -07:00
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
|
|
|
|
<script type="application/javascript"
|
|
|
|
src="chrome://mochikit/content/a11y/accessible/table.js"></script>
|
2009-02-15 00:29:45 -08:00
|
|
|
|
2009-05-18 01:35:21 -07:00
|
|
|
<script type="application/javascript">
|
2009-02-15 00:29:45 -08:00
|
|
|
function doTest()
|
|
|
|
{
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// table
|
2009-06-29 03:54:26 -07:00
|
|
|
var idxes = [
|
|
|
|
[0, 1, 2],
|
|
|
|
[3, 4, 5],
|
|
|
|
[6, 7, 7],
|
|
|
|
[6, 8, 9]
|
|
|
|
];
|
2009-02-15 00:29:45 -08:00
|
|
|
|
2009-06-29 03:54:26 -07:00
|
|
|
testTableIndexes("table", idxes);
|
2009-02-15 00:29:45 -08:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-06-29 03:54:26 -07:00
|
|
|
// tableborder
|
|
|
|
idxes = [
|
|
|
|
[0, 1, 2],
|
|
|
|
[3, 4, 5],
|
|
|
|
[6, 7, 7],
|
|
|
|
[6, 8, 9]
|
|
|
|
];
|
2009-02-15 00:29:45 -08:00
|
|
|
|
2009-06-29 03:54:26 -07:00
|
|
|
testTableIndexes("tableborder", idxes);
|
2009-02-15 00:29:45 -08:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-06-29 03:54:26 -07:00
|
|
|
// table
|
|
|
|
var idxes = [
|
|
|
|
[ 0, 1, 2, 2, 3, 4, 5, 6],
|
|
|
|
[ 7, 8, 9, 10, 11, 12, 13, 6],
|
|
|
|
[14, 15, 15, 16, 17, 18, 19, 6],
|
|
|
|
[20, 15, 15, 21, 22, 18, 23, 6]
|
|
|
|
];
|
2009-02-15 00:29:45 -08:00
|
|
|
|
2009-06-29 03:54:26 -07:00
|
|
|
testTableIndexes("table2", idxes);
|
2009-02-15 00:29:45 -08:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-06-29 03:54:26 -07:00
|
|
|
// tableinsane1 (empty row groups)
|
|
|
|
idxes = [
|
|
|
|
[0, 1, 2],
|
|
|
|
[3, 4, 5],
|
|
|
|
[6, 7, 7],
|
|
|
|
[6, 8, 9]
|
|
|
|
];
|
2009-02-15 00:29:45 -08:00
|
|
|
|
2009-06-29 03:54:26 -07:00
|
|
|
testTableIndexes("tableinsane1", idxes);
|
2009-02-15 00:29:45 -08:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-06-29 03:54:26 -07:00
|
|
|
// tableinsane2 (empry rows)
|
|
|
|
idxes = [
|
|
|
|
[-1, -1, -1],
|
|
|
|
[-1, -1, -1],
|
|
|
|
[ 0, 1, 2]
|
|
|
|
];
|
|
|
|
|
|
|
|
testTableIndexes("tableinsane2", idxes);
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// tableinsane3 (cell holes)
|
|
|
|
idxes = [
|
|
|
|
[0, 1, -1],
|
|
|
|
[2, 3, 4]
|
|
|
|
];
|
|
|
|
|
|
|
|
testTableIndexes("tableinsane3", idxes);
|
2009-02-15 00:29:45 -08:00
|
|
|
|
2009-07-01 02:16:45 -07:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// tableinsane3.2 (cell holes, row spans, fixed in bug 417912)
|
|
|
|
idxes = [
|
|
|
|
[0, 1, 2],
|
|
|
|
[3, -1, 2],
|
|
|
|
[4, 5, 2]
|
|
|
|
];
|
|
|
|
|
|
|
|
testTableIndexes("tableinsane3.2", idxes);
|
|
|
|
|
2009-06-29 03:54:26 -07:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// tableinsane4 (empty row groups/rows and cell holes)
|
|
|
|
idxes = [
|
|
|
|
[ 0, 1, 2],
|
|
|
|
[-1, -1, -1],
|
|
|
|
[ 3, 4, 5],
|
|
|
|
[ 6, 6, 7],
|
|
|
|
[ 8, -1, 7],
|
|
|
|
[ 9, 9, 9]
|
|
|
|
];
|
|
|
|
testTableIndexes("tableinsane4", idxes);
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
2009-07-09 00:51:37 -07:00
|
|
|
// tableinsane5 (just a crazy table)
|
2009-06-29 03:54:26 -07:00
|
|
|
idxes = [
|
|
|
|
[ 0, 1, 2, -1, -1],
|
|
|
|
[-1, -1, -1, -1, -1],
|
|
|
|
[ 3, 4, 5, -1, -1],
|
|
|
|
[ 6, 7, 7, 7, 7],
|
|
|
|
[ 6, 8, 9, -1, -1],
|
|
|
|
[ 6, 10, 9, 11, 12]
|
|
|
|
];
|
|
|
|
testTableIndexes("tableinsane5", idxes);
|
2009-02-15 00:29:45 -08:00
|
|
|
|
2009-07-09 00:51:37 -07:00
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
// tableinsane6 (overlapping cells, mad table)
|
|
|
|
idxes = [
|
|
|
|
[ 0, 1, 2, -1, -1],
|
|
|
|
[-1, -1, -1, -1, -1],
|
|
|
|
[ 3, 4, 5, -1, -1],
|
|
|
|
[ 6, 6, 7, -1, -1],
|
|
|
|
[ 8, 9, 7, -1, -1],
|
|
|
|
[ 10, 9, 7, 11, 12]
|
|
|
|
];
|
|
|
|
testTableIndexes("tableinsane6", idxes);
|
|
|
|
|
2009-02-15 00:29:45 -08:00
|
|
|
SimpleTest.finish();
|
|
|
|
}
|
|
|
|
|
|
|
|
SimpleTest.waitForExplicitFinish();
|
2009-09-23 07:21:47 -07:00
|
|
|
addA11yLoadEvent(doTest);
|
2009-02-15 00:29:45 -08:00
|
|
|
</script>
|
|
|
|
</head>
|
|
|
|
<body>
|
|
|
|
|
|
|
|
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=410052">Mozilla Bug 410052</a>
|
|
|
|
<p id="display"></p>
|
|
|
|
<div id="content" style="display: none"></div>
|
|
|
|
<pre id="test">
|
|
|
|
</pre>
|
|
|
|
|
|
|
|
<!--
|
|
|
|
If you change the structure of the table please make sure to change
|
|
|
|
the indexes count in 'for' statement in the script above.
|
|
|
|
-->
|
|
|
|
<table border="1" id="table">
|
|
|
|
<caption><strong><b><font size="29">this is a caption for this table</font></b></strong></caption>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>col1</th>
|
|
|
|
<th>col2</th>
|
|
|
|
<th>col3</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>1</td>
|
|
|
|
<td>2</td>
|
|
|
|
<td>3</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td rowspan="0">4</td>
|
|
|
|
<td colspan="2">5</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>6</td>
|
|
|
|
<td>7</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<table border="1" id="tableborder" style="border-collapse:collapse">
|
|
|
|
<caption><strong><b><font size="29">this is a caption for this bc table</font></b></strong></caption>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>col1</th>
|
|
|
|
<th>col2</th>
|
|
|
|
<th>col3</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>1</td>
|
|
|
|
<td>2</td>
|
|
|
|
<td>3</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td rowspan="2">4</td>
|
|
|
|
<td colspan="2">5</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>6</td>
|
|
|
|
<td>7</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2009-06-29 03:54:26 -07:00
|
|
|
<table cellpadding="2" cellspacing="2" border="1" width="50%" id="table2">
|
|
|
|
<caption>column and row spans</caption>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>0</td>
|
|
|
|
<td>1</td>
|
|
|
|
<td rowspan="1" colspan="2">2</td>
|
|
|
|
<td>3</td>
|
|
|
|
<td>4</td>
|
|
|
|
<td>5</td>
|
|
|
|
<td rowspan="4" colspan="1">6</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>7</td>
|
|
|
|
<td>8</td>
|
|
|
|
<td>8</td>
|
|
|
|
<td>10</td>
|
|
|
|
<td>11</td>
|
|
|
|
<td>12</td>
|
|
|
|
<td>13</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>14</td>
|
|
|
|
<td rowspan="2" colspan="2">15</td>
|
|
|
|
<td>16</td>
|
|
|
|
<td>17</td>
|
|
|
|
<td rowspan="2" colspan="1">18</td>
|
|
|
|
<td>19</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>20</td>
|
|
|
|
<td>21</td>
|
|
|
|
<td>22</td>
|
|
|
|
<td>23</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2009-02-15 00:29:45 -08:00
|
|
|
<table border="1" id="tableinsane1">
|
|
|
|
<caption>test empty row groups</caption>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>col1</th>
|
|
|
|
<th>col2</th>
|
|
|
|
<th>col3</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody></tbody>
|
|
|
|
<tbody></tbody>
|
|
|
|
<tbody></tbody>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>1</td>
|
|
|
|
<td>2</td>
|
|
|
|
<td>3</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td rowspan="2">4</td>
|
|
|
|
<td colspan="2">5</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>6</td>
|
|
|
|
<td>7</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2009-06-29 03:54:26 -07:00
|
|
|
<table border="1" id="tableinsane2">
|
|
|
|
<caption>empty rows</caption>
|
|
|
|
<tbody><tr></tr><tr></tr></tbody>
|
|
|
|
<tbody></tbody>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>0</td>
|
|
|
|
<td>1</td>
|
|
|
|
<td>2</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
|
|
|
<table border="1" id="tableinsane3">
|
|
|
|
<caption>missed cell</caption>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>0</td>
|
|
|
|
<td>1</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>2</td>
|
|
|
|
<td>3</td>
|
|
|
|
<td>4</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2009-07-01 02:16:45 -07:00
|
|
|
<table cellpadding="2" cellspacing="2" border="1" id="tableinsane3.2">
|
|
|
|
<tr><td>1</td><td>2</td><td rowspan=3>3</td>
|
|
|
|
<tr><td>4</td>
|
|
|
|
<tr><td>5</td><td>6</td>
|
|
|
|
</table>
|
|
|
|
|
2009-06-29 03:54:26 -07:00
|
|
|
<table border="1" id="tableinsane4">
|
|
|
|
<caption>test empty rows + cellmap holes</caption>
|
2009-02-15 00:29:45 -08:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>col1</th>
|
|
|
|
<th>col2</th>
|
|
|
|
<th>col3</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody><tr></tr></tbody>
|
|
|
|
<tbody></tbody>
|
|
|
|
<tbody></tbody>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>1</td>
|
|
|
|
<td>2</td>
|
|
|
|
<td>3</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2009-06-29 03:54:26 -07:00
|
|
|
<td colspan="2">4</td>
|
|
|
|
<td rowspan="2">5</td>
|
|
|
|
</tr>
|
2009-02-15 00:29:45 -08:00
|
|
|
<tr>
|
|
|
|
<td>6</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2009-06-29 03:54:26 -07:00
|
|
|
<td colspan="3">7</td>
|
2009-02-15 00:29:45 -08:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
</tbody>
|
2009-06-29 03:54:26 -07:00
|
|
|
</table>
|
2009-02-15 00:29:45 -08:00
|
|
|
|
2009-06-29 03:54:26 -07:00
|
|
|
<table border="1" id="tableinsane5">
|
|
|
|
<caption>just a crazy table</caption>
|
2009-02-15 00:29:45 -08:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>col1</th>
|
|
|
|
<th>col2</th>
|
|
|
|
<th>col3</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody><tr></tr></tbody>
|
|
|
|
<tbody></tbody>
|
|
|
|
<tbody></tbody>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>1</td>
|
|
|
|
<td>2</td>
|
|
|
|
<td>3</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
2009-06-29 03:54:26 -07:00
|
|
|
<td rowspan="0">4</td>
|
|
|
|
<td colspan="0">5</td>
|
|
|
|
</tr>
|
2009-02-15 00:29:45 -08:00
|
|
|
<tr>
|
|
|
|
<td>6</td>
|
2009-06-29 03:54:26 -07:00
|
|
|
<td rowspan="0">7</td>
|
2009-02-15 00:29:45 -08:00
|
|
|
</tr>
|
|
|
|
<tr>
|
2009-06-29 03:54:26 -07:00
|
|
|
<td>8</td>
|
|
|
|
<td>9</td>
|
|
|
|
<td>10</td>
|
2009-02-15 00:29:45 -08:00
|
|
|
</tr>
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
|
2009-07-09 00:51:37 -07:00
|
|
|
<table border="1" id="tableinsane6" >
|
|
|
|
<caption>overlapping cells</caption>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>header cell 0</th>
|
|
|
|
<th>header cell 1</th>
|
|
|
|
<th>header cell 2</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody><tr></tr></tbody>
|
|
|
|
<tbody></tbody>
|
|
|
|
<tbody></tbody>
|
|
|
|
<tbody>
|
|
|
|
<tr>
|
|
|
|
<td>3</td>
|
|
|
|
<td>4</td>
|
|
|
|
<td>5</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td colspan="2">6</td>
|
|
|
|
<td rowspan="0">7</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td>8</td>
|
|
|
|
<td rowspan="0">9</td>
|
|
|
|
</tr>
|
|
|
|
<tr>
|
|
|
|
<td colspan="3">10</td>
|
|
|
|
<td>11</td>
|
|
|
|
<td>12</td>
|
|
|
|
</tr>
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
|
2009-02-15 00:29:45 -08:00
|
|
|
</body>
|
|
|
|
</html>
|