-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Demix GlobalEventHandlers; adapt to new events structure #15480
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.
I think that for the most part these should be a single event entry, and it needs to be decided on a case-by-case basis. Some should be multiple entries still, a few events like "blur" can be fired at both Window
and some elements and have different meanings for those.
There are far too many events to do this in batch and review the result properly, I suggest splitting into many small PRs.
} | ||
} | ||
}, | ||
"canplay_event": { |
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.
This entry isn't meaningful, no event will ever be fired for document.addEventListener('canplay', handler)
because the event target is an HTMLMediaElement
and the events doesn't bubble.
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.
Right now we have:
https://developer.mozilla.org/en-US/docs/Web/API/GlobalEventHandlers/oncanplay
https://developer.mozilla.org/en-US/docs/web/api/htmlmediaelement/canplay_event
Per IDL, it would be possible to have the event on:
Window
Document
HTMLElement
MathMLElement
SVGElement
I wonder if we wouldn't be better off if we have the events under GlobalEventHandlers in BCD. On MDN we also place them under GlobalEventHandlers and document where they are available (list above) and where they are typically used (in this case HTMLMediaElements like video and audio). What do you think?
I'm marking this as a draft because there is some inaccurate flag data in this mixin that I'd like to get removed first before this is merged. |
Agree. I think we should close this PR and work our way through |
I'm going to close this PR and create other PRs for each individual event instead, so that each one can be reviewed individually. |
This PR performs two operations relating to the
GlobalEventHandlers
mixin.First, the mixin is de-mixed and separated into their individual interfaces. This includes
Document
,Window
,HTMLElement
,MathMLElement
, andSVGElement
.Second, the event handlers are converted to the new naming convention, and URLs are also updated. In the process, duplicates are removed.
Possible conflict with #15677.