[orca] Treat the redundant-object role like we do the unknown role



commit bebfe12eb5bc65a457d6cef3fd57548d058e5597
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Oct 15 17:58:00 2018 +0200

    Treat the redundant-object role like we do the unknown role

 src/orca/braille_generator.py             | 3 +++
 src/orca/script_utilities.py              | 4 +++-
 src/orca/scripts/web/braille_generator.py | 1 +
 src/orca/scripts/web/script.py            | 2 +-
 src/orca/scripts/web/script_utilities.py  | 3 ++-
 src/orca/scripts/web/speech_generator.py  | 1 +
 src/orca/speech_generator.py              | 1 +
 7 files changed, 12 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/braille_generator.py b/src/orca/braille_generator.py
index 264bd1a18..261ad07b6 100644
--- a/src/orca/braille_generator.py
+++ b/src/orca/braille_generator.py
@@ -56,6 +56,8 @@ class BrailleGenerator(generator.Generator):
     SKIP_CONTEXT_ROLES = (pyatspi.ROLE_MENU,
                           pyatspi.ROLE_MENU_BAR,
                           pyatspi.ROLE_PAGE_TAB_LIST,
+                          pyatspi.ROLE_REDUNDANT_OBJECT,
+                          pyatspi.ROLE_UNKNOWN,
                           pyatspi.ROLE_COMBO_BOX)
 
     def __init__(self, script):
@@ -140,6 +142,7 @@ class BrailleGenerator(generator.Generator):
         verbosityLevel = _settingsManager.getSetting('brailleVerbosityLevel')
 
         doNotPresent = [pyatspi.ROLE_UNKNOWN,
+                        pyatspi.ROLE_REDUNDANT_OBJECT,
                         pyatspi.ROLE_FILLER,
                         pyatspi.ROLE_EXTENDED,
                         pyatspi.ROLE_LINK]
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index c3a7767fb..d5f630c41 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -1474,6 +1474,8 @@ class Utilities:
             layoutOnly = False
         elif role == pyatspi.ROLE_LIST_ITEM and parentRole == pyatspi.ROLE_LIST_BOX:
             layoutOnly = False
+        elif role in [pyatspi.ROLE_REDUNDANT_OBJECT, pyatspi.ROLE_UNKNOWN]:
+            layoutOnly = True
         elif self.isTableRow(obj):
             state = obj.getState()
             layoutOnly = not (state.contains(pyatspi.STATE_FOCUSABLE) \
@@ -1980,7 +1982,7 @@ class Utilities:
             if visibleCells:
                 return visibleCells
 
-        nonText = [pyatspi.ROLE_STATUS_BAR, pyatspi.ROLE_UNKNOWN]
+        nonText = [pyatspi.ROLE_STATUS_BAR, pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_REDUNDANT_OBJECT]
         objects = []
         if (role == pyatspi.ROLE_PAGE_TAB and root.name) \
            or (role not in nonText and "Text" in pyatspi.listInterfaces(root)):
diff --git a/src/orca/scripts/web/braille_generator.py b/src/orca/scripts/web/braille_generator.py
index 751e9eb03..b3075f432 100644
--- a/src/orca/scripts/web/braille_generator.py
+++ b/src/orca/scripts/web/braille_generator.py
@@ -62,6 +62,7 @@ class BrailleGenerator(braille_generator.BrailleGenerator):
                         pyatspi.ROLE_PARAGRAPH,
                         pyatspi.ROLE_STATIC,
                         pyatspi.ROLE_SECTION,
+                        pyatspi.ROLE_REDUNDANT_OBJECT,
                         pyatspi.ROLE_UNKNOWN]
 
         state = obj.getState()
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index f25c0e0e6..7ca5abba1 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1143,7 +1143,7 @@ class Script(default.Script):
             if contextObj and not self.utilities.isZombie(contextObj):
                 newFocus, caretOffset = contextObj, contextOffset
 
-        if newFocus.getRole() == pyatspi.ROLE_UNKNOWN:
+        if newFocus.getRole() in [pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_REDUNDANT_OBJECT]:
             msg = "WEB: Event source has bogus role. Likely browser bug."
             debug.println(debug.LEVEL_INFO, msg, True)
             newFocus, offset = self.utilities.findFirstCaretContext(newFocus, 0)
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index fb2170c78..d56dc7f49 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -3761,7 +3761,8 @@ class Utilities(script_utilities.Utilities):
                 debug.println(debug.LEVEL_INFO, msg, True)
                 return True
 
-            if role == pyatspi.ROLE_UNKNOWN and not self._getTag(event.any_data):
+            if role in [pyatspi.ROLE_UNKNOWN, pyatspi.ROLE_REDUNDANT_OBJECT] \
+               and not self._getTag(event.any_data):
                 msg = "WEB: Child has unknown role and no tag %s" % event.any_data
                 debug.println(debug.LEVEL_INFO, msg, True)
                 return False
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index 986bd007e..4d7f9d3a3 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -305,6 +305,7 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
                           pyatspi.ROLE_MENU_ITEM,
                           pyatspi.ROLE_PARAGRAPH,
                           pyatspi.ROLE_SECTION,
+                          pyatspi.ROLE_REDUNDANT_OBJECT,
                           pyatspi.ROLE_UNKNOWN]
         else:
             doNotSpeak = [pyatspi.ROLE_UNKNOWN]
diff --git a/src/orca/speech_generator.py b/src/orca/speech_generator.py
index 8b563672d..a30f4cccb 100644
--- a/src/orca/speech_generator.py
+++ b/src/orca/speech_generator.py
@@ -365,6 +365,7 @@ class SpeechGenerator(generator.Generator):
         role = args.get('role', obj.getRole())
 
         doNotPresent = [pyatspi.ROLE_UNKNOWN,
+                        pyatspi.ROLE_REDUNDANT_OBJECT,
                         pyatspi.ROLE_FILLER,
                         pyatspi.ROLE_EXTENDED]
 


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