[orca] Web: Fix regression presenting plain-text messages in Thunderbird



commit 189068c67ff3fb729c41ca099180cb72187bf923
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Sat Jun 12 16:57:20 2021 +0200

    Web: Fix regression presenting plain-text messages in Thunderbird
    
    getTopLevelDocumentForObject() might be passed an object which is the
    top level document, such as when we get a caret-moved event in a plain-
    text document in certain versions of Thunderbird. Assuming that caret-
    moved events will be emitted from a descendant of the document can
    result in our concluding the event is not from document content.

 src/orca/script_utilities.py | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/orca/script_utilities.py b/src/orca/script_utilities.py
index 2450cec48..f391c5add 100644
--- a/src/orca/script_utilities.py
+++ b/src/orca/script_utilities.py
@@ -1241,6 +1241,9 @@ class Utilities:
         return self.isDocument(obj) and not pyatspi.findAncestor(obj, self.isDocument)
 
     def getTopLevelDocumentForObject(self, obj):
+        if self.isTopLevelDocument(obj):
+            return obj
+
         return pyatspi.findAncestor(obj, self.isTopLevelDocument)
 
     def getDocumentForObject(self, obj):


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