[orca] Check if the roles are the same when getting common ancestor of a zombie



commit a8eb78ce7d354e8826239fda332d0dc7d542a2c3
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Thu Nov 19 12:09:20 2015 -0500

    Check if the roles are the same when getting common ancestor of a zombie
    
    Otherwise we present too much ancestry.

 src/orca/script_utilities.py |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index a1f633f..2e5fba5 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -255,9 +255,17 @@ class Utilities:
         debug.println(debug.LEVEL_FINEST,
                       "script_utilities.commonAncestor...")
 
-        if (not a or self.isZombie(a)) or (not b or self.isZombie(b)):
+        if not (a and b):
             return None
 
+        if self.isZombie(a) or self.isZombie(b):
+            try:
+                rolesAreSame = a.getRole() == b.getRole()
+            except:
+                rolesAreSame = False
+            if not rolesAreSame:
+                return None
+
         if a == b:
             return a
 


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