Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: LayoutTests/accessibility/table-headers.html

Issue 862543003: Table headers are not retrieved properly by Accessibility API (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Minor fixes, correct comment and very small refactoring Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/accessibility/table-headers-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/accessibility/table-headers.html
diff --git a/LayoutTests/accessibility/table-headers.html b/LayoutTests/accessibility/table-headers.html
index 3fc0f360e25762b3ee29928039e2f8da02e328fa..0c3672de35468d7d33be3ac06ee39576dd9b4861 100644
--- a/LayoutTests/accessibility/table-headers.html
+++ b/LayoutTests/accessibility/table-headers.html
@@ -5,7 +5,7 @@
</head>
<body id="body">
-<table id="table1">
+<table id="table1" border="1">
<thead>
<tr>
<th>No</th>
@@ -32,6 +32,107 @@
</tbody>
</table>
+<table id="table2" border="1">
+ <caption>
+ scope test
+ </caption>
+ <tr>
+ <th scope="col">col head</th>
+ <th scope="row">row head</th>
+ <th>col head</th>
+ </tr>
+ <tr>
+ <th scope="col">col head</th>
+ <td scope="row">data</td>
+ <th>row head</th>
+ </tr>
+ <tr>
+ <th>row head</th>
+ <td>data</td>
+ <th scope="col">col head</th>
+ </tr>
+</table>
+
+<table id="table3" border="1">
+ <caption>
+ row header and column header (1)
+ </caption>
+ <tr>
+ <td>data</td>
+ <th>row head</th>
+ <th>column head</th>
+ </tr>
+ <tr>
+ <th>column head</th>
+ <th>column head</th>
+ <td>data</td>
+ </tr>
+ <tr>
+ <th>row head</th>
+ <td>data</td>
+ <th>row head</th>
+ </tr>
+</table>
+
+<table id="table4" border="1">
+ <caption>
+ row header and column header (2)
+ </caption>
+ <tr>
+ <th>row head</th>
+ <td>data</td>
+ <td>data</td>
+ </tr>
+ <tr>
+ <th>column head</th>
+ <th>column head</th>
+ <th>column head</th>
+ </tr>
+ <tr>
+ <td>data</td>
+ <td>data</td>
+ <td>data</td>
+ </tr>
+</table>
+
+<table id="table5" border="1">
+ <caption>
+ scope and rowspan
+ </caption>
+ <tr>
+ <th rowspan="2" scope="rowgroup">row head</th>
+ <th scope="col">col head</th>
+ </tr>
+ <tr>
+ <th scope="row">row head</th>
+ </tr>
+</table>
+
+<table id="table6" border="1">
+ <caption>
+ scope and colspan
+ </caption>
+ <tr>
+ <th scope="col">col head</th>
+ <th scope="col">col head</th>
+ <th scope="col">col head</th>
+ </tr>
+ <tr>
+ <td>data</td>
+ <td>data</td>
+ <td>data</td>
+ </tr>
+ <tr>
+ <th colspan="2" scope="colgroup">col head</th>
+ <th>col head</th>
+ </tr>
+ <tr>
+ <td>data</td>
+ <td>data</td>
+ <th>row head</td>
+ </tr>
+</table>
+
<p id="description"></p>
<div id="console"></div>
@@ -42,15 +143,73 @@
if (window.accessibilityController) {
var table = accessibilityController.accessibleElementById("table1");
// Row headers
- shouldBeTrue("table.rowHeaderAtIndex(0).isEqual(table.cellForColumnAndRow(0, 0))");
- shouldBeTrue("table.rowHeaderAtIndex(1).isEqual(table.cellForColumnAndRow(0, 1))");
- shouldBeTrue("table.rowHeaderAtIndex(2).isEqual(table.cellForColumnAndRow(0, 2))");
- shouldBeTrue("table.rowHeaderAtIndex(3).isEqual(table.cellForColumnAndRow(0, 3))");
-
+ shouldBeTrue("table.rowHeaderAtIndex(0).isEqual(table.cellForColumnAndRow(0, 1))");
+ shouldBeTrue("table.rowHeaderAtIndex(1).isEqual(table.cellForColumnAndRow(0, 2))");
+ shouldBeTrue("table.rowHeaderAtIndex(2).isEqual(table.cellForColumnAndRow(0, 3))");
+ shouldBe("table.rowHeadersCount", "3");
// Column headers
shouldBeTrue("table.columnHeaderAtIndex(0).isEqual(table.cellForColumnAndRow(0, 0))");
shouldBeTrue("table.columnHeaderAtIndex(1).isEqual(table.cellForColumnAndRow(1, 0))");
shouldBeTrue("table.columnHeaderAtIndex(2).isEqual(table.cellForColumnAndRow(2, 0))");
+ shouldBe("table.columnHeadersCount", "3");
+
+ var table2 = accessibilityController.accessibleElementById("table2");
+ // Row headers
+ shouldBeTrue("table2.rowHeaderAtIndex(0).isEqual(table2.cellForColumnAndRow(1, 0))");
+ shouldBeTrue("table2.rowHeaderAtIndex(1).isEqual(table2.cellForColumnAndRow(2, 1))");
+ shouldBeTrue("table2.rowHeaderAtIndex(2).isEqual(table2.cellForColumnAndRow(0, 2))");
+ shouldBe("table2.rowHeadersCount", "3");
+ // Column headers
+ shouldBeTrue("table2.columnHeaderAtIndex(0).isEqual(table2.cellForColumnAndRow(0, 0))");
+ shouldBeTrue("table2.columnHeaderAtIndex(1).isEqual(table2.cellForColumnAndRow(0, 1))");
+ shouldBeTrue("table2.columnHeaderAtIndex(2).isEqual(table2.cellForColumnAndRow(2, 0))");
+ shouldBeTrue("table2.columnHeaderAtIndex(3).isEqual(table2.cellForColumnAndRow(2, 2))");
+ shouldBe("table2.columnHeadersCount", "4");
+
+ var table3 = accessibilityController.accessibleElementById("table3");
+ // Row headers
+ shouldBeTrue("table3.rowHeaderAtIndex(0).isEqual(table3.cellForColumnAndRow(1, 0))");
+ shouldBeTrue("table3.rowHeaderAtIndex(1).isEqual(table3.cellForColumnAndRow(0, 2))");
+ shouldBeTrue("table3.rowHeaderAtIndex(2).isEqual(table3.cellForColumnAndRow(2, 2))");
+ shouldBe("table3.rowHeadersCount", "3");
+ // Column headers
+ shouldBeTrue("table3.columnHeaderAtIndex(0).isEqual(table3.cellForColumnAndRow(0, 1))");
+ shouldBeTrue("table3.columnHeaderAtIndex(1).isEqual(table3.cellForColumnAndRow(1, 1))");
+ shouldBeTrue("table3.columnHeaderAtIndex(2).isEqual(table3.cellForColumnAndRow(2, 0))");
+ shouldBe("table3.columnHeadersCount", "3");
+
+ var table4 = accessibilityController.accessibleElementById("table4");
+ // Row headers
+ shouldBeTrue("table4.rowHeaderAtIndex(0).isEqual(table4.cellForColumnAndRow(0, 0))");
+ shouldBe("table4.rowHeadersCount", "1");
+ // Column headers
+ shouldBeTrue("table4.columnHeaderAtIndex(0).isEqual(table4.cellForColumnAndRow(0, 1))");
+ shouldBeTrue("table4.columnHeaderAtIndex(1).isEqual(table4.cellForColumnAndRow(1, 1))");
+ shouldBeTrue("table4.columnHeaderAtIndex(2).isEqual(table4.cellForColumnAndRow(2, 1))");
+ shouldBe("table4.columnHeadersCount", "3");
+
+ var table5 = accessibilityController.accessibleElementById("table5");
+ // Row headers
+ shouldBeTrue("table5.rowHeaderAtIndex(0).isEqual(table5.cellForColumnAndRow(0, 0))"); // rowspan=2
+ shouldBeTrue("table5.rowHeaderAtIndex(0).isEqual(table5.cellForColumnAndRow(0, 1))"); // rowspan=2
+ shouldBeTrue("table5.rowHeaderAtIndex(1).isEqual(table5.cellForColumnAndRow(1, 1))");
+ shouldBe("table5.rowHeadersCount", "2");
+ // Column headers
+ shouldBeTrue("table5.columnHeaderAtIndex(0).isEqual(table5.cellForColumnAndRow(1, 0))");
+ shouldBe("table5.columnHeadersCount", "1");
+
+ var table6 = accessibilityController.accessibleElementById("table6");
+ // Row headers
+ shouldBeTrue("table6.rowHeaderAtIndex(0).isEqual(table6.cellForColumnAndRow(2, 3))");
+ shouldBe("table6.rowHeadersCount", "1");
+ // Column headers
+ shouldBeTrue("table6.columnHeaderAtIndex(0).isEqual(table6.cellForColumnAndRow(0, 0))");
+ shouldBeTrue("table6.columnHeaderAtIndex(1).isEqual(table6.cellForColumnAndRow(0, 2))"); // colspan=2
+ shouldBeTrue("table6.columnHeaderAtIndex(1).isEqual(table6.cellForColumnAndRow(1, 2))"); // colspan=2
+ shouldBeTrue("table6.columnHeaderAtIndex(2).isEqual(table6.cellForColumnAndRow(1, 0))");
+ shouldBeTrue("table6.columnHeaderAtIndex(3).isEqual(table6.cellForColumnAndRow(2, 0))");
+ shouldBeTrue("table6.columnHeaderAtIndex(4).isEqual(table6.cellForColumnAndRow(2, 2))");
+ shouldBe("table6.columnHeadersCount", "5");
}
</script>
« no previous file with comments | « no previous file | LayoutTests/accessibility/table-headers-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698