-
Notifications
You must be signed in to change notification settings - Fork 406
Correctly handle the event.currentTarget property #4559
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Implementation is very clear and simple.
The generated output of |
Crap, I forgot that this would change the generated types. I think based on that alone we'll need a compat flag here... ugh. |
I don't think changing the generated types in itself is a reason for a compat flag -- the types don't exist in production, after all, and compat flags are about protecting workers in production. But whether the API change itself requires a compat flag, I don't know. We could add logging to see if anyone actually calls this when Though that doesn't really answer whether the undefined->null change in itself might require a compat flag, which I guess is harder to tell. |
I wonder if we should create a new compat flag called That way we don't create a massive number of compat flags for little things nobody actually cares about... cc @npaun |
That would make sense I think |
@kentonv Yeah I've considered creating one a few times now |
I'll move this back to draft, add a compat flag, and will bundle multiple WPT fixes under this PR. We can likely do this in batches with several compat flags, one for each batch. |
59d5a44
to
e1256e0
Compare
PR updated to add the compat flag and also handle the |
|
||
pedanticWpt @101 :Bool | ||
$compatEnableFlag("pedantic_wpt") | ||
$compatDisableFlag("non_pedantic_wpt"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review note: this intentionally has no disable enable date for now.
@@ -45,9 +45,7 @@ export default { | |||
'EventTarget-addEventListener.any.js': {}, | |||
'EventTarget-constructible.any.js': { | |||
comment: 'Should be null, not EventTarget', | |||
expectedFailures: [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't there be a change relating to isTrusted
here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought so too but it passed locally without it.. so... I was confused lol... wanted to see what the main CI did.
Per the spec, the currentTarget property of an Event should be null if the event is not being dispatched. Introduces a `pedantic_wpt` compat flag for correctly handling these.
7285b2a
to
d61e1ed
Compare
Per the spec, the currentTarget property of an Event should be null if the event is not being dispatched.
Fixes: #4558
Fixes: #4556
@danlapid @kentonv ... I'm hoping this can be something we don't need a compat flag for. Whatcha think?Adds a new
pedantic_wpt
compat flag for these kinds of fixes. Additional changes will be made incrementally usingimplied_by
compat flags so that'll bundle all these types of changes together./cc @npaun