Bug 975831 use request anim frame

https://bugzilla.mozilla.org/show_bug.cgi?id=975831