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

Back-forward cache: browsing context change & "fully active" concept #5877

Closed
rakina opened this issue Aug 31, 2020 · 6 comments · Fixed by #6315
Closed

Back-forward cache: browsing context change & "fully active" concept #5877

rakina opened this issue Aug 31, 2020 · 6 comments · Fixed by #6315

Comments

@rakina
Copy link
Member

rakina commented Aug 31, 2020

Currently, it seems like documents that are kept alive in the back-forward cache after we navigated away from it are treated as not fully active, and thus the document will be ignored in things that might update its contents/send messages to it, etc.

However, the fully active concept seems to depend on the fact that browsing context (and browsing context group) will never change across navigations. This is not true (at least in Chrome), where we will change browsing contexts (see: #5350).

This will also affect:

I wonder if it is enough to fix this by having a "fully active" concept on browsing contexts as well. So a fully active Document is only active if the browsing context it is in is fully active as well + the existing checks. Of course, this is blocked until after we actually update the spec to allow browsing context & browsing context group changes (which is tracked in #5350 I guess?).

@rakina rakina changed the title Back-forward cache, browsing context, active documentw Back-forward cache: browsing context change & "fully active" concept Aug 31, 2020
@annevk
Copy link
Member

annevk commented Aug 31, 2020

Making it depend on browsing session seems reasonable. An alternative might be session history, depending on how that is reworked in #5767. (I expect these two concepts to be intertwined to some extent.)

@domenic
Copy link
Member

domenic commented Sep 1, 2020

I wonder if it is enough to fix this by having a "fully active" concept on browsing contexts as well. So a fully active Document is only active if the browsing context it is in is fully active as well + the existing checks.

I'm not sure I fully understand this suggestion, or the original issue. In particular, if a document changes its browsing context/BCG, the current definition of "fully active" seems to work fine.

Perhaps you could spell out the scenario where it falls down, and walk me through what the current definition says, versus what your revised definition would say?

@annevk
Copy link
Member

annevk commented Sep 1, 2020

The document does not change its browsing context. The browsing context changes. So where the current definition assumes there is a single top-level browsing context, there are now two. And only one can be considered fully active.

@domenic
Copy link
Member

domenic commented Sep 1, 2020

I guess that's the part that's not clear to me, and perhaps is just not yet well-defined. I.e. what will https://html.spec.whatwg.org/#concept-document-bc say in a world where BC/BCG switches happen.

@rakina
Copy link
Member Author

rakina commented Sep 2, 2020

Browsing context change should already be possible with COOP right? However it looks like we're immediately discarding the previous BC when that happens. Not sure on the reason behind that, but I suspect we can remove the "discard" part to allow the previous document be preserved in bfcache. I think we can modify the "fully active" bit of the old browsing context there too.

Making it depend on browsing session seems reasonable.

Do you mean browsing session, or browsing context? Maybe we can have a "fully active" document to depend on whether the "current history step" (proposed in #5767) matches, hmm... (sounds more complex than just having the bit on the browser context too though)

@annevk
Copy link
Member

annevk commented Sep 2, 2020

Yeah, COOP currently ignores/breaks bfcache and also doesn't deal well with history, which is broken in its own way.

I would expect the browsing session to identify the current/active top-level browsing context/document for that browsing session.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

3 participants