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

Unified Diff: LayoutTests/accessibility/table-header-column-row.html

Issue 816423003: Assigned ax role for table headers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
Index: LayoutTests/accessibility/table-header-column-row.html
diff --git a/LayoutTests/accessibility/table-header-column-row.html b/LayoutTests/accessibility/table-header-column-row.html
new file mode 100644
index 0000000000000000000000000000000000000000..6f99810a191bde7e5ee64b822649f92896299cea
--- /dev/null
+++ b/LayoutTests/accessibility/table-header-column-row.html
@@ -0,0 +1,102 @@
+<script src="../resources/js-test.js"></script>
+<table width="50%" 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 width="50%" 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 width="50%" 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>
+<p>End of test</p>
+<p id="description"></p>
+<div id="console"></div>
+<script>
+description("This tests that AXRoles for header cells are assigned.");
+
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+function buildAccessibilityTree(accessibilityObject, indent) {
+ if (accessibilityObject.role == 'AXRole: AXColumn' || accessibilityObject.role == 'AXRole: AXTableHeaderContainer')
+ return true;
+ var str = "";
+ for (var i = 0; i < indent; i++)
+ str += " ";
+ str += accessibilityObject.role;
+ str += " " + accessibilityObject.stringValue;
+
+ if (accessibilityObject.role == '')
+ str += accessibilityObject.allAttributes();
+
+ str += "\n";
+ document.getElementById("console").innerText += str;
+
+ if (accessibilityObject.stringValue.indexOf('End of test') >= 0)
+ return false;
+
+ var count = accessibilityObject.childrenCount;
+ for (var i = 0; i < count; ++i) {
+ if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1))
+ return false;
+ }
+
+ return true;
+}
+
+if (window.accessibilityController) {
+ var body = accessibilityController.focusedElement;
+ buildAccessibilityTree(body, 0);
+}
+</script>
« no previous file with comments | « LayoutTests/accessibility/table-cells-expected.txt ('k') | LayoutTests/accessibility/table-header-column-row-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698