orca r4085 - in trunk: . src/orca/scripts/toolkits/Gecko test/keystrokes/firefox



Author: joanied
Date: Tue Aug  5 17:51:35 2008
New Revision: 4085
URL: http://svn.gnome.org/viewvc/orca?rev=4085&view=rev

Log:
* src/orca/scripts/toolkits/Gecko/script.py:
  src/orca/scripts/toolkits/Gecko/speech_generator.py:
  src/orca/scripts/toolkits/Gecko/braille_generator.py:
  test/keystrokes/firefox/dojo_slider.py:
  test/keystrokes/firefox/dojo_tabcontainer.py:
  test/keystrokes/firefox/uiuc_tree.py:
  test/keystrokes/firefox/uiuc_grid.py:
  test/keystrokes/firefox/moz_tabpanel.py:
  Fix for bug #546355 - The ARIA gmail interface is largely unusable
  with Orca. Note that this "fix" doesn't fix everything; it is just
  the first small step in making it usable. There are still a fair
  number of known issues/bugs which we hope to address soon.


Modified:
   trunk/ChangeLog
   trunk/src/orca/scripts/toolkits/Gecko/braille_generator.py
   trunk/src/orca/scripts/toolkits/Gecko/script.py
   trunk/src/orca/scripts/toolkits/Gecko/speech_generator.py
   trunk/test/keystrokes/firefox/dojo_slider.py
   trunk/test/keystrokes/firefox/dojo_tabcontainer.py
   trunk/test/keystrokes/firefox/moz_tabpanel.py
   trunk/test/keystrokes/firefox/uiuc_grid.py
   trunk/test/keystrokes/firefox/uiuc_tree.py

Modified: trunk/src/orca/scripts/toolkits/Gecko/braille_generator.py
==============================================================================
--- trunk/src/orca/scripts/toolkits/Gecko/braille_generator.py	(original)
+++ trunk/src/orca/scripts/toolkits/Gecko/braille_generator.py	Tue Aug  5 17:51:35 2008
@@ -499,12 +499,6 @@
 
         self._debugGenerator("Gecko._getBrailleRegionsForLink", obj)
 
-        # Treat ARIA widgets like default.py widgets
-        #
-        if self._script.isAriaWidget(obj):
-            return braillegenerator.BrailleGenerator.\
-                       _getDefaultBrailleRegions(self, obj)
-        
         regions = []
 
         text = ""

Modified: trunk/src/orca/scripts/toolkits/Gecko/script.py
==============================================================================
--- trunk/src/orca/scripts/toolkits/Gecko/script.py	(original)
+++ trunk/src/orca/scripts/toolkits/Gecko/script.py	Tue Aug  5 17:51:35 2008
@@ -1175,6 +1175,16 @@
                     or obj.getRole() in [pyatspi.ROLE_ENTRY,
                                          pyatspi.ROLE_PASSWORD_TEXT]):
             displayedText = displayedText.strip()
+            # Some ARIA widgets (e.g. the list items in the chat box
+            # in gmail) implement the accessible text interface but
+            # only contain whitespace. Ultimately we should probably
+            # identify all of these instances, but for now, let's
+            # make gmail work.
+            #
+            if not displayedText \
+               and obj.getRole() == pyatspi.ROLE_LIST_ITEM \
+               and obj.getState().contains(pyatspi.STATE_FOCUSED):
+                displayedText = obj.name
 
         return displayedText
 
