Bug 1499828 Part 5 - Don't suppress events when pausing in the middleman, r=lsmyth.
authorBrian Hackett <bhackett1024@gmail.com>
Wed, 17 Oct 2018 13:32:46 -0600
changeset 490601 18f2ea8c2a1978a36ed6b3124f9ce213da7726dc
parent 490600 925e342d29d805f96f06ebd99a4679cd2fd72ecd
child 490602 ae91c0db8005dd58d87b9acd8160ceacbb20db72
push id247
push userfmarier@mozilla.com
push dateSat, 27 Oct 2018 01:06:44 +0000
reviewerslsmyth
bugs1499828
milestone64.0a1
Bug 1499828 Part 5 - Don't suppress events when pausing in the middleman, r=lsmyth.
devtools/server/actors/targets/browsing-context.js
--- a/devtools/server/actors/targets/browsing-context.js
+++ b/devtools/server/actors/targets/browsing-context.js
@@ -1178,31 +1178,40 @@ const browsingContextTargetPrototype = {
    * Prepare to enter a nested event loop by disabling debuggee events.
    */
   preNest() {
     if (!this.window) {
       // The browsing context is already closed.
       return;
     }
     const windowUtils = this.window.windowUtils;
-    windowUtils.suppressEventHandling(true);
+
+    // Events are not suppressed when running in the middleman, as we are in a
+    // different process from the debuggee and may want to process events in
+    // the middleman for e.g. the overlay drawn when rewinding.
+    if (Debugger.recordReplayProcessKind() != "Middleman") {
+      windowUtils.suppressEventHandling(true);
+    }
+
     windowUtils.suspendTimeouts();
   },
 
   /**
    * Prepare to exit a nested event loop by enabling debuggee events.
    */
   postNest(nestData) {
     if (!this.window) {
       // The browsing context is already closed.
       return;
     }
     const windowUtils = this.window.windowUtils;
     windowUtils.resumeTimeouts();
-    windowUtils.suppressEventHandling(false);
+    if (Debugger.recordReplayProcessKind() != "Middleman") {
+      windowUtils.suppressEventHandling(false);
+    }
   },
 
   _changeTopLevelDocument(window) {
     // Fake a will-navigate on the previous document
     // to let a chance to unregister it
     this._willNavigate(this.window, window.location.href, null, true);
 
     this._windowDestroyed(this.window, null, true);