-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Labels
A-content/scriptRelated to the script threadRelated to the script thread
Description
We implement a subset of checks from https://html.spec.whatwg.org/#unloading-document-cleanup-steps right now, which influence whether a document is considered salvageable or not:
servo/components/script/dom/document.rs
Lines 2462 to 2466 in 1489de1
let event_sources_canceled = self.window.as_global_scope().close_event_sources(); if loads_cancelled || event_sources_canceled { // If any loads were canceled. self.salvageable.set(false); }; servo/components/script/dom/document.rs
Lines 2102 to 2107 in 1489de1
// https://html.spec.whatwg.org/multipage/#unloading-document-cleanup-steps if !self.salvageable.get() { // Step 1 of clean-up steps. global_scope.close_event_sources(); let msg = ScriptToConstellationMessage::DiscardDocument; let _ = global_scope.script_to_constellation_chan().send(msg);
Unsalvageable documents do not get put in the bfcache. There are a bunch of WPT tests that rely on the websocket checks to force a document to be kept out of the bfcache, and we don't implement that right now.
We should use a similar model as the EventSource code in globalscope.rs for tracking all WebSocket objects so we can implement the checks correctly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-content/scriptRelated to the script threadRelated to the script thread