@@ -2636,6 +2646,14 @@
            we want to provide Orca keyboard navigation.  Returning False
            indicates that we want Firefox to handle key commands.
         """
+
+        # If the current object isn't even showing, we don't want to hand
+        # this off to Firefox's native caret navigation because who knows
+        # where we'll wind up....
+        #
+        if obj and not obj.getState().contains(pyatspi.STATE_SHOWING):
+            return True
+
         attrs = self._getAttrDictionary(orca_state.locusOfFocus)
         try:
             # ARIA landmark widgets
@@ -2644,6 +2662,12 @@
             # ARIA live region
             elif 'container-live' in attrs:
                 return True
+            # Don't treat links as ARIA widgets. And we should be able to
+            # escape/exit ARIA entries just like we do HTML entries (How
+            # is the user supposed to know which he/she happens to be in?)
+            #
+            elif obj.getRole() in [pyatspi.ROLE_ENTRY, pyatspi.ROLE_LINK]:
+                return True
             # All other ARIA widgets
             else:
                 return False
@@ -4681,7 +4705,7 @@
         done = False
         while not done:
             [firstObj, start, end] = objects[0]
-            isAria = self.isAriaWidget(firstObj)
+            isAria = not self.isNavigableAria(firstObj)
 
             text = self.queryNonEmptyText(firstObj)
             if text and start > 0 and not isAria:
@@ -4720,7 +4744,7 @@
         done = False
         while not done:
             [lastObj, start, end] = objects[-1]
-            isAria = self.isAriaWidget(lastObj)
+            isAria = not self.isNavigableAria(lastObj)
 
             text = self.queryNonEmptyText(lastObj)
             if text and end < text.characterCount - 1 and not isAria:

Modified: trunk/src/orca/scripts/toolkits/Gecko/speech_generator.py
==============================================================================
--- trunk/src/orca/scripts/toolkits/Gecko/speech_generator.py	(original)
+++ trunk/src/orca/scripts/toolkits/Gecko/speech_generator.py	Tue Aug  5 17:51:35 2008
@@ -433,12 +433,6 @@
         Returns a list of utterances to be spoken for the object.
         """
 
-        # Treat ARIA widgets like default.py widgets
-        #
-        if self._script.isAriaWidget(obj):
-            return speechgenerator.SpeechGenerator.getSpeech(obj,
-                                                             already_focused)
-        
         utterances = []
 
         if not already_focused:

Modified: trunk/test/keystrokes/firefox/dojo_slider.py
==============================================================================
--- trunk/test/keystrokes/firefox/dojo_slider.py	(original)
+++ trunk/test/keystrokes/firefox/dojo_slider.py	Tue Aug  5 17:51:35 2008
@@ -41,7 +41,7 @@
 sequence.append(KeyComboAction("Tab", 1000))
 sequence.append(utils.AssertPresentationAction(
     "tab to first slider", 
-    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider '",
+    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider  '",
      "     VISIBLE:  'Horizontal Slider Example 10 Sli', cursor=1",
      "SPEECH OUTPUT: 'Horizontal Slider Example table'",
      "SPEECH OUTPUT: 'Horizontal Slider Example slider 10'"]))
@@ -69,7 +69,7 @@
                            5000))
 sequence.append(utils.AssertPresentationAction(
     "1 move first slider", 
-    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider '",
+    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider  '",
      "     VISIBLE:  'Horizontal Slider Example 10 Sli', cursor=1",
      "SPEECH OUTPUT: '10'"]))
                             
@@ -82,7 +82,7 @@
                            5000))
 sequence.append(utils.AssertPresentationAction(
     "2 move first slider", 
-    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider '",
+    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider  '",
      "     VISIBLE:  'Horizontal Slider Example 10 Sli', cursor=1",
      "SPEECH OUTPUT: '10'"]))
                                
