-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Clarify Window object's close(), closed, et al #4363
Comments
Tests: web-platform-tests/wpt#15391. Helps with #4363.
We should probably explicitly define that Window object's associated browsing context is Window object's associated Document object's browsing context? |
Further discussion on that happening in #4366 (comment). Let's centralize the discussion there. |
I'm going to leave a comment here since it doesn't seem relevant for the PR per se. Other places that have this problem and I haven't fixed drive-by in #4368:
|
Previously, a Document could sometimes "have no browsing context". Now, "a Document's browsing context" is either a browsing context or null. Previously, "a Window's browsing context" was not defined, despite being referenced extensively. Now, it is defined to be the Window's associated Document's browsing context. Related to #3846, #4363, and #4366.
Tests: web-platform-tests/wpt#15391. Helps with #4363.
Tests: web-platform-tests/wpt#15391. Helps with #4363.
In particular when there's a null browsing context, for #4363. Tests: web-platform-tests/wpt#15460.
In particular when there's a null browsing context, for #4363. Tests: web-platform-tests/wpt#15460.
I looked into named getters on Window and a bit on Document, in particular around the difference when the Window's browsing context becomes null. For Window:
For Document:
So for Document Firefox probably needs to fix, for Window I'm not sure. Chrome's behavior doesn't really have any particular advantage. Arguably Chrome's behavior is closer to what the specification wants since it talks about the Window's browsing context's active document, rather than the Window's associated document. And the former would no longer be there if the browsing context is null. [This is now tracked by #4403.] |
close() needed to queue a task to close, though closed needs to immediately know when close() is invoked too. Tests: web-platform-tests/wpt#15561 & web-platform-tests/wpt#15649. Fixes #4405. Helps with #4363.
I'm going to close this as the obvious issues have been addressed. If similar issues arise or are identified they should now have a clear resolution path. |
Language from tc39/ecma262#702. Tests: web-platform-tests/wpt#15720. Helps with #4363.
Before this change these getters did not account for Window object's browsing context potentially being null, resulting in a conceptual crash. Language from tc39/ecma262#702. Tests: web-platform-tests/wpt#15720. Helps with #4363.
Before this change these getters did not account for Window object's browsing context potentially being null, resulting in a conceptual crash. Language from tc39/ecma262#702. Tests: web-platform-tests/wpt#15720. Helps with #4363.
This came up in #4350. The problem is that these members assume there's always a browsing context. But really, once it's been (synchronously) discarded, it's gone, so there needs to be some kind of null check on a
Window
object's pointer to one.(This is probably a somewhat wider problem, but fixing it in pieces seems okay. If adventurous one might also want to investigate which of
Window
/settings objects/Document
/Realm/agent would be the logical place to hold the actual pointer.)The text was updated successfully, but these errors were encountered: