[orca] Web: Don't announce row and column count when they are both 0
- From: Joanmarie Diggs <joanied src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [orca] Web: Don't announce row and column count when they are both 0
- Date: Fri, 21 May 2021 10:50:41 +0000 (UTC)
commit dacca976c0b1cd9fecbe02013fe3a955d1bba9a9
Author: Joanmarie Diggs <jdiggs igalia com>
Date: Fri May 21 12:46:06 2021 +0200
Web: Don't announce row and column count when they are both 0
If an author uses the grid and gridcell roles without also using the
row role (an authoring error), user agents report a table with 0 rows
and 0 columns. That's useless noise. In that case just announce the
table so the user knows they're inside one, and hope the author got
the rest of the ARIA and expected keyboard nav right.
src/orca/generator.py | 8 ++++++++
1 file changed, 8 insertions(+)
---
diff --git a/src/orca/generator.py b/src/orca/generator.py
index ea9cc74f4..e98970992 100644
--- a/src/orca/generator.py
+++ b/src/orca/generator.py
@@ -920,9 +920,17 @@ class Generator:
return []
rows, cols = self._script.utilities.rowAndColumnCount(obj)
+
+ # This suggests broken or missing table interface.
if rows < 0 or cols < 0:
return []
+ # This can happen if an author uses ARIA incorrectly, e.g. a grid whose
+ # immediate child is a gridcell rather than a row. In that case, just
+ # announce the role name.
+ if rows == 0 and cols == 0:
+ return self._generateRoleName(obj, **args)
+
return [messages.tableSize(rows, cols)]
def _generateTableCellRow(self, obj, **args):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]