Skip to content

Commit 01787ee

Browse files
rmcilroydomenic
authored andcommitted
Integrate with requestIdleCallback
This adds a hook to the event loop's processing model to define when the start of an idle period should begin. This deals with the issue in w3c/requestidlecallback#70 and calls directly into the "start an idle period" algorithm, instead of that algorithm having to having to spin the event loop. Follows w3c/requestidlecallback#75. Closes #3570 by superceding it; this simpler version avoids needing to track notifying above rejected promises or cleaning up IDB transactions.
1 parent 425a67b commit 01787ee

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

source

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4198,6 +4198,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
41984198

41994199
<ul class="brief">
42004200
<li><dfn data-x-href="https://w3c.github.io/requestidlecallback/#the-requestidlecallback-method"><code>requestIdleCallback()</code></dfn></li>
4201+
<li><dfn data-x-href="https://w3c.github.io/requestidlecallback/#start-an-idle-period-algorithm">start an idle period algorithm</dfn></li>
42014202
</ul>
42024203
</dd>
42034204

@@ -89336,6 +89337,15 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
8933689337
</ol>
8933789338
</li>
8933889339

89340+
<li><p>If this is a <span>browsing context</span> <span>event loop</span> (as opposed to a <a
89341+
href="#workers">worker</a> <span>event loop</span>), and there are no <span
89342+
data-x="concept-task">tasks</span> in the <span>event loop</span>'s <span data-x="task
89343+
queue">task queues</span>, and the <span>event loop</span>'s <span>microtask queue</span> is
89344+
empty, and none of the <span data-x="browsing context">browsing contexts</span> have a
89345+
<span>rendering opportunity</span>, then for each <span>browsing context</span>, run the steps in
89346+
the <span>start an idle period algorithm</span>, passing the <code>Window</code> associated with
89347+
that <span>browsing context</span>. <ref spec="REQUESTIDLECALLBACK"></p></li>
89348+
8933989349
<li>
8934089350
<p>Report the duration of the <span>update the rendering</span> step by performing the
8934189351
following steps:</p>
@@ -121256,7 +121266,7 @@ INSERT INTERFACES HERE
121256121266
<dd><cite><a href="https://w3c.github.io/webappsec-referrer-policy/">Referrer Policy</a></cite>, J. Eisinger, E. Stark. W3C.</dd>
121257121267

121258121268
<dt id="refsREQUESTIDLECALLBACK">[REQUESTIDLECALLBACK]</dt>
121259-
<dd>(Non-normative) <cite><a href="https://w3c.github.io/requestidlecallback/">Cooperative Scheduling of Background Tasks</a></cite>, R. McIlry, I. Grigorik. W3C.</dd>
121269+
<dd><cite><a href="https://w3c.github.io/requestidlecallback/">Cooperative Scheduling of Background Tasks</a></cite>, R. McIlroy, I. Grigorik. W3C.</dd>
121260121270

121261121271
<dt id="refsRESOURCEHINTS">[RESOURCEHINTS]</dt>
121262121272
<dd><cite><a href="https://w3c.github.io/resource-hints/">Resource Hints</a></cite>, I. Grigorik. W3C.</dd>

0 commit comments

Comments
 (0)