[orca] Ensure we present functionally-empty entries from web apps



commit c7610d704d9278769f28b0be6be1a9746c70c44a
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Apr 25 17:17:52 2020 -0400

    Ensure we present functionally-empty entries from web apps
    
    Entries which are functionally empty (such as the message entry in Riot)
    but have a textblock element serving as a placeholder were being treated
    as not being a valid caret context. The reason why was that we should have
    been treating this entry as a whole rather than descending its children.
    
    Once the above issue was fixed, we were filtering out the entry for
    presentation because it was being treated as a potentially more complex
    contenteditable with no presentable string / content of its own. So don't
    treat entries whose sole child is a functional placeholder as such a beast.

 src/orca/scripts/web/script_utilities.py | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/orca/scripts/web/script_utilities.py b/src/orca/scripts/web/script_utilities.py
index ddb222790..e7bb09787 100644
--- a/src/orca/scripts/web/script_utilities.py
+++ b/src/orca/scripts/web/script_utilities.py
@@ -1019,6 +1019,11 @@ class Utilities(script_utilities.Utilities):
         if role in roles:
             return True
 
+        if role == pyatspi.ROLE_ENTRY:
+            if obj.childCount == 1 and self.isFakePlaceholderForEntry(obj[0]):
+                return True
+            return False
+
         state = obj.getState()
         if state.contains(pyatspi.STATE_EDITABLE):
             return False
@@ -4249,7 +4254,9 @@ class Utilities(script_utilities.Utilities):
             debug.println(debug.LEVEL_INFO, msg, True)
             return rv
 
-        hasTextBlockRole = lambda x: x and x.getRole() in self._textBlockElementRoles()
+        hasTextBlockRole = lambda x: x and x.getRole() in self._textBlockElementRoles() \
+            and not self.isFakePlaceholderForEntry(x)
+
         if role == pyatspi.ROLE_ENTRY and state.contains(pyatspi.STATE_MULTI_LINE):
             rv = pyatspi.findDescendant(obj, hasTextBlockRole)
         elif state.contains(pyatspi.STATE_EDITABLE):


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