-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Consider adding cancelAnimationFrame polyfill #4779
Comments
Technically you can pass it to It will hopefully land in jsdom itself soon, but just doing |
By the way, by reading jsdom discussion, I'm not quite sure which behavior they'll pick. Would it make sense to change the polyfilll to coalesce calls into 1/60 timer? e.g. if you call it twice synchronously it should probably schedule only once. |
Now that I think about it, I realize I don't actually remember how rAF works 😛 |
When you schedule 2 at the same time, they should be fired at the same time. That's actually not the way it works in my PR to JSDOM, there they'll be scheduled 1/60 after calling all the time... Probably needs a queue of some sort. E.g. run this in chrome, and see the requestAnimationFrame((t)=>{console.log('hello', t)}); requestAnimationFrame((t)=>{console.log('hello', t)}); EDIT: Wait, I'm confusing myself. Need to double check the spec (or just use |
How do you feel about just using |
I'm fine with just using |
Only issue with |
Heh. We only recommended that because that's what we used in our tests, and it's the simplest thing that works. I don't think we really meant to endorse it though 😛 |
Both |
Agree (if you can easily update). |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Related to #4545 and #4568.
It's not necessary for React, but I think most apps expect them to be available together. Since if you don't have access to the original
rAF
polyfill source you can't implement thecAF
polyfill.The text was updated successfully, but these errors were encountered: