This documents our implementation of mozilla's proposed requestAnimationFrame feature. This API allows a web author to call window.(prefix)requestAnimationFrame(callback, element); and later receive a callback when it is appropriate to update animations for the given element. A rough draft of the API as we implement it can be seen here: http://webstuff.nfshost.com/anim-timing/Overview.html, mozilla's proposal is here: https://developer.mozilla.org/en/DOM/window.mozRequestAnimationFrame. In our implementation the important bits are that we don't invoke the requestAnimationFrame callbacks unless the tab is visible, we don't invoke the callbacks at a rate faster than 60Hz, and we don't invoke the callbacks faster than the page is actually rendering. |