@@ -95,7 +95,7 @@
                            5000))
 sequence.append(utils.AssertPresentationAction(
     "3 move first slider", 
-    ["BRAILLE LINE:  'Horizontal Slider Example 11 Slider '",
+    ["BRAILLE LINE:  'Horizontal Slider Example 11 Slider  '",
      "     VISIBLE:  'Horizontal Slider Example 11 Sli', cursor=1",
      "SPEECH OUTPUT: '11'"]))
                            
@@ -108,7 +108,7 @@
                            5000))
 sequence.append(utils.AssertPresentationAction(
     "4 move first slider", 
-    ["BRAILLE LINE:  'Horizontal Slider Example 11 Slider '",
+    ["BRAILLE LINE:  'Horizontal Slider Example 11 Slider  '",
      "     VISIBLE:  'Horizontal Slider Example 11 Sli', cursor=1",
      "SPEECH OUTPUT: '11'"]))
                                
@@ -121,7 +121,7 @@
                            5000))
 sequence.append(utils.AssertPresentationAction(
     "5 move first slider", 
-    ["BRAILLE LINE:  'Horizontal Slider Example 11 Slider '",
+    ["BRAILLE LINE:  'Horizontal Slider Example 11 Slider  '",
      "     VISIBLE:  'Horizontal Slider Example 11 Sli', cursor=1",
      "SPEECH OUTPUT: '11'"]))
                                   
@@ -134,7 +134,7 @@
                            5000))
 sequence.append(utils.AssertPresentationAction(
     "6 move first slider", 
-    ["BRAILLE LINE:  'Horizontal Slider Example 11 Slider '",
+    ["BRAILLE LINE:  'Horizontal Slider Example 11 Slider  '",
      "     VISIBLE:  'Horizontal Slider Example 11 Sli', cursor=1",
      "SPEECH OUTPUT: '11'"]))
                                  
@@ -147,7 +147,7 @@
                            5000))
 sequence.append(utils.AssertPresentationAction(
     "7 move first slider", 
-    ["BRAILLE LINE:  'Horizontal Slider Example 11 Slider '",
+    ["BRAILLE LINE:  'Horizontal Slider Example 11 Slider  '",
      "     VISIBLE:  'Horizontal Slider Example 11 Sli', cursor=1",
      "SPEECH OUTPUT: '11'"]))
                                   
@@ -160,7 +160,7 @@
                            5000))
 sequence.append(utils.AssertPresentationAction(
     "8 move first slider", 
-    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider '",
+    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider  '",
      "     VISIBLE:  'Horizontal Slider Example 10 Sli', cursor=1",
      "SPEECH OUTPUT: '10'"]))
                              
@@ -173,7 +173,7 @@
                            5000))
 sequence.append(utils.AssertPresentationAction(
     "9 move first slider", 
-    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider '",
+    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider  '",
      "     VISIBLE:  'Horizontal Slider Example 10 Sli', cursor=1",
      "SPEECH OUTPUT: '10'"]))
                             
@@ -186,7 +186,7 @@
                            5000))
 sequence.append(utils.AssertPresentationAction(
     "10 move first slider", 
-    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider '",
+    ["BRAILLE LINE:  'Horizontal Slider Example 10 Slider  '",
      "     VISIBLE:  'Horizontal Slider Example 10 Sli', cursor=1",
      "SPEECH OUTPUT: '10'"]))
 

Modified: trunk/test/keystrokes/firefox/dojo_tabcontainer.py
==============================================================================
--- trunk/test/keystrokes/firefox/dojo_tabcontainer.py	(original)
+++ trunk/test/keystrokes/firefox/dojo_tabcontainer.py	Tue Aug  5 17:51:35 2008
@@ -63,7 +63,7 @@
 sequence.append(KeyComboAction("Right"))
 sequence.append(utils.AssertPresentationAction(
     "arrow to tab 3", 
-    ["BRAILLE LINE:  'TabList Tab 1 Page Tab 2 Page Tab 3 Page Inlined Sub TabContainer Page Sub TabContainer from href Page SplitContainer from href Page Tab 3 Page Panel'",
+    ["BRAILLE LINE:  'TabList Tab 1 Page Tab 2 Page Tab 3 Page Inlined Sub TabContainer Page Sub TabContainer from href Page SplitContainer from href Page Tab 3 Page'",
      "     VISIBLE:  'Tab 3 Page Inlined Sub TabContai', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Tab 3 page'"]))
@@ -74,7 +74,7 @@
 sequence.append(KeyComboAction("Right"))
 sequence.append(utils.AssertPresentationAction(
     "arrow to programmatically created tab", 
-    ["BRAILLE LINE:  'TabList Tab 1 Page Tab 2 Page Tab 3 Page Inlined Sub TabContainer Page Sub TabContainer from href Page SplitContainer from href Page Inlined Sub TabContainer Page Panel'",
+    ["BRAILLE LINE:  'TabList Tab 1 Page Tab 2 Page Tab 3 Page Inlined Sub TabContainer Page Sub TabContainer from href Page SplitContainer from href Page Inlined Sub TabContainer Page'",
      "     VISIBLE:  'Inlined Sub TabContainer Page Su', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Inlined Sub TabContainer page'"]))
@@ -84,12 +84,15 @@
 #
 sequence.append(utils.StartRecordingAction())
 sequence.append(KeyComboAction("Right"))
+sequence.append(PauseAction(1000))
 sequence.append(utils.AssertPresentationAction(
     "arrow to sub tab container", 
     ["BRAILLE LINE:  'TabList Tab 1 Page Tab 2 Page Tab 3 Page Inlined Sub TabContainer Page Sub TabContainer from href Page SplitContainer from href Page'",
      "     VISIBLE:  'Sub TabContainer from href Page ', cursor=1",
      "SPEECH OUTPUT: ''",
-     "SPEECH OUTPUT: 'Sub TabContainer from href page'"]))
+     "SPEECH OUTPUT: 'Sub TabContainer from href page'",
+     "SPEECH OUTPUT: 'Subtab #1  This is a nested tab container BUT loaded via an href.'"]))
+
 ########################################################################
 # Tab to 'SubTab2'.  The following will be presented.
 #

