[orca/gnome-3-6] Fix for bug 681363 - Do not display roles for non-widget lists, list items, and panels in WebKitGtk



commit fbaac34015dfe1dac265d0547c1b5b23dd2355c0
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Aug 7 11:38:19 2012 +0200

    Fix for bug 681363 - Do not display roles for non-widget lists, list items, and panels in WebKitGtk content

 .../toolkits/WebKitGtk/braille_generator.py        |   12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/scripts/toolkits/WebKitGtk/braille_generator.py b/src/orca/scripts/toolkits/WebKitGtk/braille_generator.py
index ef7c431..496414d 100644
--- a/src/orca/scripts/toolkits/WebKitGtk/braille_generator.py
+++ b/src/orca/scripts/toolkits/WebKitGtk/braille_generator.py
@@ -62,13 +62,19 @@ class BrailleGenerator(braille_generator.BrailleGenerator):
     def _generateRoleName(self, obj, **args):
         """Prevents some roles from being displayed."""
 
+        doNotDisplay = [pyatspi.ROLE_FORM,
+                        pyatspi.ROLE_SECTION,
+                        pyatspi.ROLE_UNKNOWN]
+        if not obj.getState().contains(pyatspi.STATE_FOCUSABLE):
+            doNotDisplay.extend([pyatspi.ROLE_LIST,
+                                 pyatspi.ROLE_LIST_ITEM,
+                                 pyatspi.ROLE_PANEL])
+
         result = []
         role = args.get('role', obj.getRole())
         if role == pyatspi.ROLE_HEADING:
             result.extend(self.__generateHeadingRole(obj))
-        elif not role in [pyatspi.ROLE_SECTION,
-                          pyatspi.ROLE_FORM,
-                          pyatspi.ROLE_UNKNOWN]:
+        elif not role in doNotDisplay:
             result.extend(braille_generator.BrailleGenerator._generateRoleName(
                 self, obj, **args))
             if obj.parent and obj.parent.getRole() == pyatspi.ROLE_HEADING:



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