[orca] Ensure web script respects onlySpeakDisplayedText setting



commit 9b88bce6eab4d70da5c45f551a9cf2bdd5fb2f3a
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Nov 18 10:08:25 2019 -0500

    Ensure web script respects onlySpeakDisplayedText setting

 src/orca/scripts/web/speech_generator.py | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
---
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index 0d9526adc..e3da0f78a 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -105,6 +105,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         return super()._generateAnyTextSelection(obj, **args)
 
     def _generateHasPopup(self, obj, **args):
+        if _settingsManager.getSetting('onlySpeakDisplayedText'):
+            return []
+
         if not self._script.utilities.inDocumentContent(obj):
             return []
 
@@ -127,6 +130,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         return result
 
     def _generateClickable(self, obj, **args):
+        if _settingsManager.getSetting('onlySpeakDisplayedText'):
+            return []
+
         if not self._script.utilities.inDocumentContent(obj):
             return []
 
@@ -142,6 +148,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         return []
 
     def _generateDescription(self, obj, **args):
+        if _settingsManager.getSetting('onlySpeakDisplayedText'):
+            return []
+
         if not self._script.utilities.inDocumentContent(obj):
             return super()._generateDescription(obj, **args)
 
@@ -171,6 +180,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         return super()._generateDescription(obj, **args)
 
     def _generateHasLongDesc(self, obj, **args):
+        if _settingsManager.getSetting('onlySpeakDisplayedText'):
+            return []
+
         if not self._script.utilities.inDocumentContent(obj):
             return []
 
@@ -263,6 +275,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         return super()._generateLabel(obj, **args)
 
     def _generateNewNodeLevel(self, obj, **args):
+        if _settingsManager.getSetting('onlySpeakDisplayedText'):
+            return []
+
         if self._script.utilities.isTextBlockElement(obj) \
            or self._script.utilities.isLink(obj):
             return []
@@ -270,6 +285,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         return super()._generateNewNodeLevel(obj, **args)
 
     def _generateLeaving(self, obj, **args):
+        if _settingsManager.getSetting('onlySpeakDisplayedText'):
+            return []
+
         if not args.get('leaving'):
             return []
 
@@ -331,6 +349,9 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         return self._generateDisplayedText(obj, **args)
 
     def _generateRoleName(self, obj, **args):
+        if _settingsManager.getSetting('onlySpeakDisplayedText'):
+            return []
+
         if not self._script.utilities.inDocumentContent(obj):
             return super()._generateRoleName(obj, **args)
 


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