From 568d6a1c6b139353846bb75a58de887ad2c0cc59 Mon Sep 17 00:00:00 2001 From: Chris Adams Date: Thu, 23 May 2013 10:10:32 -0400 Subject: [PATCH] Paranoid requestAnimationFrame for antique Firefox Very old versions of Firefox - e.g. Firefox 7 - have window.requestAnimationFrame but not cancelAnimationFrame. This is a very old release so the easiest fix is simply to check for both of the functions which we intend to call and fall back on traditional behaviour if both aren't present. --- src/openseadragon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/openseadragon.js b/src/openseadragon.js index ed43ff77..c0586583 100644 --- a/src/openseadragon.js +++ b/src/openseadragon.js @@ -1662,7 +1662,7 @@ window.OpenSeadragon = window.OpenSeadragon || function( options ){ // polyfill, when necessary - if ( w.requestAnimationFrame ) { + if ( w.requestAnimationFrame && w.cancelAnimationFrame ) { //we cant assign window.requestAnimationFrame directly to $.requestAnimationFrame //without getting Illegal Invocation errors in webkit so call in a //wrapper