Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should "traverse a history" check Document salvagability? #6045

Closed
domenic opened this issue Oct 8, 2020 · 1 comment
Closed

Should "traverse a history" check Document salvagability? #6045

domenic opened this issue Oct 8, 2020 · 1 comment

Comments

@domenic
Copy link
Member

domenic commented Oct 8, 2020

https://html.spec.whatwg.org/multipage/browsing-the-web.html#traverse-the-history step 1 checks

If entry no longer holds a Document object

(slightly modified in #6039). I believe this is meant to capture the "evicted from bfcache" case.

However, @rakina noticed in #6039 (comment) that there are cases where we mark a document as unsalvagable, but don't immediately discard it. Notably, "abort a Document", i.e. if the user presses the stop button, or a navigation starts while a document is still loading, or window.stop().

And as far as I know, unsalvagability is also supposed to indicate "do not bfcache".

Maybe what's supposed to happen here is that unsalvageable documents get discarded when you navigate away from them? Hmm, yes, that looks to be the case: https://html.spec.whatwg.org/multipage/browsing-the-web.html#unloading-documents:concept-document-salvageable-8 .

So maybe there is no issue here. @rakina, can you check my reasoning?

Even so, we might want to add a note clarifying this situation.

@rakina
Copy link
Member

rakina commented Oct 9, 2020

Thanks Domenic! I think your reasoning is correct. If a document's salvageable bit is false it will cause it to get discarded when we navigate away from it in the step you mentioned. If a parent/ancestor browsing context is navigated, it will set the salvageable bit of the navigating browsing context's document to false too, causing the whole subtree to be discarded. Very subtle :)

@rakina rakina closed this as completed Oct 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants
@domenic @rakina and others