[orca] Web: Fix SayAll for rich-text editors



commit 4d47524ddb1a8cc869bf1573885e6736e8c2e944
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Mon Nov 1 14:45:23 2021 +0100

    Web: Fix SayAll for rich-text editors
    
    The element descendants of a rich-text editor will likely not have the
    focused state like a plain-text field. The lack of focused state was
    causing us to ascend the accessibility tree at the start of a SayAll
    to piece together contents. Therefore also check for contenteditable
    content as well.

 src/orca/scripts/web/script_utilities.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index 605aa70f2..d45a188e6 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -1450,9 +1450,11 @@ class Utilities(script_utilities.Utilities):
         boundary = pyatspi.TEXT_BOUNDARY_SENTENCE_START
         objects = self._getContentsForObj(obj, offset, boundary)
         state = obj.getState()
-        if state.contains(pyatspi.STATE_EDITABLE) \
-           and state.contains(pyatspi.STATE_FOCUSED):
-            return objects
+        if state.contains(pyatspi.STATE_EDITABLE):
+            if state.contains(pyatspi.STATE_FOCUSED):
+                return objects
+            if self.isContentEditableWithEmbeddedObjects(obj):
+                return objects
 
         def _treatAsSentenceEnd(x):
             xObj, xStart, xEnd, xString = x


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