Commit e1f5ee4
committed
lib: fix passive listener implementation with cancelable checks
Complete the DOM passive listener specification implementation by
adding missing cancelable condition checks and
improving state management.
Key improvements:
- Add kInPassiveListener symbol property initialization in
Event constructor
- Fix preventDefault() method to check both cancelable and
passive state (ignore preventDefault if not
cancelable OR in passive listener)
- Fix returnValue setter with same cancelable condition for consistency
- Improve cleanup logic in finally block with conditional check instead
of unsafe delete operation
This fixes the previous incomplete implementation to
properly comply with WHATWG DOM specification where
preventDefault() calls should be ignored
in passive listeners only when the event is cancelable.1 parent 15ac7dc commit e1f5ee4
1 file changed
+5
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
182 | | - | |
183 | | - | |
184 | | - | |
| 183 | + | |
185 | 184 | | |
186 | 185 | | |
187 | 186 | | |
| |||
278 | 277 | | |
279 | 278 | | |
280 | 279 | | |
281 | | - | |
282 | | - | |
283 | | - | |
| 280 | + | |
284 | 281 | | |
285 | 282 | | |
286 | 283 | | |
| |||
855 | 852 | | |
856 | 853 | | |
857 | 854 | | |
858 | | - | |
| 855 | + | |
| 856 | + | |
859 | 857 | | |
860 | 858 | | |
861 | 859 | | |
| |||
0 commit comments