Hi Anne (and people I cc'd),
I am currently working on
some changes in Chrome that will result in more browsing context group changes on cross-site and same-site top-level navigations that meet some criterias (the previous page doesn't currently have any opener relationship, etc). This means scripting relationships will be carried over after navigation less often, leading to cases like the one mentioned in
crbug.com/1043162. You mentioned this behavior is OK, but we need some spec changes to make sure the behavior is clear to everyone, because the current spec only does browsing context changes implicitly.
I'm curious about which parts need to change. It seems like we might be able to follow the spec changes for
COOP and modify the
"obtain a browsing context to use for a navigation response" steps? There's also the
"rules for choosing a browsing context" but I'm not sure how that is used. Another thing you mentioned was history, which the COOP spec change does not touch. I don't think I understand that part of the spec correctly: it seems like the current specs assumes the top-level browsing context to never change (because the
joint session history only mentions one top-level browsing context?), is that true? If not, how do we get the full history for a tab that might have multiple top-level browsing context across its lifetime?
On top of that, I'm not sure how detailed we should be on saying which navigations result in a browsing context group change and which ones are not. Chrome looks at things like whether we
have a window.open relationship, but also has a
dynamic isolation system that has a list of sites to isolate, and depending on flags etc renderer-initiated navigations might or might not swap browsing context groups. How can we express these things in spec?
Related to this topic also, I wonder if frequent browsing context swaps on same-site navigations might introduce some problems. creis@ mentioned that while breaking scripting relationship on cross-site navigations is expected, breaking it on same-site navigations might have a higher chance of breaking sites, because they may have some expectation of control over their own pages' behavior. A good example is the case at
crbug.com/1043162 but with all the sites being same-site. Do you have an opinion on how bad this might be?
Thank you in advance!