[orca] Handle layout-only descendants in table cells



commit ef02492941e99acf25cfafce435a12cc974a1cbc
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Sep 5 15:01:50 2022 +0200

    Handle layout-only descendants in table cells
    
    When attempting to get the displayed text of a table cell that has no
    children, we look for the text and fall back on the accessible name.
    But if that table cell does have children, we instead would iterate
    through them and concatenate their text/names. We were not handling the
    case where the table cell does have at least one child, but all its
    children are purely for layout (lacking text and names). We should
    handle such a table cell as if it had no children. This commit makes
    that change.
    
    See related Nautilus/Files issue #2460.

 src/orca/generator.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/generator.py b/src/orca/generator.py
index ad18b3a99..b1a768117 100644
--- a/src/orca/generator.py
+++ b/src/orca/generator.py
@@ -1223,7 +1223,10 @@ class Generator:
             return self._generateDisplayedText(rad, **args)
 
         content = set([self._script.utilities.displayedText(x).strip() for x in rad])
-        return [" ".join(filter(lambda x: x, content))]
+        rv = " ".join(filter(lambda x: x, content))
+        if not rv:
+            return self._generateDisplayedText(rad, **args)
+        return [rv]
 
     def _generateRealActiveDescendantRoleName(self, obj, **args ):
         """Objects, such as tables and trees, can represent individual cells


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]