mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
close eventsources as part of document unloading
This commit is contained in:
parent
31da37fa6c
commit
8155cc66b0
1 changed files with 4 additions and 1 deletions
|
@ -1765,8 +1765,11 @@ impl Document {
|
|||
// Step 10, 14
|
||||
if !self.salvageable.get() {
|
||||
// https://html.spec.whatwg.org/multipage/#unloading-document-cleanup-steps
|
||||
let global_scope = self.window.upcast::<GlobalScope>();
|
||||
// Step 1 of clean-up steps.
|
||||
global_scope.close_event_sources();
|
||||
let msg = ScriptMsg::DiscardDocument;
|
||||
let _ = self.window.upcast::<GlobalScope>().script_to_constellation_chan().send(msg);
|
||||
let _ = global_scope.script_to_constellation_chan().send(msg);
|
||||
}
|
||||
// Step 15, End
|
||||
self.decr_ignore_opens_during_unload_counter();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue