-
Notifications
You must be signed in to change notification settings - Fork 16
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
What should happen when accessing lock manager on a non-fully-active document? #78
Comments
The Chrome implementation interestingly silently returns nothing from the methods. n.locks.request("foo", () => {}); // returns `undefined` instead of a Promise, which violates Web IDL?
n.locks.query(); // same Should it instead throw? |
I suspect both specs and implementations are wildly underspecified/tested here across the platform. IMHO, I'm happy for the spec to do whatever is most common here, and we can update the Chrome impl. Also, ideally, we'd have somewhere (Infra? WebIDL? dunno) that gives guidance on how APIs should behave in these cases. Maybe even idlharness should be testing these? Anyway, for web-locks, spec PRs & WPT PRs are very welcome. |
@marcoscaceres has recently been quite active on this topic. Hi Marcos, what's your expected behavior here? 👀 |
Coincidently, the following guidance just got merged into the TAG design guidelines: (it's what I've been following, with some guidance from @rakina) I've not looked at this API in any depth - but I'd suggest starting there. It may be you need to simply return a promise rejected with an |
To the specific question, I think we'd want:
Thoughts? Also... while full active is defined for documents, is there an easy incantation for Workers? |
FYI, c/o @domenic whatwg/html#6379 |
I think for workers there are potentially 2 lifecycle-y things?
|
I guess I was wondering what happens in a worker when the owning document goes into BFCache or is in a detached iframe. Does the worker get closed? |
The Worker's lifetime covers the general states and the processing model covers when to suspend which is on transition from "active needed worker" to "permissible worker". The processing model also covers "closing orphan workers". And then there's just explicit termination and explicit Speaking from the hip, detached iframe will terminate the worker, bfcache could potentially suspend (noting that interesting documents may tend to be forbidden from going into bfcache because of what's going on in them), but I am absolutely not up-to-date on changes made to specs resulting from standardization of bfcache, just generally aware of Firefox's implementation ramifications related to bfcache. I will edit this paragraph as I inevitably am proven to be wrong in ways big and small as my saying this compels people to reply with (more) correct answers. |
The text was updated successfully, but these errors were encountered: