w3c/permissions

PermissionStatus update steps touch DOM objects in parallel

jan-ivar opened this issue · 2 comments

The spec says:

image

Some questions:

  1. What does "it asynchronously runs" mean compared to "it runs"?
  2. What object does "this" refer to here? I suspect we mean "status"?
  3. (As an optimization?) It seems to reference associated Document and make a determination about fully active on a background thread. Isn't that racy (e.g. with navigation)?

By the time the queued task runs, the document may no longer be "fully active", and we fire the event on a non-fully active document, which seems wrong.

It would seem more correct to move these checks into the queued task.

For those interested, I ran into this in w3c/mediacapture-main#862 (comment) while trying to determine whether the change event fires before or after the revocation steps (I think it's before).

It also seems like this should be described in terms of https://w3c.github.io/permissions/#permission-store changing, not in terms of a platform object changing as that makes no sense.