aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--components/script/dom/window.rs13
-rw-r--r--components/script/script_thread.rs3
-rw-r--r--tests/wpt/metadata/html/semantics/scripting-1/the-script-element/execution-timing/083.html.ini1
3 files changed, 14 insertions, 3 deletions
diff --git a/components/script/dom/window.rs b/components/script/dom/window.rs
index 87c80ce62d0..0c3a2db0899 100644
--- a/components/script/dom/window.rs
+++ b/components/script/dom/window.rs
@@ -1389,7 +1389,18 @@ impl Window {
self.current_state.set(WindowState::Zombie);
*self.js_runtime.borrow_mut() = None;
- self.window_proxy.set(None);
+
+ // If this is the currently active pipeline,
+ // nullify the window_proxy.
+ if let Some(proxy) = self.window_proxy.get() {
+ let pipeline_id = self.upcast::<GlobalScope>().pipeline_id();
+ if let Some(currently_active) = proxy.currently_active() {
+ if currently_active == pipeline_id {
+ self.window_proxy.set(None);
+ }
+ }
+ }
+
if let Some(performance) = self.performance.get() {
performance.clear_and_disable_performance_entry_buffer();
}
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 81784d73a6c..a9ebd9eb46c 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -3125,7 +3125,8 @@ impl ScriptThread {
opener: Option<BrowsingContextId>,
) -> DomRoot<WindowProxy> {
if let Some(window_proxy) = self.window_proxies.borrow().get(&browsing_context_id) {
- window_proxy.set_currently_active(&*window);
+ // Note: we do not set the window to be the currently-active one,
+ // this will be done instead when the script-thread handles the `SetDocumentActivity` msg.
return DomRoot::from_ref(window_proxy);
}
let iframe = parent_info.and_then(|parent_id| {
diff --git a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/execution-timing/083.html.ini b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/execution-timing/083.html.ini
index 242251f7104..9272fa0716d 100644
--- a/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/execution-timing/083.html.ini
+++ b/tests/wpt/metadata/html/semantics/scripting-1/the-script-element/execution-timing/083.html.ini
@@ -1,6 +1,5 @@
[083.html]
type: testharness
- expected: ERROR
[ scheduler: event listener defined by script in a document in history]
expected: FAIL