requestAnimationFrame in multiple browsers (safari support)