[orca] Web: Don't repeat posinset when a list item is split into chunks



commit 5bb040ff92c53da354ecaf46dfa4c9ad04f6a944
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Wed Apr 20 14:23:15 2022 +0200

    Web: Don't repeat posinset when a list item is split into chunks
    
    When presenting the current line, we may have a list item substring,
    a string from a descendant element, and then another substring from
    that list item. We only want to speak the posinset for the final
    list item substring rather than repeating it.

 src/orca/scripts/web/speech_generator.py | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/src/orca/scripts/web/speech_generator.py b/src/orca/scripts/web/speech_generator.py
index d2981096f..ea594b150 100644
--- a/src/orca/scripts/web/speech_generator.py
+++ b/src/orca/scripts/web/speech_generator.py
@@ -686,6 +686,12 @@ class SpeechGenerator(speech_generator.SpeechGenerator):
         if obj.getRole() in menuRoles:
             return super()._generatePositionInList(obj, **args)
 
+        if obj.getRole() == pyatspi.ROLE_LIST_ITEM:
+            thisObjIndex = args.get('index', 0)
+            objCount = args.get('total', 1)
+            if thisObjIndex + 1 < objCount:
+                return []
+
         if self._script.utilities.isEditableComboBox(obj):
             return []
 


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