[orca] Fix for bgo#589455 - Can not activate links with structural navigation keys



commit 89fed9314ca57d62f7321013c13e7abc6f10c4c9
Author: Joanmarie Diggs <joanmarie diggs gmail com>
Date:   Sat Jul 25 23:19:36 2009 -0400

    Fix for bgo#589455 - Can not activate links with structural navigation keys
    
    This adds an explicit grab_focus in the Gecko structural_navigation.py if the object happens to be a link.

 .../toolkits/Gecko/structural_navigation.py        |    6 ++++
 test/keystrokes/firefox/bug_589455.py              |   30 +++++++++++++++++++-
 2 files changed, 35 insertions(+), 1 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/Gecko/structural_navigation.py b/src/orca/scripts/toolkits/Gecko/structural_navigation.py
index 7dfcbe0..62cb1f9 100644
--- a/src/orca/scripts/toolkits/Gecko/structural_navigation.py
+++ b/src/orca/scripts/toolkits/Gecko/structural_navigation.py
@@ -139,6 +139,12 @@ class GeckoStructuralNavigation(structural_navigation.StructuralNavigation):
     def _presentObject(self, obj, offset):
         """Presents the entire object to the user."""
 
+        if obj.getRole() == pyatspi.ROLE_LINK:
+            try:
+                obj.queryComponent().grabFocus()
+            except:
+                pass
+
         self._script.updateBraille(obj)
         contents = self._script.getObjectContentsAtOffset(obj, offset)
         self._script.speakContents(contents)
diff --git a/test/keystrokes/firefox/bug_589455.py b/test/keystrokes/firefox/bug_589455.py
index 17a6f0a..ea44897 100644
--- a/test/keystrokes/firefox/bug_589455.py
+++ b/test/keystrokes/firefox/bug_589455.py
@@ -53,7 +53,35 @@ sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("Return"))
 sequence.append(utils.AssertPresentationAction(
     "Press Return to active the link",
-    ["BUG? - We should get something here because the link should have focus and thus pressing Enter on it should activate the link."]))
+    ["BRAILLE LINE:  'Loading.  Please wait.'",
+     "     VISIBLE:  'Loading.  Please wait.', cursor=0",
+     "BRAILLE LINE:  'Finished loading Links to test files.'",
+     "     VISIBLE:  'Finished loading Links to test f', cursor=0",
+     "BRAILLE LINE:  'Here are some of our local test files:'",
+     "     VISIBLE:  'Here are some of our local test ', cursor=1",
+     "BRAILLE LINE:  'Here are some of our local test files:'",
+     "     VISIBLE:  'Here are some of our local test ', cursor=1",
+     "SPEECH OUTPUT: 'Loading.  Please wait.'",
+     "SPEECH OUTPUT: 'Finished loading Links to test files.'",
+     "SPEECH OUTPUT: 'Here are some of our local test files:'",
+     "SPEECH OUTPUT: 'â?¢ anchors.html link'",
+     "SPEECH OUTPUT: 'â?¢ blockquotes.html link'",
+     "SPEECH OUTPUT: 'â?¢ bugzilla_top.html link'",
+     "SPEECH OUTPUT: 'â?¢ combobox.html link'",
+     "SPEECH OUTPUT: 'â?¢ fieldset.html link'",
+     "SPEECH OUTPUT: 'â?¢ htmlpage.html link'",
+     "SPEECH OUTPUT: 'â?¢ image-test.html link'",
+     "SPEECH OUTPUT: 'â?¢ linebreak-test.html link'",
+     "SPEECH OUTPUT: 'â?¢ lists.html link'",
+     "SPEECH OUTPUT: 'â?¢ samesizearea.html link'",
+     "SPEECH OUTPUT: 'â?¢ simpleform.html link'",
+     "SPEECH OUTPUT: 'â?¢ simpleheader.html link'",
+     "SPEECH OUTPUT: 'â?¢ slash-test.html link'",
+     "SPEECH OUTPUT: 'â?¢ status-bar.html link'",
+     "SPEECH OUTPUT: 'â?¢ tables.html link'",
+     "SPEECH OUTPUT: 'â?¢ textattributes.html link'",
+     "SPEECH OUTPUT: 'Here are some of our local test files:'",
+     "SPEECH OUTPUT: '100 percent'"]))
 
 ########################################################################
 # Close the demo



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