-
Notifications
You must be signed in to change notification settings - Fork 22.6k
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
addEventListener - which browsers/events default to passive #24181
Comments
Thanks for filing, @redblobgames , and for your analysis. It's better for maintainability for us to minimize references to browser support in the main body of the page, and refer to the browser compat tables for that. So as for the prose of this article, I think it would be better to say something like:
But from your description it also sounds like the BCD table is wrong? The table claims everyone except Safari supports this behavior, but your description suggests that it should be everyone except Firefox. Having said that it does look like this was implemented in Firefox, e.g.: |
I agree, browser compat tables are a better place for this. I had thought Firefox didn't implement the default passive but I was wrong. I ran some more tests here. I had been testing a proxy for active/passive — the There's also web platform tests and more but I am not sure how to interpret these I am thinking we should change the BCD table to mark Safari as supporting " Then we could remove the "browsers other than Safari and Internet Explorer have changed the default value…" text to say "browsers have changed the default value…" (or maybe "current browsers"? "modern browsers"? not sure what to say here) |
We usually say "modern browsers" here. And yes, I think this is right:
Do you want to contribute these fixes? If not, no problem, we will take care of it. |
While I'm happy to contribute a pull request (or maybe two, as the compat tables seem to be in a separate repository), I'm even happier if someone else does it ;-) |
This issue seems to have been addressed. @redblobgames @wbamberg Is it OK to close? |
No, this isn't fixed, it looks like I was going to add it into #29083 but it got merged before I got around to it. But I will take care of it now. |
Ah, but it looks like the BCD did get updated: mdn/browser-compat-data#21523 . Yay. |
MDN URL
https://developer.mozilla.org/en-US/docs/Web/API/EventTarget/addEventListener
What specific section or headline is this issue about?
Improving scrolling performance with passive listeners
Documentation of which browsers default to passive
What information was incorrect, unhelpful, or incomplete?
The page says "browsers other than Safari and Internet Explorer" default certain events to passive, suggesting Chrome and Firefox do this. But it seems to be Chrome and Safari that default those events to passive.
This is also mentioned in the description of the
passive
flag.What did you expect to see?
I expect it to say "Chrome and Safari change the default value of the passive option to true for {wheel, mousewheel, touchstart, touchmove}".
Do you have any supporting links, references, or citations?
I looked up the history of the touch events defaulting to passive:
I've also tested the
touchstart
event myself to see if.cancelable
is set, andSeparately, wheel events:
I tested the
wheel
event to see if.cancelable
is set, andSo here too it seems to be Chrome and Safari that default to passive, not "browsers other than Safari and Internet Explorer".
Do you have anything more you want to share?
I'm happy to make a pull request but thought I should file an issue first.
MDN metadata
Page report details
en-us/web/api/eventtarget/addeventlistener
The text was updated successfully, but these errors were encountered: