w3c / geolocation

W3C Geolocation API
https://www.w3.org/TR/geolocation/
81 stars 56 forks source link

"Queue a task" / "in parallel" usage appears wrong #114

Closed domenic closed 2 years ago

domenic commented 2 years ago

https://w3c.github.io/geolocation-api/#request-position contains this sentence:

Queue a global task using the geolocation task source with global to run the following steps in parallel:

This doesn't really make any sense. Queuing a task is what you do while in parallel, to get back to the main event loop. But you are already on the main event loop. And you can't queue a task to run something in parallel.

https://html.spec.whatwg.org/#event-loop-for-spec-authors may be helpful here. In general it seems like you need an audit of all the steps in the algorithm to ensure that any that involve waiting or talking to external processes (like a location service or permissions checks) happen in parallel, while any that deal with main-thread objects (like callbacks or the current settings object or any data structures like [[watchTasks]]) happen in an appropriately-queued task.