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



commit 935cbeeae7cf739acadd063eb8af740eeab5453f
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]