[orca/gnome-3-14] Don't descend tables in findReplicant()



commit 4b8cdc4f2b36f38109d0b1a7d14309c198619e61
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Nov 5 07:47:42 2014 -0500

    Don't descend tables in findReplicant()
    
    findReplicant() is a workaround for Gecko's killing the focused accessible
    object in response to less-than-ideal authoring practices. If the root is
    a table with a broken hierarchy, pyatspi's findDescendant() can hang. :(

 .../scripts/toolkits/Gecko/script_utilities.py     |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/script_utilities.py 
b/src/orca/scripts/toolkits/Gecko/script_utilities.py
index 860f69a..f775fc0 100644
--- a/src/orca/scripts/toolkits/Gecko/script_utilities.py
+++ b/src/orca/scripts/toolkits/Gecko/script_utilities.py
@@ -1133,6 +1133,12 @@ class Utilities(script_utilities.Utilities):
         if not (root and obj):
             return None
 
+        # Given an broken table hierarchy, findDescendant can hang. And the
+        # reason we're here in the first place is to work around Gecko's
+        # killing the focused accessible. There's only so much we can do....
+        if root.getRole() == pyatspi.ROLE_TABLE:
+            return None
+
         isSame = lambda x: x and self.isSameObject(x, obj, comparePaths=True)
         if isSame(root):
             replicant = root


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