AX: Web table row count is incorrect when role row is added to <tr> in DOM
https://bugs.webkit.org/show_bug.cgi?id=183922
Reviewed by Chris Fleizach.
Source/WebCore:
Although the parent table for an ARIA grid row should be an ARIA table, we
should return the native table if the row is native <tr>.
Test: accessibility/row-with-aria-role-in-native-table.html
* accessibility/AccessibilityARIAGridRow.cpp:
(WebCore::AccessibilityARIAGridRow::parentTable const):
LayoutTests:
* accessibility/row-with-aria-role-in-native-table-expected.txt: Added.
* accessibility/row-with-aria-role-in-native-table.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@229879 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/accessibility/row-with-aria-role-in-native-table.html b/LayoutTests/accessibility/row-with-aria-role-in-native-table.html
new file mode 100644
index 0000000..a766fd1
--- /dev/null
+++ b/LayoutTests/accessibility/row-with-aria-role-in-native-table.html
@@ -0,0 +1,32 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src="../resources/js-test-pre.js"></script>
+</head>
+<body id="body">
+
+<table id="table">
+<thead>
+<tr role="row"><th>Item 1</th></tr>
+</thead>
+<tbody></tbody>
+</table>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+ description("This tests if a native tr element uses the 'row' role, but forgets to add role='grid' to the native table element, the table still exposes the right numbers of rows/cells.");
+
+ if (window.accessibilityController) {
+ var table = accessibilityController.accessibleElementById("table");
+ shouldBe("table.rowCount", "1");
+ shouldBe("table.columnCount", "1");
+ }
+
+</script>
+
+<script src="../resources/js-test-post.js"></script>
+</body>
+</html>