[orca] Don't reset document loading state for nested documents



commit a58adcb04971ffe0966215fd1a1a994cd5530536
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 0f6971bb7..6fef561d9 100644
--- a/src/orca/scripts/web/script.py
+++ b/src/orca/scripts/web/script.py
@@ -1745,6 +1745,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
@@ -1754,6 +1759,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
@@ -1762,6 +1772,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]