[orca/gnome-3-36] Don't reset document loading state for nested documents



commit f2871c3d2b80961c9a6f7db83091ea7c93def1c2
Author: Joanmarie Diggs <jdiggs igalia com>
Date:   Fri Apr 10 16:56:02 2020 -0400

    Don't reset document loading state for nested documents
    
    We ignore busy-changed events from nested documents, but were not doing
    the same for document:load-* and reload events. As a result, we were
    incorrectly updating the loading state for child documents and then
    failing to ignore children-changed events which were irrelevant and
    potentially non-performant to process.

 src/orca/scripts/web/script.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
---
diff --git a/src/orca/scripts/web/script.py b/src/orca/scripts/web/script.py
index 45252bade..9fa15d9df 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1746,6 +1746,11 @@ class Script(default.Script):
     def onDocumentLoadComplete(self, event):
         """Callback for document:load-complete accessibility events."""
 
+        if self.utilities.getDocumentForObject(event.source.parent):
+            msg = "WEB: Ignoring: Event source is nested document"
+            debug.println(debug.LEVEL_INFO, msg, True)
+            return True
+
         msg = "WEB: Updating loading state and resetting live regions"
         debug.println(debug.LEVEL_INFO, msg, True)
         self._loadingDocumentContent = False
@@ -1755,6 +1760,11 @@ class Script(default.Script):
     def onDocumentLoadStopped(self, event):
         """Callback for document:load-stopped accessibility events."""
 
+        if self.utilities.getDocumentForObject(event.source.parent):
+            msg = "WEB: Ignoring: Event source is nested document"
+            debug.println(debug.LEVEL_INFO, msg, True)
+            return True
+
         msg = "WEB: Updating loading state"
         debug.println(debug.LEVEL_INFO, msg, True)
         self._loadingDocumentContent = False
@@ -1763,6 +1773,11 @@ class Script(default.Script):
     def onDocumentReload(self, event):
         """Callback for document:reload accessibility events."""
 
+        if self.utilities.getDocumentForObject(event.source.parent):
+            msg = "WEB: Ignoring: Event source is nested document"
+            debug.println(debug.LEVEL_INFO, msg, True)
+            return True
+
         msg = "WEB: Updating loading state"
         debug.println(debug.LEVEL_INFO, msg, True)
         self._loadingDocumentContent = True


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