> We follow Firefox's behavior and use a duration of 100 ms for any frames that specify a duration of <= 10 ms.
That is interesting & funny. I wonder why there wasn’t just a minimum value.
This article doesn’t talk about what happens after the delay is triggered, or that a value of 10ms won’t work for the average browser, video hardware & monitor. That’d be a refresh rate of 100 frames per second, and a lot of monitors are 60Hz refresh. Don’t browsers default to 60Hz refresh as well? (MDN docs mention requestAnimationFrame callbacks are usually 60/sec, or 16.7ms apart, for example.) This means with a timeout of 20ms, you’ll probably get a janky animation where one frame gets doubled every 6 frames. I guess with GIF it’s not possible to solve that since the spec doesn’t allow you to match typical refresh rates.
Yeah, as a gamedev I was surprised not to see this in the article. There's often a default assumption in renderers that "60 fps" is the baseline (and most typical devices will be limited to that). Obviously gaming devices and newer smartphones push above that to 120, 144 or 240 fps. But in gamedev you're always faced with this problem of update frequency of anything that will be displayed to the player; if you update too fast (or too slow), you're gonna get "stutters" and skipped (or stuck) frames as the state updates faster than the renderer can render it (when too fast), or at a rate that's out of sync with the actual frames being pushed to the monitor (too slow, at a rate that's not evenly divisible by the frame rate).
That is interesting & funny. I wonder why there wasn’t just a minimum value.
This article doesn’t talk about what happens after the delay is triggered, or that a value of 10ms won’t work for the average browser, video hardware & monitor. That’d be a refresh rate of 100 frames per second, and a lot of monitors are 60Hz refresh. Don’t browsers default to 60Hz refresh as well? (MDN docs mention requestAnimationFrame callbacks are usually 60/sec, or 16.7ms apart, for example.) This means with a timeout of 20ms, you’ll probably get a janky animation where one frame gets doubled every 6 frames. I guess with GIF it’s not possible to solve that since the spec doesn’t allow you to match typical refresh rates.