各ブラウザ毎の window.requestAnimationFrame の実装状況
window.requestAnimationFrame と window.webkitCancelRequestAnimationFrame の実装状況のメモです。
// --------------------------------------- // WebKit // Chrome 16 ready // Safari 5.1.2 not ready // iOS 5.0.1 not ready // Chrome for Android Beta ready // var handle = null; function tick() { console.log(handle); handle = webkitRequestAnimationFrame(tick); } handle = webkitRequestAnimationFrame(tick); webkitCancelRequestAnimationFrame(handle) // --------------------------------------- // IE // IE 9 not ready // IE 10 pp2 ready (request and cancel) // var handle = null; function tick() { console.log(handle); handle = msRequestAnimationFrame(tick); } handle = msRequestAnimationFrame(tick); msCancelRequestAnimationFrame(handle) // --------------------------------------- // Firefox // Firefox 4 partial (request only) // Firefox 11 ready (cancel impl) // Mobile Firefox5 ready (request only) // var handle = null; function tick() { console.log(handle); handle = mozRequestAnimationFrame(tick); } handle = mozRequestAnimationFrame(tick); mozCancelRequestAnimationFrame(handle) // --------------------------------------- // Opera // Opera 11.61 not ready // var handle = null; function tick() { console.log(handle); handle = oRequestAnimationFrame(tick); } handle = oRequestAnimationFrame(tick); oCancelRequestAnimationFrame(handle)