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 all commits
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
55 changes: 43 additions & 12 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -27905,7 +27905,8 @@ 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> on the <span>DOM manipulation task source</span>
domenic marked this conversation as resolved.
Show resolved Hide resolved
given the <code>img</code> element and following steps:</p>

<ol>
<li><p>If <i>restart animation</i> is set, then <span>restart the
Expand Down Expand Up @@ -27955,12 +27956,20 @@ 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>

domenic marked this conversation as resolved.
Show resolved Hide resolved
<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> on the <span>DOM manipulation task
source</span> given the <code>img</code> element and the following steps:</p>
domenic marked this conversation as resolved.
Show resolved Hide resolved

<ol>
<li><p>Change the <span>current request</span>'s <span data-x="img-req-url">current
URL</span> to the empty string.</p></li>

<li><p>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>
</ol>
</li>

<li><p>&#x231B; Return.</p></li>
</ol>
Expand Down Expand Up @@ -91318,12 +91327,15 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {

<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>
loop</var> and 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>If <var>document</var> was not given, set <var>document</var> to the <span>implied
document</span>.</p></li>

<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 +91345,7 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
<var>source</var>.</p></li>
domenic marked this conversation as resolved.
Show resolved Hide resolved

<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 +91356,32 @@ 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>
domenic marked this conversation as resolved.
Show resolved Hide resolved
</ol>

<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
<var>steps</var>:</p>
domenic marked this conversation as resolved.
Show resolved Hide resolved

<ol>
<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><span>Queue a task</span> given <var>source</var>, <var>event loop</var>,
<var>document</var>, and <var>steps</var>.</p></li>
</ol>

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

<li><p>If <var>document</var> was not given, set <var>document</var> to the <span>implied
document</span>.</p></li>

<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 +91390,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>

<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