[orca] Web: Preserve context when dumping cache if inside a table



commit ad93c93e9d694c2b578c0e1d779a50f5c642ac0f
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Tue Dec 15 15:18:45 2020 +0100

    Web: Preserve context when dumping cache if inside a table
    
    Hopefully this will work around whatever bugs we're seeing in Firefox's
    table and text support that cause us to not be able to correctly locate
    our position.

 src/orca/scripts/web/script.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 8f8459f0f..556787899 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1697,7 +1697,9 @@ class Script(default.Script):
         isLiveRegion = self.utilities.isLiveRegion(event.source)
         document = self.utilities.getDocumentForObject(event.source)
         if document and not isLiveRegion:
-            self.utilities.dumpCache(document)
+            # Issues in Firefox are leading to our not relocating our position.
+            inTable = self.utilities.getTable(orca_state.locusOfFocus) is not None
+            self.utilities.dumpCache(document, preserveContext=inTable)
         else:
             msg = "WEB: Could not get document for event source"
             debug.println(debug.LEVEL_INFO, msg, True)
@@ -1795,7 +1797,9 @@ class Script(default.Script):
 
         document = self.utilities.getDocumentForObject(event.source)
         if document:
-            self.utilities.dumpCache(document)
+            # Issues in Firefox are leading to our not relocating our position.
+            inTable = self.utilities.getTable(orca_state.locusOfFocus) is not None
+            self.utilities.dumpCache(document, preserveContext=inTable)
 
         if self.utilities.handleEventForRemovedChild(event):
             msg = "WEB: Event handled for removed child."


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