Files
node/lib
BCD1me ea5cfd98c5 lib: implement passive listener behavior per spec
Implements the WHATWG DOM specification for passive event listeners,
ensuring that calls to `preventDefault()` are correctly ignored within
a passive listener context.

An internal `kInPassiveListener` state is added to the Event object
to track when a passive listener is executing. The `preventDefault()`
method and the `returnValue` setter are modified to check this state,
as well as the event's `cancelable` property. This state is reliably
cleaned up within a `finally` block to prevent state pollution in
case a listener throws an error.

This resolves previously failing Web Platform Tests (WPT) in
`AddEventListenerOptions-passive.any.js`.

Refs: https://dom.spec.whatwg.org/#dom-event-preventdefault
PR-URL: https://github.com/nodejs/node/pull/59995
Reviewed-By: Daeyeon Jeong <daeyeon.dev@gmail.com>
Reviewed-By: Mattias Buelens <mattias@buelens.com>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: Jason Zhang <xzha4350@gmail.com>
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
2025-10-22 23:44:01 +02:00
..
…
…
…
…
2025-10-18 20:35:56 +02:00
2024-11-27 11:03:39 -05:00
…
2025-08-26 11:22:39 +02:00
2025-07-28 08:58:22 +02:00
…
2024-07-16 12:01:14 +02:00
2025-10-18 20:35:56 +02:00
2024-11-27 11:03:39 -05:00
2024-11-27 11:03:39 -05:00
2025-09-20 06:16:51 +00:00
2025-02-03 20:09:53 +01:00
2025-10-07 17:29:36 +02:00
2025-04-17 10:51:20 -03:00
…
2025-09-20 03:32:52 +00:00