[orca] Web: Clear cached objects when not dumping full cache for child change



commit fa015399826762ce1ce34b39d68e88180e26c643
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Fri Oct 29 16:44:33 2021 +0200

    Web: Clear cached objects when not dumping full cache for child change
    
    In order to be performant, we only dump our full cache in response to
    children-changed events when that event is fired by the locusOfFocus
    or one of its ancestors, or the locusOfFocus is defunct. However,
    certain cached object properties may need to be updated in response
    to children changing. For instance, if a nearby and formerly empty
    div adds children, it is no longer "useless". If we don't clear such
    properties, we might skip over content.

 src/orca/scripts/web/script.py | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index ccb0afcab..08d16e760 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1778,8 +1778,10 @@ class Script(default.Script):
                 debug.println(debug.LEVEL_INFO, msg, True)
                 self.utilities.dumpCache(document, preserveContext=True)
             else:
-                msg = "WEB: Not dumping cache. Focus is %s" % orca_state.locusOfFocus
+                msg = "WEB: Not dumping full cache. Focus is %s" % orca_state.locusOfFocus
                 debug.println(debug.LEVEL_INFO, msg, True)
+                self.utilities.clearCachedObjects()
+
         elif isLiveRegion:
             if self.utilities.handleAsLiveRegion(event):
                 msg = "WEB: Event to be handled as live region"
@@ -1893,8 +1895,9 @@ class Script(default.Script):
                 debug.println(debug.LEVEL_INFO, msg, True)
                 self.utilities.dumpCache(document, preserveContext=True)
             else:
-                msg = "WEB: Not dumping cache. Focus is %s" % orca_state.locusOfFocus
+                msg = "WEB: Not dumping full cache. Focus is %s" % orca_state.locusOfFocus
                 debug.println(debug.LEVEL_INFO, msg, True)
+                self.utilities.clearCachedObjects()
 
         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]