Skip to content

Commit

Permalink
Bug 1657152 [wpt PR 24873] - stopImmediatePropagation() should not un…
Browse files Browse the repository at this point in the history
…register uninvoked 'once' listeners, a=testonly

Automatic update from web-platform-tests
stopImmediatePropagation() should not unregister uninvoked 'once' listeners

A 'once' listener should be unregistered when it is invoked, and
stopImmediatePropagation() should not invoke other event listeners.
We had a bug that stopImmediatePropagation() unregistered uninvoked
'once' listeners.

Bug: 993109
Change-Id: Iaabb03141ee7cf2de88dc6c8726f5a474efd133b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2336011
Commit-Queue: Joey Arhar <jarharchromium.org>
Reviewed-by: Joey Arhar <jarharchromium.org>
Reviewed-by: Kent Tamura <tkentchromium.org>
Cr-Commit-Position: refs/heads/master{#795142}

--

wpt-commits: c89458e4a5720da890a1fe30affa7983eee82205
wpt-pr: 24873

UltraBlame original commit: 2461fdc6c3381c2fc31fed63cf1f485c79a0e249
  • Loading branch information
marco-c committed Aug 16, 2020
1 parent 75c643c commit 1605c8b
Showing 1 changed file with 119 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,125 @@
"
)
;
test
(
function
(
)
{
var
invoked_count
=
0
;
for
(
let
n
=
4
;
n
>
0
;
n
-
-
)
{
document
.
addEventListener
(
'
test
'
(
e
)
=
>
{
invoked_count
+
+
;
e
.
stopImmediatePropagation
(
)
;
}
{
once
:
true
}
)
;
}
for
(
let
n
=
4
;
n
>
0
;
n
-
-
)
{
document
.
dispatchEvent
(
new
Event
(
'
test
'
)
)
;
}
assert_equals
(
invoked_count
4
"
The
listeners
should
be
invoked
"
)
;
}
"
Multiple
once
listeners
should
be
invoked
even
if
the
stopImmediatePropagation
is
set
"
)
;
<
/
script
Expand Down

0 comments on commit 1605c8b

Please sign in to comment.