mirror of
https://github.com/servo/servo.git
synced 2025-08-02 12:10:29 +01:00
Fix document load event firing after pipeline is closed.
This commit is contained in:
parent
fada39164c
commit
b84c6fa5db
3 changed files with 32 additions and 9 deletions
|
@ -1830,13 +1830,17 @@ impl DocumentProgressHandler {
|
|||
|
||||
impl Runnable for DocumentProgressHandler {
|
||||
fn handler(self: Box<DocumentProgressHandler>) {
|
||||
match self.task {
|
||||
DocumentProgressTask::DOMContentLoaded => {
|
||||
self.dispatch_dom_content_loaded();
|
||||
}
|
||||
DocumentProgressTask::Load => {
|
||||
self.set_ready_state_complete();
|
||||
self.dispatch_load();
|
||||
let document = self.addr.to_temporary().root();
|
||||
let window = document.r().window().root();
|
||||
if window.r().is_alive() {
|
||||
match self.task {
|
||||
DocumentProgressTask::DOMContentLoaded => {
|
||||
self.dispatch_dom_content_loaded();
|
||||
}
|
||||
DocumentProgressTask::Load => {
|
||||
self.set_ready_state_complete();
|
||||
self.dispatch_load();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue