Skip to content

Commit

Permalink
WIP render as task
Browse files Browse the repository at this point in the history
  • Loading branch information
noamr committed Dec 19, 2023
1 parent 6bc6e2d commit 61682d0
Showing 1 changed file with 38 additions and 4 deletions.
42 changes: 38 additions & 4 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -3380,6 +3380,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
data-x-href="https://w3c.github.io/hr-time/#dfn-unsafe-shared-current-time">unsafe shared
current time</dfn>, the <dfn
data-x-href="https://w3c.github.io/hr-time/#dfn-shared-monotonic-clock">shared monotonic clock</dfn>,
the <dfn data-x-href="https://w3c.github.io/hr-time/#dfn-unsafe-moment">unsafe moment</dfn>,
the <dfn data-x-href="https://w3c.github.io/hr-time/#dfn-coarsen-time">coarsen time</dfn>
algorithm, and the <dfn
data-x-href="https://w3c.github.io/hr-time/#dom-domhighrestimestamp"><code>DOMHighResTimeStamp</code></dfn>
Expand Down Expand Up @@ -108122,8 +108123,8 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
</li>

<li>
<p><dfn export>Update the rendering</dfn>: if this is a <span>window event loop</span>,
then:</p>
<p>Let <dfn export>Update the rendering</dfn> be the following steps given an
<span>unsafe moment</span> <var>frameTimestamp</var>:</p>

<ol>
<li>
Expand Down Expand Up @@ -108233,7 +108234,7 @@ import "https://example.com/foo/../module2.mjs";</code></pre>

<li><p>For each <span>fully active</span> <code>Document</code> in <var>docs</var>,
<span>update animations and send events</span> for that <code>Document</code>, passing in
<span>relative high resolution time</span> given <var>now</var> and that
<span>relative high resolution time</span> given <var>frameTimestamp</var> and that
<code>Document</code>'s <span>relevant global object</span> as the timestamp.
<ref>WEBANIMATIONS</ref></p></li>

Expand Down Expand Up @@ -108278,7 +108279,7 @@ import "https://example.com/foo/../module2.mjs";</code></pre>

<li><p>For each <span>fully active</span> <code>Document</code> in <var>docs</var>, <span>run
the animation frame callbacks</span> for that <code>Document</code>, passing in the
<span>relative high resolution time</span> given <var>now</var> and that
<span>relative high resolution time</span> given <var>frameTimestamp</var> and that
<code>Document</code>'s <span>relevant global object</span> as the timestamp.</p></li>

<li>
Expand Down Expand Up @@ -108389,6 +108390,33 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
</ol>
</li>

<li>
<p>If this is a <span>window event loop</span>, then run the following steps
<span>in parallel</span>:</p>

<ol>
<li><p>Wait until at least one <span>navigable</span> <var>navigable</var> whose <span
data-x="nav-document">active document</span>'s <span>relevant agent</span>'s <span
data-x="concept-agent-event-loop">event loop</span> is this event loop might have a
<span>rendering opportunity</span>.</p></li>

<li><p>Let <var>frameTimestamp</var> be the <span>unsafe shared current time</span>.</p></li>

<li>
<p>For each <var>navigable</var> that might have a <span>rendering opportunity</span>,
<span>queue a global task</span> on the <span>rendering task source</span> given
<var>navigable</var>'s <span data-x="nav-document">active document</span>'s
<span>relevant global object</span> to <span>update the rendering</span> given
<var>frameTimestamp</var>.</p>

<p class="note">The <span>update the rendering</span> steps would update all documents in this
<span>event loop</span> that have a <span>rendering opportunity</span>. The purpose of these
<span>in parallel</span> steps is to guarantee that the <span>update the rendering</span> step
is scheduled as a <span data-x="concept-task">task</span>.</p>
</li>
</ol>
</li>

<li id="idle-deadline-computation">
<p>If all of the following are true:</p>

Expand Down Expand Up @@ -108844,6 +108872,12 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
data-x="navigate">navigation</span> and <span data-x="apply the traverse history step">history
traversal</span>.</p>
</dd>

<dt>The <dfn export>rendering task source</dfn></dt>

<dd>
<p>This <span>task source</span> us used solely to <span>update the rendering</span>.
</dd>
</dl>

<h5 id="event-loop-for-spec-authors">Dealing with the event loop from other specifications</h5>
Expand Down

0 comments on commit 61682d0

Please sign in to comment.