Skip to content

Commit c2d5aa3

Browse files
authored
Correct once handling for "nested" events
If you have two once listeners and the first one dispatches a second event that invokes both listeners, the second listener would be invoked twice as it had already been cloned before it got removed. As such setting its removed field is important after all. Fixes #1323.
1 parent 7cacda2 commit c2d5aa3

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

dom.bs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1608,10 +1608,8 @@ and an optional <var>legacyOutputDidListenersThrowFlag</var>, run these steps:
16081608
<a for="event listener">capture</a> is true, then <a for=iteration>continue</a>.
16091609

16101610
<li><p>If <var>listener</var>'s <a for="event listener">once</a> is true, then
1611-
<a for=list>remove</a> <var>listener</var> from <var>event</var>'s {{Event/currentTarget}}
1612-
attribute value's <a for=EventTarget>event listener list</a>.
1613-
<!-- Do this before invocation to avoid reentrancy issues. No need to set removed to true since
1614-
each listener in listeners is run once anyway. -->
1611+
<a>remove an event listener</a> given <var>event</var>'s {{Event/currentTarget}} attribute value
1612+
and <var>listener</var>.
16151613

16161614
<li><p>Let <var>global</var> be <var>listener</var> <a for="event listener">callback</a>'s
16171615
<a>associated realm</a>'s <a for=realm>global object</a>.
@@ -10387,6 +10385,7 @@ Ahmid <i>snuggs</i>,
1038710385
Alex Komoroske,
1038810386
Alex Russell,
1038910387
Alexey Shvayka,
10388+
Andreas Kling<!-- awesomekling; GitHub -->,
1039010389
Andreu Botella,
1039110390
Anthony Ramine,
1039210391
Arkadiusz Michalski,

0 commit comments

Comments
 (0)