Open cdumez opened 2 years ago
cc @domenic
cc @foolip
In general what happens in closed windows or detached iframes is not very interoperable, so I am not surprised.
I agree Safari matches the spec. And I think of the three behaviors you note it makes the most sense. So I feel like we should just update the test and file bugs on Chrome and Firefox.
/cc @jugglinmike and @zcorpan who worked on that test per https://github.com/web-platform-tests/wpt/commits/master/html/cross-origin-opener-policy/resource-popup.https.html .
I created a pull request to update the test at https://github.com/web-platform-tests/wpt/pull/29769
Perhaps @ArthurSonzogni or @antosart can take a look at this from Chromium's perspective?
FYI, the spec behavior seems to be covered by:
It is indeed passing in Safari but failing in Chrome and Firefox.
I agree the Safari/spec behavior makes sense. Thanks for fixing the test @cdumez!
I am a bit unclear about what the Location attributes should return after the window is closed.
I thought for example that w.location.href should be "about:blank" after closing the window because of this section of the spec:
For what it's worth, this is WebKit's behavior. I was investigating subtests failures on https://wpt.live/html/cross-origin-opener-policy/resource-popup.https.html and found out that the test is actually relying on w.location.href to be something other than "about:blank" after closing.
I decided to look at Firefox and Chrome and it seems nobody agrees on anything:
Firefox:
Chrome:
Safari:
My understanding was that Safari was matching the HTML specification here but I may have missed something. However, this is causing us to fail WPT tests because no other major browser engine behaves the same way and in particular, none of them have href return "about:blank" after closing.