PermissionStatus update steps touch DOM objects in parallel
jan-ivar opened this issue · 2 comments
jan-ivar commented
The spec says:

Some questions:
- What does "it asynchronously runs" mean compared to "it runs"?
- What object does "this" refer to here? I suspect we mean "status"?
- (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.
jan-ivar commented
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).
annevk commented
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.