aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/script_thread.rs
diff options
context:
space:
mode:
Diffstat (limited to 'components/script/script_thread.rs')
-rw-r--r--components/script/script_thread.rs11
1 files changed, 10 insertions, 1 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 934196ce120..b69eb851f2f 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -2852,6 +2852,14 @@ impl ScriptThread {
let document = self.documents.borrow_mut().remove(id);
+ // Abort the parser, if any,
+ // to prevent any further incoming networking messages from being handled.
+ if let Some(document) = document.as_ref() {
+ if let Some(parser) = document.get_current_parser() {
+ parser.abort();
+ }
+ }
+
// We should never have a pipeline that's still an incomplete load,
// but also has a Document.
debug_assert!(idx.is_none() || document.is_none());
@@ -3130,7 +3138,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| {