1 <!DOCTYPE HTML PUBLIC
"-//IETF//DTD HTML//EN">
4 <script src=
"../resources/js-test.js"></script>
10 <!-- First row is hidden -->
11 <table id=
"table1" border=
1>
12 <tr><th hidden
>header
1</th><th hidden
>header
2</th></tr>
13 <tr><td id=
"table1cell">foo
</td><td>bar
</td></tr>
16 <!-- First section is hidden -->
17 <table id=
"table2" border=
1>
18 <thead><th hidden
>header
1</th><th hidden
>header
2</th></thead>
19 <tr><td id=
"table2cell">foo
</td><td>bar
</td></tr>
22 <!-- First and middle section is hidden -->
23 <table id=
"table3" border=
1>
24 <thead><tr><th hidden
>header
1</th><th hidden
>header
2</th></tr></thead>
25 <tr><td hidden
>foo
</td><td hidden
>bar
</td></tr>
26 <tfoot><tr><td id=
"table3cell">foot
</td><td>foot
</td></tr></tfoot>
33 description("This tests that cellForRowAndColumn work as expected when cells are hidden in sections and rows.");
35 if (window
.accessibilityController
) {
37 debug("\nTable1 has a hidden first row. Verify accessing cells works as expected.");
38 var table1
= accessibilityController
.accessibleElementById("table1");
39 shouldBe("table1.rowCount", "2");
40 var table1cell1
= table1
.cellForColumnAndRow(0, 0);
41 shouldBeTrue("!table1cell1 || !table1cell1.isValid");
42 var table1cell2
= table1
.cellForColumnAndRow(0, 1);
43 shouldBeTrue("table1cell2.isEqual(accessibilityController.accessibleElementById('table1cell'))");
44 shouldBe("table1cell2.rowIndexRange()", "'{1, 1}'");
45 shouldBe("table1cell2.columnIndexRange()", "'{0, 1}'");
47 debug("\nTable2 has a hidden first section. Verify accessing cells works as expected.");
48 var table2
= accessibilityController
.accessibleElementById("table2");
49 shouldBe("table2.rowCount", "2");
50 var table2cell1
= table2
.cellForColumnAndRow(0, 0);
51 shouldBeTrue("!table2cell1 || !table2cell1.isValid");
52 var table2cell2
= table2
.cellForColumnAndRow(0, 1);
53 shouldBeTrue("table2cell2.isEqual(accessibilityController.accessibleElementById('table2cell'))");
54 shouldBe("table2cell2.rowIndexRange()", "'{1, 1}'");
55 shouldBe("table2cell2.columnIndexRange()", "'{0, 1}'");
57 debug("\nTable3 only has a footer section.");
58 var table3
= accessibilityController
.accessibleElementById("table3");
59 shouldBe("table3.rowCount", "3");
60 var table3cell1
= table3
.cellForColumnAndRow(0, 0);
61 shouldBeTrue("!table3cell1 || !table3cell1.isValid");
62 var table3cell2
= table3
.cellForColumnAndRow(0, 2);
63 shouldBeTrue("table3cell2.isEqual(accessibilityController.accessibleElementById('table3cell'))");
64 shouldBe("table3cell2.rowIndexRange()", "'{2, 1}'");
65 shouldBe("table3cell2.columnIndexRange()", "'{0, 1}'");
67 // Clear the HTML for better results.
68 document
.getElementById("content").innerHTML
= "";