-
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
Editorial: expose "run steps after a timeout" #7349
Conversation
This factors out a new algorithm which can be used by postTask() (https://wicg.github.io/scheduling-apis/#schedule-a-posttask-task) and AbortSignal.timeout() (whatwg/dom#1032), ensuring that they correctly contribute to idle deadline computation and in general share all the appropriate logic with setTimeout() and setInterval(). This also exports the "timer task source" term since AbortSignal.abort() will want to use that.
0bdf95e
to
6949e88
Compare
than zero that will identify the timeout to be set by this call in <var>global</var>'s <span>map | ||
of active timers</span>.</p></li> | ||
than zero and does not already <span data-x="map exists">exist</span> in <var>global</var>'s | ||
<span>map of active timers</span>.</p></li> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This implies that a now-cleared ID can be reused, even if less than 2^31 timers have been created so far. But this is probably best left for #7358.
|
||
<p>Otherwise, <var>global</var> is a <code>WorkerGlobalScope</code> object; wait until | ||
<var>milliseconds</var> milliseconds have passed with the worker not suspended (not | ||
necessarily consecutively).</p> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this xref "active needed worker"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The interaction with the closing flag in https://html.spec.whatwg.org/#worker-processing-model:suspendable-worker makes me not 100% sure they are equivalent, so I'll leave it for now...
In whatwg/html#7349, the HTML spec factored out part of the infrastructure for `setTimeout()` into a "run steps after a timeout" algorithm for use by other specs. This change updates `requestIdleCallback()` to use that algorithm when the `timeout` property is present and positive.
This factors out a new algorithm which can be used by postTask() (https://wicg.github.io/scheduling-apis/#schedule-a-posttask-task) and AbortSignal.timeout() (whatwg/dom#1032), ensuring that they correctly contribute to idle deadline computation and in general share all the appropriate logic with setTimeout() and setInterval().
This also exports the "timer task source" term since AbortSignal.abort() will want to use that.
/timers-and-user-prompts.html ( diff )
/webappapis.html ( diff )