script: Clear all associated event listeners when removing an event listener content attribute. (#39011)

This change allows callers of `remove_event_listener` to specify `None`
for the `options` argument to skip phase (bubble/capture) checking (and
remove either type of listener).

Notably, this changes the HTMLElement `attribute_mutated` code to remove
all event listeners rather than ones with just `capture: false`, which
should be [correct
behavior](https://html.spec.whatwg.org/multipage/webappapis.html#deactivate-an-event-handler).

Testing: `mach try linux-wpt`:
https://github.com/kotx/servo/actions/runs/17313405730
Fixes: https://github.com/servo/servo/issues/38742

---------

Signed-off-by: Kot <kot@kot.pink>
This commit is contained in:
Kot 2025-08-29 22:38:32 -07:00 committed by GitHub
parent 4a4a615eb7
commit 2e1b2e7260
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 5 additions and 17 deletions

View file

@ -1,3 +0,0 @@
[event-handler-removal.window.html]
[Event handler set through content attribute should be deactivated when the content attribute is removed.]
expected: FAIL