WICG / page-lifecycle

Lifecycle API to support system initiated discarding and freezing
https://wicg.github.io/page-lifecycle/
Other
154 stars 12 forks source link

When do we set wasDiscarded #15

Closed domenic closed 6 years ago

domenic commented 6 years ago

I don't think the location of this step is quite right:

If the browsing context was previously DISCARDED then wasDiscarded must be set to true on its active document and on all documents of its nested browsing contexts.

In particular, in step 1 of navigate, no Documents have even been created.

I think this would probably end up in https://html.spec.whatwg.org/multipage/browsing-the-web.html#initialise-the-document-object.

For the nested documents, I think we don't need to do anything special, because if you discard the top-level browsing context, you will also discard the descendants. So they will all set wasDiscarded correctly, as long as we note that they were discarded and not just destroyed.

spanicker commented 6 years ago

Yeah that was sloppy, I couldn't find the right place and used navigate :) Thanks for the pointer. Updated, PTAL.