Skip to content

Commit 77240a2

Browse files
authored
Remove compound microtasks
Implementations do not have this concept and treat calling mutation observers and dispatching slotchange events as a microtask that happens to do quite a few things.
1 parent d0feee5 commit 77240a2

File tree

1 file changed

+14
-53
lines changed

1 file changed

+14
-53
lines changed

source

Lines changed: 14 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -90008,17 +90008,7 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
9000890008

9000990009
<p>Each <span>event loop</span> has a <dfn>microtask queue</dfn>. A <dfn
9001090010
data-export="">microtask</dfn> is a <span data-x="concept-task">task</span> that is originally to
90011-
be queued on the <span>microtask queue</span> rather than a <span>task queue</span>. There are two
90012-
kinds of <span data-x="microtask">microtasks</span>: <dfn data-x="solitary callback
90013-
microtask" data-lt="solitary callback microtask" data-export="">solitary callback
90014-
microtasks</dfn>, and <dfn data-x="compound microtask" data-lt="compound microtask"
90015-
data-export="">compound microtasks</dfn>.</p>
90016-
90017-
<p class="note">This specification only has <span data-x="solitary callback microtask">solitary
90018-
callback microtasks</span>. Specifications that use <span data-x="compound microtask">compound
90019-
microtasks</span> have to take extra care to <span data-x="execute a compound microtask
90020-
subtask">wrap callbacks</span> to handle <span data-x="spin the event loop">spinning the event
90021-
loop</span>.</p>
90011+
be queued on the <span>microtask queue</span> rather than a <span>task queue</span>.</p>
9002290012

9002390013
<p>When an algorithm requires a <span>microtask</span> to be <dfn data-x="queue a
9002490014
microtask" data-lt="queue a microtask" data-export="">queued</dfn>, it must be appended to the
@@ -90073,28 +90063,6 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
9007390063
<li><p>Set the <span>performing a microtask checkpoint</span> flag to false.</p></li>
9007490064
</ol>
9007590065

90076-
<p>If, while a <span>compound microtask</span> is running, the user agent is required to
90077-
<dfn data-export="">execute a compound microtask subtask</dfn> to run a series of steps, the user
90078-
agent must run the following steps:</p>
90079-
90080-
<ol>
90081-
90082-
<li><p>Let <var>parent</var> be the <span>event loop</span>'s <span>currently running
90083-
task</span> (the currently running <span>compound microtask</span>).</p></li>
90084-
90085-
<li><p>Let <var>subtask</var> be a new <span data-x="concept-task">task</span> that
90086-
consists of running the given series of steps. The <span>task source</span> of such a
90087-
<span>microtask</span> is the <span>microtask task source</span>. This is a <dfn>compound
90088-
microtask subtask</dfn>.</p></li>
90089-
90090-
<li><p>Set the <span>event loop</span>'s <span>currently running task</span> to <var>subtask</var>.</p></li>
90091-
90092-
<li><p>Run <var>subtask</var>.</p></li>
90093-
90094-
<li><p>Set the <span>event loop</span>'s <span>currently running task</span> back to <var>parent</var>.</p></li>
90095-
90096-
</ol>
90097-
9009890066
<hr>
9009990067

9010090068
<p>When an algorithm running <span>in parallel</span> is to <dfn>await a stable state</dfn>, the
@@ -90119,19 +90087,11 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
9011990087
<p>When an algorithm says to <dfn>spin the event loop</dfn> until a condition <var>goal</var> is met, the user agent must run the following steps:</p>
9012090088

9012190089
<ol>
90090+
<li><p>Let <var>task</var> be the <span>event loop</span>'s <span>currently running
90091+
task</span>.</p></li>
9012290092

90123-
<li>
90124-
90125-
<p>Let <var>task</var> be the <span>event loop</span>'s <span>currently running
90126-
task</span>.</p>
90127-
90128-
<p class="note">This might be a <span>microtask</span>, in which case it is a <span>solitary
90129-
callback microtask</span>. It could also be a <span>compound microtask subtask</span>, or a
90130-
regular <span data-x="concept-task">task</span> that is not a <span>microtask</span>. It will
90131-
<em>not</em> be a <span>compound microtask</span>.</p> <!-- well, not unless we messed up in the
90132-
speccing, anyway... -->
90133-
90134-
</li>
90093+
<li><p>Assert: <var>task</var> is a <span data-x="concept-task">task</span> or a
90094+
<span>microtask</span>.</p></li>
9013590095

9013690096
<li><p>Let <var>task source</var> be <var>task</var>'s <span>task
9013790097
source</span>.</p></li>
@@ -90141,17 +90101,19 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
9014190101

9014290102
<li><p>Empty the <span>JavaScript execution context stack</span>.</p></li>
9014390103

90144-
<li><p><span>Perform a microtask checkpoint</span>.</p></li>
90145-
9014690104
<li>
90105+
<p><span>Perform a microtask checkpoint</span>.</p>
9014790106

90148-
<p>Stop <var>task</var>, allowing whatever algorithm that invoked it to resume, but
90149-
continue these steps <span>in parallel</span>.</p>
90107+
<p class="note">If <var>task</var> is a <span>microtask</span> this step will be a no-op due to
90108+
the <span>performing a microtask checkpoint</span> flag being set.</p>
90109+
</li>
9015090110

90151-
<p class="note">This causes one of the following algorithms to continue: the <span>event
90152-
loop</span>'s main set of steps, the <span>perform a microtask checkpoint</span> algorithm, or
90153-
the <span>execute a compound microtask subtask</span> algorithm.</p>
90111+
<li>
90112+
<p>Stop <var>task</var>, allowing whatever algorithm that invoked it to resume, but continue
90113+
these steps <span>in parallel</span>.</p>
9015490114

90115+
<p class="note">This causes the <span>event loop</span>'s main set of steps or the <span>perform
90116+
a microtask checkpoint</span> algorithm to continue.</p>
9015590117
</li>
9015690118

9015790119
<li><p>Wait until the condition <var>goal</var> is met.</p></li>
@@ -90164,7 +90126,6 @@ dictionary <dfn>PromiseRejectionEventInit</dfn> : <span>EventInit</span> {
9016490126
stack</var>.</p></li>
9016590127

9016690128
<li><p>Return to the caller.</p></li>
90167-
9016890129
</ol>
9016990130

9017090131
<hr>

0 commit comments

Comments
 (0)