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

Can a fully active document have a null browsing context? #9509

Closed
rakuco opened this issue Jul 12, 2023 · 1 comment
Closed

Can a fully active document have a null browsing context? #9509

rakuco opened this issue Jul 12, 2023 · 1 comment

Comments

@rakuco
Copy link
Member

rakuco commented Jul 12, 2023

I'm asking this in the context of w3c/screen-wake-lock#362 -- one of the spec's algorithms does something like this:

  • Let document be this's relevant global object's associated Document.
  • ...
  • If document's browsing context is null, return a promise rejected with "NotAllowedError" DOMException.
  • If document is not fully active, return a promise rejected with with a "NotAllowedError" DOMException.
  • ...

I'd like to remove the browsing context check, as I can't think of a case where the relevant global object's associated Document is fully active and has a null browsing context, but I feel like I should double check first.

@domenic
Copy link
Member

domenic commented Jul 13, 2023

This is not possible.

All documents that are even put into session history, are created through algorithms which set their browsing context to a non-null value.

Then, for the case of the browsing context becoming null, that only happens in https://html.spec.whatwg.org/#destroy-a-document , which makes the document non-active in step 7.

Hope this helps!

@domenic domenic closed this as completed Jul 13, 2023
rakuco added a commit to w3c/screen-wake-lock that referenced this issue Jul 14, 2023
Since whatwg/html#6315, the HTML spec suggests other specifications use
"navigable" and associated concepts (along with Document) rather than
"browsing context" in most cases.

In this specific case, however, we can simply remove the step that checks if
`document`'s browsing context is null -- there is no case in which a
document is fully active _and_ has a null browsing context, as confirmed by
whatwg/html#9509.

Fixes #362.
rakuco added a commit to w3c/screen-wake-lock that referenced this issue Jul 14, 2023
Since whatwg/html#6315, the HTML spec suggests other specifications use
"navigable" and associated concepts (along with Document) rather than
"browsing context" in most cases.

In this specific case, however, we can simply remove the step that checks if
`document`'s browsing context is null -- there is no case in which a
document is fully active _and_ has a null browsing context, as confirmed by
whatwg/html#9509.

Fixes #362.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants