Remove event handlers when attribute is removed (#38734)

We wouldn't handle the AttributeMutation::Removed for
attribute event listeners and wouldn't remove the
corresponding event listener. Added the necessary
logic (using the newly EventTarget::is_content_event_handler
to correctly only do this for known event handlers) and
added links to the relevant parts of the spec.

Signed-off-by: Tim van der Lippe <tvanderlippe@gmail.com>
This commit is contained in:
Tim van der Lippe 2025-08-22 21:43:04 +02:00 committed by GitHub
parent 1ad0ad6f25
commit f334a56b07
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 38 additions and 55 deletions

View file

@ -1,18 +0,0 @@
[event-handler-non-content-document-idl-attributes.html]
[div.onreadystatechange is not an event handler content attribute]
expected: FAIL
[div.onvisibilitychange is not an event handler content attribute]
expected: FAIL
[body.onreadystatechange is not an event handler content attribute]
expected: FAIL
[body.onvisibilitychange is not an event handler content attribute]
expected: FAIL
[frameset.onreadystatechange is not an event handler content attribute]
expected: FAIL
[frameset.onvisibilitychange is not an event handler content attribute]
expected: FAIL