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.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs
index 6ee0ec46d33..613918f6a76 100644
--- a/components/script/script_thread.rs
+++ b/components/script/script_thread.rs
@@ -1157,6 +1157,7 @@ impl ScriptThread {
AttachLayout(ref new_layout_info) => Some(new_layout_info.new_pipeline_id),
Resize(id, ..) => Some(id),
ResizeInactive(id, ..) => Some(id),
+ UnloadDocument(id) => Some(id),
ExitPipeline(id, ..) => Some(id),
ExitScriptThread => None,
SendEvent(id, ..) => Some(id),
@@ -1275,6 +1276,8 @@ impl ScriptThread {
},
ConstellationControlMsg::Navigate(parent_pipeline_id, browsing_context_id, load_data, replace) =>
self.handle_navigate(parent_pipeline_id, Some(browsing_context_id), load_data, replace),
+ ConstellationControlMsg::UnloadDocument(pipeline_id) =>
+ self.handle_unload_document(pipeline_id),
ConstellationControlMsg::SendEvent(id, event) =>
self.handle_event(id, event),
ConstellationControlMsg::ResizeInactive(id, new_size) =>
@@ -1668,6 +1671,13 @@ impl ScriptThread {
}
}
+ fn handle_unload_document(&self, pipeline_id: PipelineId) {
+ let document = self.documents.borrow().find_document(pipeline_id);
+ if let Some(document) = document {
+ document.unload(false, false);
+ }
+ }
+
fn handle_update_pipeline_id(&self,
parent_pipeline_id: PipelineId,
browsing_context_id: BrowsingContextId,