script: Clear all associated event listeners when removing an event listener content attribute. - #39011
Merged
Merged
Conversation
Signed-off-by: Kot <kot@kot.pink>
kotx
force-pushed
the
remove-event-listener-matches
branch
from
August 29, 2025 05:04
81ac758 to
27657f9
Compare
TimvdLippe
reviewed
Aug 29, 2025
| event_name.into(), | ||
| evtarget.get_event_handler_common(event_name, can_gc), | ||
| EventListenerOptions { capture: false }, | ||
| None, |
Contributor
There was a problem hiding this comment.
Can you check why the test linked in #38734 (comment) is still failing with this patch? I would expect it to be fixed, which was the original motivation for the issue you linked
Contributor
Author
There was a problem hiding this comment.
I think we should be using set_event_handler_common instead of remove_event_listener here? It doesn't make sense to run EventTarget.removeEventListener on inline event listeners (onclick, etc). Which means we wouldn't need to make options an Option.
Signed-off-by: Kot <kot@kot.pink>
|
🔨 Triggering try run (#17337838219) for Linux (WPT) |
|
Test results for linux-wpt from try job (#17337838219): Flaky unexpected result (23)
Stable unexpected results that are known to be intermittent (25)
Stable unexpected results (1)
|
|
|
Contributor
Author
|
Looks like it passes! Fixing the lint (and WPT) now. |
Signed-off-by: Kot <kot@kot.pink>
jdm
enabled auto-merge
August 30, 2025 05:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This change allows callers of
remove_event_listenerto specifyNonefor theoptionsargument to skip phase (bubble/capture) checking (and remove either type of listener).Notably, this changes the HTMLElement
attribute_mutatedcode to remove all event listeners rather than ones with justcapture: false, which should be correct behavior.Testing:
mach try linux-wpt: https://github.com/kotx/servo/actions/runs/17313405730Fixes: #38742