зеркало из https://github.com/mozilla/pjs.git
Bug 416742 ��� add missing file
This commit is contained in:
Родитель
e5e1c4660f
Коммит
f73df02396
|
@ -0,0 +1,294 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=410052
|
||||
-->
|
||||
<head>
|
||||
<title>Table indexes chrome tests</title>
|
||||
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
|
||||
|
||||
<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>
|
||||
|
||||
<script type="application/javascript">
|
||||
function doTest()
|
||||
{
|
||||
const nsIAccessibleRetrieval =
|
||||
Components.interfaces.nsIAccessibleRetrieval;
|
||||
const nsIAccessibleTable = Components.interfaces.nsIAccessibleTable;
|
||||
|
||||
var accService = Components.classes["@mozilla.org/accessibleRetrieval;1"].
|
||||
getService(nsIAccessibleRetrieval);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// table
|
||||
var table = document.getElementById("table");
|
||||
var tableAcc = accService.getAccessibleFor(table).
|
||||
QueryInterface(nsIAccessibleTable);
|
||||
|
||||
var row, column, index;
|
||||
var tRow = new Array(0,0,0,1,1,1,2,2,3,3);
|
||||
var tCol = new Array(0,1,2,0,1,2,0,1,1,2);
|
||||
|
||||
for (var i = 0; i < 10; i++) {
|
||||
row = tableAcc.getRowAtIndex(i);
|
||||
column = tableAcc.getColumnAtIndex(i);
|
||||
index = tableAcc.getIndexAt(tRow[i], tCol[i]);
|
||||
is(row, tRow[i], "table: row for index " + i +" is nor correct");
|
||||
is(column, tCol[i], "table: column for index " + i +"is nor correct");
|
||||
is(index, i,
|
||||
"table: row " + row + " /column " + column + " and index " + index + " aren't inconsistent.");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// tableinsane1
|
||||
table = document.getElementById("tableinsane1");
|
||||
tableAcc = accService.getAccessibleFor(table).
|
||||
QueryInterface(nsIAccessibleTable);
|
||||
|
||||
tRow = [0,0,0,1,1,1,2,2,3,3];
|
||||
tCol = [0,1,2,0,1,2,0,1,1,2];
|
||||
|
||||
for (var i = 0; i < 10; i++) {
|
||||
row = tableAcc.getRowAtIndex(i);
|
||||
column = tableAcc.getColumnAtIndex(i);
|
||||
index = tableAcc.getIndexAt(tRow[i], tCol[i]);
|
||||
is(row, tRow[i],
|
||||
"tableinsane1: row for index " + i +" is nor correct");
|
||||
is(column, tCol[i],
|
||||
"tableinsane1: column for index " + i +"is nor correct");
|
||||
is(index, i,
|
||||
"tableinsane1: row " + row + " /column " + column + " and index " + index + " aren't inconsistent.");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// tableinsane2
|
||||
table = document.getElementById("tableinsane2");
|
||||
tableAcc = accService.getAccessibleFor(table).
|
||||
QueryInterface(nsIAccessibleTable);
|
||||
|
||||
tRow = [0,0,0,1,1,1,2,2,3,3,4,4,4];
|
||||
tCol = [0,1,2,0,1,2,0,1,1,2,1,3,4];
|
||||
|
||||
for (var i = 0; i < 13; i++) {
|
||||
row = tableAcc.getRowAtIndex(i);
|
||||
column = tableAcc.getColumnAtIndex(i);
|
||||
index = tableAcc.getIndexAt(tRow[i], tCol[i]);
|
||||
is(row, tRow[i],
|
||||
"tableinsane2: row for index " + i +" is nor correct");
|
||||
is(column, tCol[i],
|
||||
"tableinsane2: column for index " + i +"is nor correct");
|
||||
is(index, i,
|
||||
"tableinsane2: row " + row + " /column " + column + " and index " + index + " aren't inconsistent.");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// tableinsane4
|
||||
table = document.getElementById("tableinsane4");
|
||||
tableAcc = accService.getAccessibleFor(table).
|
||||
QueryInterface(Components.interfaces.nsIAccessibleTable);
|
||||
|
||||
tRow = [0,0,0,1,1,1,2,2,3,4];
|
||||
tCol = [0,1,2,0,1,2,0,2,0,0];
|
||||
|
||||
for (var i = 0; i < 10; i++) {
|
||||
row = tableAcc.getRowAtIndex(i);
|
||||
column = tableAcc.getColumnAtIndex(i);
|
||||
index = tableAcc.getIndexAt(tRow[i], tCol[i]);
|
||||
is(row, tRow[i],
|
||||
"tableinsane4: row for index " + i +" is nor correct");
|
||||
is(column, tCol[i],
|
||||
"tableinsane4: column for index " + i +"is nor correct");
|
||||
is(index, i,
|
||||
"tableinsane4: row " + row + " /column " + column + " and index " + index + " aren't inconsistent.");
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
// tableborder
|
||||
var table = document.getElementById("tableborder");
|
||||
var tableAcc = accService.getAccessibleFor(table).
|
||||
QueryInterface(nsIAccessibleTable);
|
||||
|
||||
tRow = [0,0,0,1,1,1,2,2,3,3];
|
||||
tCol = [0,1,2,0,1,2,0,1,1,2];
|
||||
|
||||
for (var i = 0; i < 10; i++) {
|
||||
row = tableAcc.getRowAtIndex(i);
|
||||
column = tableAcc.getColumnAtIndex(i);
|
||||
index = tableAcc.getIndexAt(tRow[i], tCol[i]);
|
||||
is(row, tRow[i],
|
||||
"tableborder: row for index " + i +" is nor correct");
|
||||
is(column, tCol[i],
|
||||
"tableborder: column for index " + i +"is nor correct");
|
||||
is(index, i,
|
||||
"tableborder: row " + row + " /column " + column + " and index " + index + " aren't inconsistent.");
|
||||
}
|
||||
|
||||
SimpleTest.finish();
|
||||
}
|
||||
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
addLoadEvent(doTest);
|
||||
</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>
|
||||
|
||||
<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>
|
||||
|
||||
<table border="1" id="tableinsane2" >
|
||||
<caption>empty rowgroup + empty rows</caption>
|
||||
<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>
|
||||
<td rowspan="0">4</td>
|
||||
<td colspan="0">5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>6</td>
|
||||
<td rowspan="0">7</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>8</td>
|
||||
<td>9</td>
|
||||
<td>10</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
|
||||
<table border="1" id="tableinsane4" >
|
||||
<caption>test cellmap holes</caption>
|
||||
<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>
|
||||
<td colspan="2">4</td>
|
||||
<td rowspan="2">5</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>6</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="3">7</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
</html>
|
Загрузка…
Ссылка в новой задаче