Bug 1620714 Comment 3 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

This is a little odd because it works fine for the [cross-origin case](https://searchfox.org/mozilla-central/rev/f1f75f0a2d995241fbc454edfab4be1064c544e1/testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js#25-28) (http://www1.web-platform.test:8000), but not for the [cross-site case](https://searchfox.org/mozilla-central/rev/f1f75f0a2d995241fbc454edfab4be1064c544e1/testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js#29-32) (http://not-web-platform.test:8000).  

Based on some brief logging, it looks like we're [_not_ going through PContent](https://searchfox.org/mozilla-central/rev/c80fa7258c935223fe319c5345b58eae85d4c6ae/docshell/base/BrowsingContext.cpp#1175-1176) for the cross-origin case (so the window is in-process? ...but we're dealing with a cross-origin window? What's going on here?), but we are for the cross-site case. And then since we don't wait for an unload/beforeunload before checking the `closed` property, we check it too soon and we see an unexpected value (since the window isn't closed yet). So I guess my initial hypothesis is that this is a timing thing. I might be missing something.
This is a little odd because it works fine for the [cross-origin case](https://searchfox.org/mozilla-central/rev/f1f75f0a2d995241fbc454edfab4be1064c544e1/testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js#25-28) (http://www1.web-platform.test:8000), but not for the [cross-site case](https://searchfox.org/mozilla-central/rev/f1f75f0a2d995241fbc454edfab4be1064c544e1/testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js#29-32) (http://not-web-platform.test:8000).  

Based on some brief logging, it looks like we're [_not_ going through PContent](https://searchfox.org/mozilla-central/rev/c80fa7258c935223fe319c5345b58eae85d4c6ae/docshell/base/BrowsingContext.cpp#1175-1176) for the cross-origin case (so the window is in-process? ...but we're dealing with a cross-origin window? What's going on here?), but we are for the cross-site case. And then since we don't wait for an unload/beforeunload before checking the `closed` property, we check it too soon and we see an unexpected value (since the window isn't closed yet). So I guess my initial hypothesis is that this is a timing thing. I might be missing something.

(just for completeness, the parent window is at http://web-platform.test:8000, and it's the [second test case](https://searchfox.org/mozilla-central/rev/f1f75f0a2d995241fbc454edfab4be1064c544e1/testing/web-platform/tests/html/browsers/the-window-object/closed-attribute.window.js#50-68) that's failing)

Back to Bug 1620714 Comment 3