Modified: trunk/test/keystrokes/firefox/moz_tabpanel.py
==============================================================================
--- trunk/test/keystrokes/firefox/moz_tabpanel.py	(original)
+++ trunk/test/keystrokes/firefox/moz_tabpanel.py	Tue Aug  5 17:51:35 2008
@@ -52,7 +52,7 @@
 sequence.append(KeyComboAction("Right"))
 sequence.append(utils.AssertPresentationAction(
     "arrow to tab 2", 
-    ["BRAILLE LINE:  'Tab Zero Page Tab One Page Tab Two Page Tab Three Page Tab Four Page Tab Zero Page'",
+    ["BRAILLE LINE:  'Tab Zero Page Tab One Page Tab Two Page Tab Three Page Tab Four Page'",
      "     VISIBLE:  'Tab One Page Tab Two Page Tab Th', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Tab One page'"]))
@@ -63,7 +63,7 @@
 sequence.append(KeyComboAction("Right"))
 sequence.append(utils.AssertPresentationAction(
     "arrow to tab 3", 
-    [ "BRAILLE LINE:  'Tab Zero Page Tab One Page Tab Two Page Tab Three Page Tab Four Page Tab One Page'",
+    [ "BRAILLE LINE:  'Tab Zero Page Tab One Page Tab Two Page Tab Three Page Tab Four Page'",
      "     VISIBLE:  'Tab Two Page Tab Three Page Tab ', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Tab Two page'"]))
@@ -97,8 +97,8 @@
 sequence.append(KeyComboAction("Right"))
 sequence.append(utils.AssertPresentationAction(
     "arrow to tab 4", 
-    ["BRAILLE LINE:  'Tab Zero Page Tab One Page Tab Two Page Tab Three Page Tab Four Page Tab Two Page'",
-     "     VISIBLE:  'Tab Three Page Tab Four Page Tab', cursor=1",
+    ["BRAILLE LINE:  'Tab Zero Page Tab One Page Tab Two Page Tab Three Page Tab Four Page'",
+     "     VISIBLE:  'Tab Three Page Tab Four Page', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'Tab Three page'"]))
 ########################################################################

Modified: trunk/test/keystrokes/firefox/uiuc_grid.py
==============================================================================
--- trunk/test/keystrokes/firefox/uiuc_grid.py	(original)
+++ trunk/test/keystrokes/firefox/uiuc_grid.py	Tue Aug  5 17:51:35 2008
@@ -32,8 +32,8 @@
 sequence.append(KeyComboAction("Tab"))
 sequence.append(utils.AssertPresentationAction(
     "Tab to grid", 
-    ["BRAILLE LINE:  'E-mail List Sorted by Date Caption Sel $l'",
-     "     VISIBLE:  'E-mail List Sorted by Date Capti', cursor=0",
+    ["BRAILLE LINE:  'Sel $l'",
+     "     VISIBLE:  'Sel $l', cursor=0",
      "BRAILLE LINE:  '< > Email 0 Selected CheckBox 1 Cell Read message Image Attachment Image Lowest priority Image John Smith Cell Trip to Florida Cell 2007-10-03 Cell 2K Cell'",
      "     VISIBLE:  '< > Email 0 Selected CheckBox 1 ', cursor=1",
      "BRAILLE LINE:  '< > Email 0 Selected CheckBox 1 Cell Read message Image Attachment Image Lowest priority Image John Smith Cell Trip to Florida Cell 2007-10-03 Cell 2K Cell'",
@@ -110,9 +110,9 @@
 sequence.append(KeyComboAction("Right"))
 sequence.append(utils.AssertPresentationAction(
     "Move right on second row 3", 
-    ["BRAILLE LINE:  '< > Email 1 Selected CheckBox 2 Cell New message Image Attachment Image Low priority Image Fred Jones Cell Lunch on Friday Cell 2007-12-03 Cell 1K Cell'",
+    ["BRAILLE LINE:  'New message Image Attachment Image Low priority Image Fred Jones Cell Lunch on Friday Cell 2007-12-03 Cell 1K Cell'",
      "     VISIBLE:  'New message Image Attachment Ima', cursor=1",
-     "BRAILLE LINE:  '< > Email 1 Selected CheckBox 2 Cell New message Image Attachment Image Low priority Image Fred Jones Cell Lunch on Friday Cell 2007-12-03 Cell 1K Cell'",
+     "BRAILLE LINE:  'New message Image Attachment Image Low priority Image Fred Jones Cell Lunch on Friday Cell 2007-12-03 Cell 1K Cell'",
      "     VISIBLE:  'New message Image Attachment Ima', cursor=1",
      "SPEECH OUTPUT: ''",
      "SPEECH OUTPUT: 'New message'"]))
@@ -124,13 +124,13 @@
 sequence.append(KeyComboAction("Down"))
 sequence.append(utils.AssertPresentationAction(
     "Move down to third row", 
-    ["BRAILLE LINE:  '< > Email 2 Selected CheckBox 3 Cell New message Image None Image Jane Johnson Cell Proposal for you to review Cell 2007-16-03 Cell 12K Cell'",
-     "     VISIBLE:  'New message Image None Image Jan', cursor=1",
-     "BRAILLE LINE:  '< > Email 2 Selected CheckBox 3 Cell New message Image None Image Jane Johnson Cell Proposal for you to review Cell 2007-16-03 Cell 12K Cell'",
-     "     VISIBLE:  'New message Image None Image Jan', cursor=1",
+    ["BRAILLE LINE:  'New message Image None Image Image Jane Johnson Cell Proposal for you to review Cell 2007-16-03 Cell 12K Cell'",
+     "     VISIBLE:  'New message Image None Image Ima', cursor=1",
+     "BRAILLE LINE:  'New message Image None Image Image Jane Johnson Cell Proposal for you to review Cell 2007-16-03 Cell 12K Cell'",
+     "     VISIBLE:  'New message Image None Image Ima', cursor=1",
      "SPEECH OUTPUT: '3 New message None From Jane Johnson Subject Proposal for you to review panel'",
      "SPEECH OUTPUT: 'New message'",
-     "SPEECH OUTPUT: 'check box not checked 3 New message image None image Jane Johnson Proposal for you to review 2007-16-03 12K'"]))
+     "SPEECH OUTPUT: 'New message image None image Jane Johnson Proposal for you to review 2007-16-03 12K'"]))
 
 ########################################################################
 # Close the demo

Modified: trunk/test/keystrokes/firefox/uiuc_tree.py
==============================================================================
--- trunk/test/keystrokes/firefox/uiuc_tree.py	(original)
+++ trunk/test/keystrokes/firefox/uiuc_tree.py	Tue Aug  5 17:51:35 2008
@@ -198,9 +198,8 @@
 sequence.append(KeyComboAction("Left"))
 sequence.append(utils.AssertPresentationAction(
     "collapse vegetables", 
-    ["Bug? - list and panel should probably not be output",
-     "BRAILLE LINE:  'Vegetables ListItem Panel List'",
-     "     VISIBLE:  'Vegetables ListItem Panel List', cursor=1",
+    ["BRAILLE LINE:  'Vegetables ListItem'",
+     "     VISIBLE:  'Vegetables ListItem', cursor=1",
      "SPEECH OUTPUT: 'collapsed'"]))
 
 ########################################################################



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