Skip to content
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

Add the ability to queue an element task. #5072

Merged
merged 4 commits into from
Dec 5, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 30 additions & 19 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -27905,7 +27905,7 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
pixel density</var>.</p></li>

<li>
<p><span>Queue a task</span> to:</p>
<p><span>Queue an element task</span> given <code>img</code> element and steps:</p>
domenic marked this conversation as resolved.
Show resolved Hide resolved

<ol>
<li><p>If <i>restart animation</i> is set, then <span>restart the
Expand Down Expand Up @@ -27955,12 +27955,12 @@ was an English &lt;a href="/wiki/Music_hall">music hall&lt;/a> singer, ...</code
image request</span> for the <span>current request</span> and the <span>pending request</span>,
and set <span>pending request</span> to null.</p></li>

<li><p>&#x231B; <span>Queue a task</span> to change the <span>current request</span>'s <span
data-x="img-req-url">current URL</span> to the empty string, and then, if the element has a
<code data-x="attr-img-src">src</code> attribute or it <span data-x="use srcset or
picture">uses <code>srcset</code> or <code>picture</code></span>, <span
data-x="concept-event-fire">fire an event</span> named <code data-x="event-error">error</code>
at the <code>img</code> element.</p></li>
<li><p>&#x231B; <span>Queue an element task</span> given <code>img</code> element, and the
domenic marked this conversation as resolved.
Show resolved Hide resolved
following steps: change the <span>current request</span>'s <span data-x="img-req-url">current
URL</span> to the empty string, and then, if the element has a <code
data-x="attr-img-src">src</code> attribute or it <span data-x="use srcset or picture">uses
domenic marked this conversation as resolved.
Show resolved Hide resolved
<code>srcset</code> or <code>picture</code></span>, <span data-x="concept-event-fire">fire an
event</span> named <code data-x="event-error">error</code> at the <code>img</code> element.</p></li>

<li><p>&#x231B; Return.</p></li>
</ol>
Expand Down Expand Up @@ -91317,13 +91317,10 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
<h5>Queuing tasks</h5>

<p>To <dfn data-export="">queue a task</dfn> on a <span>task source</span> <var>source</var>,
which performs a series of steps <var>steps</var>, optionally given an event loop <var>event
loop</var>:</p>
which performs a series of steps <var>steps</var>, given an event loop <var>event
loop</var>, and optionally a document <var>document</var>:</p>

<ol>
<li><p>If <var>event loop</var> was not given, set <var>event loop</var> to the <span>implied
event loop</span>.</p></li>
domenic marked this conversation as resolved.
Show resolved Hide resolved

<li><p>Let <var>task</var> be a new <span data-x="concept-task">task</span>.</p></li>

<li><p>Set <var>task</var>'s <span data-x="concept-task-steps">steps</span> to
Expand All @@ -91333,7 +91330,7 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
<var>source</var>.</p></li>

<li><p>Set <var>task</var>'s <span data-x="concept-task-document">document</span> to the
<span>implied document</span>.</p></li>
<var>document</var>.</p></li>

<li><p>Set <var>task</var>'s <span>script evaluation environment settings object set</span> to an
empty <span>set</span>.</p></li>
Expand All @@ -91344,13 +91341,27 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
<li><p><span data-x="list append">Append</span> <var>task</var> to <var>queue</var>.</p></li>
</ol>

<p>To <dfn data-export="">queue a microtask</dfn> which performs a series of steps
<var>steps</var>, optionally given an event loop <var>event loop</var>:</p>
<p>To <dfn data-export="">queue an element task</dfn> on a <span>task source</span>
<var>source</var>, with an element <var>element</var>, and a series of steps
domenic marked this conversation as resolved.
Show resolved Hide resolved
<var>steps</var>:</p>

<ol>
<li><p>If <var>event loop</var> was not given, set <var>event loop</var> to the <span>implied
event loop</span>.</p></li>
<li><p>Let <var>document</var> be <var>element</var>'s <span>node document</span>.</p></li>

<li><p>Let <var>event loop</var> be <var>document</var>'s <span
data-x="concept-relevant-realm">relevant realm</span>'s corresponding <span>agent</span>'s
<span>event loop</span>.</p></li>

<li><p>Run <span>queue a task</span> given <var>source</var>, <var>event loop</var> and
<var>document</var>.</p></li>
domenic marked this conversation as resolved.
Show resolved Hide resolved

</ol>

<p>To <dfn data-export="">queue a microtask</dfn> which performs a series of steps
<var>steps</var>, given an event loop <var>event loop</var>, and optionally a document
domenic marked this conversation as resolved.
Show resolved Hide resolved
<var>document</var>:</p>

<ol>
<li><p>Let <var>microtask</var> be a new <span data-x="concept-task">task</span>.</p></li>

<li><p>Set <var>microtask</var>'s <span data-x="concept-task-steps">steps</span> to
Expand All @@ -91359,8 +91370,8 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
<li><p>Set <var>microtask</var>'s <span data-x="concept-task-source">source</span> to the
<dfn>microtask task source</dfn>.</p></li>

<li><p>Set <var>microtask</var>'s <span data-x="concept-task-document">document</span> to the
<span>implied document</span>.</p></li>
<li><p>Set <var>microtask</var>'s <span data-x="concept-task-document">document</span> to
<var>document</var>.</p></li>
domenic marked this conversation as resolved.
Show resolved Hide resolved

<li><p>Set <var>task</var>'s <span>script evaluation environment settings object set</span> to an
empty <span>set</span>.</p></li>
Expand Down