Files
node/lib
BCD1me 6f941fcfba 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-04 03:17:35 +00:00
..
2025-08-02 11:31:47 +00:00
2025-08-05 03:51:16 +00:00
2025-09-22 23:19:26 +00:00
2025-07-18 09:28:21 +00:00
2024-10-09 06:42:16 +00:00
2025-09-04 11:58:50 +00:00
2025-01-04 18:30:04 +00:00
2025-09-14 00:39:32 +00:00
2025-03-04 11:14:34 +00:00
2025-08-05 13:45:41 +00:00