default-passive-events
default-passive-events copied to clipboard
Question: add new types of events
Is it possible to add the passive flag by default to other events like "animationend" or "transitionend"?
Now we are supporting only touch-or-scroll-blocking events, because that's where the problem exists. Can you elaborate about any gains with having animation/transition connected events set as passive?
Most probably the same gains - performance improvements. And I think the library can be easily modified to add new events. I can even prepare a PR for this if interested.
Actually now the most important would be to create some perf which shows any performance gain using passive approach. If you can prepare that, I'll make a change to library immediately. Is it possible for you to create such test? It might event depend on browser's built-in developer tools. Just try to make lots of animations at once, and in one case use passive event and in the other don't do it.
I'll investigate that.
I created a test with many elements all with transitions and many iterations. The results seems to be inconclusive. The difference is too low between passive and non-passive to say that there's a performance penalty for non-passive events for transitionend
.
The number of HTML elements and iterations can be easily configured. The results are displayed in the console as INFO messages - please disable DEBUG messages.
index.zip
Is there a similar test for scroll events?