Hacker News new | ask | show | jobs
by beebeepka 969 days ago
Aren't CSS animations capped at 60, same as requestAnimationFrame?

I've been advocating (and using) high refresh displays for over two decades and I find your reasoning preposterous. Downgrading to crappy 60 Hz monitor for nothing.

3 comments

I am pretty sure they are synchronized to refresh rate (at least on windows).

I made a small experiment about raf https://codepen.io/mmis1000/pen/qBxqgLr and it always looks uniform regardless I am on a 60, 120, 160 fps screen. (It would blink crazily if you put it in the middle of two screen with different refresh rate, because it can't be in two refresh rate at same time)

Erit: okay, it looks non uniform only in safari. Clap, clap, clap, Apple…

CSS transitions and animations seem to be declared using expressions that are continuous over time so it would make sense that they are just quantized down to whatever refresh rate the system supports.
> Aren't CSS animations capped at 60, same as requestAnimationFrame?

Did some quick Googling to make sure I wasn't just out of the loop on this, as far as I can tell they are not the same: https://github.com/whatwg/html/issues/5025

Can you point me to the part confirming your claim? If anything, it's confirming mine that they both are stuck at 60 Hz.
The link says:

> As such, on their 120hz devices, requestAnimationFrame is throttled to 60hz, whereas CSS animations run at 120hz.

Please let me know if I am misunderstanding, it has been a few years since I've done this type of work.

I just tested this and you are right. Thanks