[orca] Handle changes in the Firefox find toolbar hierarchy and events



commit e34c33c542f698802f5fc3143ad3a1f5a83881bb
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Jan 21 17:55:11 2014 -0500

    Handle changes in the Firefox find toolbar hierarchy and events

 src/orca/script_utilities.py              |   10 ++++++----
 src/orca/scripts/toolkits/Gecko/script.py |    4 ++++
 2 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 6c27a5f..c185d2a 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -747,11 +747,13 @@ class Utilities:
         if not obj:
             obj = orca_state.locusOfFocus
 
-        if obj and obj.getRole() == pyatspi.ROLE_ENTRY \
-           and obj.parent.getRole() == pyatspi.ROLE_TOOL_BAR:
-            return True
+        if not (obj and obj.getRole() == pyatspi.ROLE_ENTRY):
+            return False
 
-        return False
+        isToolbar = lambda x: x and x.getRole() == pyatspi.ROLE_TOOL_BAR
+        toolbar = pyatspi.findAncestor(obj, isToolbar)
+
+        return toolbar != None
 
     def isFunctionalDialog(self, obj):
         """Returns True if the window is a functioning as a dialog.
diff --git a/src/orca/scripts/toolkits/Gecko/script.py b/src/orca/scripts/toolkits/Gecko/script.py
index 80d1773..18afc54 100644
--- a/src/orca/scripts/toolkits/Gecko/script.py
+++ b/src/orca/scripts/toolkits/Gecko/script.py
@@ -993,6 +993,10 @@ class Script(default.Script):
         - event: the Event
         """
 
+        if self.utilities.inFindToolbar():
+            self.presentFindResults(event.source, -1)
+            return
+
         if not self.inDocumentContent(orca_state.locusOfFocus) \
            and self.inDocumentContent(event.source):
             return


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