-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
How can microtasks run without a task? #7845
Comments
Yeah, microtask's generic model is end-of-outermost script execution or end of task. So under 2 sounds reasonable. |
(Separately, I'm not quite sure step 7 follows what the browsers do. At least in Gecko 'Update the rendering' happens effectively inside a task) |
I'm not sure. Basically saying that we don't support this means we don't support implementations enqueuing microtasks, unless they do so from inside a task. I think there are at least some instances of this, e.g. all the calls to "await a stable state". |
Hmm yeah, "await a stable state" looks like a bug, because that could interfere with the microtask queue of a currently running task, which seems bad? (This is a problem we have been trying to remove from specifications over the years, as many of them enqueued microtasks without a corresponding task.) I guess there's a larger question as to whether the microtask queue could be owned by a task. That might avoid some of this. |
This depends on #2882 to some extent I suppose. We could use an existing task source for "await a stable state", but that would not be particularly accurate either I think. |
This further highlights the brokenness of "await a stable state". Tackling that fully is tracked by whatwg#2882. Fixes whatwg#7845.
I was looking at the final patch of #7768 and it struck me that it implies a microtask checkpoint can be performed when there are no tasks on the queue. However, that assumes a microtask can be enqueued without a corresponding task, right? I don't think that's something we mean to support.
Should what is now step 3 of https://html.spec.whatwg.org/#event-loop-processing-model be nested under step 2?
cc @smaug----
The text was updated successfully, but these errors were encountered: