[orca] Fix for bug 681294 - SayAll does not work as expected when focus is on a link in WebKitGtk content



commit 253e72527817d0aadad11875ff45fce745c56ae4
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Aug 6 15:08:25 2012 +0200

    Fix for bug 681294 - SayAll does not work as expected when focus is on a link in WebKitGtk content

 src/orca/scripts/toolkits/WebKitGtk/script.py |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/WebKitGtk/script.py b/src/orca/scripts/toolkits/WebKitGtk/script.py
index 4878091..10f95dc 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/script.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/script.py
@@ -534,8 +534,17 @@ class Script(default.Script):
         spoken and acss is an ACSS instance for speaking the text.
         """
 
+        if not obj:
+            return
+
+        if obj.getRole() == pyatspi.ROLE_LINK:
+            obj = obj.parent
+
         document = utils.findAncestor(
             obj, lambda x: x.getRole() == pyatspi.ROLE_DOCUMENT_FRAME)
+        if not document:
+            return
+
         allTextObjs = utils.findAllDescendants(
             document, lambda x: 'Text' in utils.listInterfaces(x))
         allTextObjs = allTextObjs[allTextObjs.index(obj):len(allTextObjs)]



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