mirror of
https://github.com/servo/servo.git
synced 2025-06-10 17:43:16 +00:00
beforeunload and unload infrastructure
This commit is contained in:
parent
a1d1b18710
commit
427eaed535
28 changed files with 267 additions and 60 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue