From 5b0369366a83d7339f925bfef3a277d7287c9bd2 Mon Sep 17 00:00:00 2001 From: louisremi Date: Fri, 11 Mar 2011 11:33:15 +0100 Subject: [PATCH] shorten requestAnimationFrame test --- src/support.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/support.js b/src/support.js index 725575b3b..64a54b832 100644 --- a/src/support.js +++ b/src/support.js @@ -13,7 +13,8 @@ a = div.getElementsByTagName("a")[0], select = document.createElement("select"), opt = select.appendChild( document.createElement("option") ), - input = div.getElementsByTagName("input")[0]; + input = div.getElementsByTagName("input")[0], + raf = "RequestAnimationFrame"; // Can't get basic test support if ( !all || !all.length || !a ) { @@ -60,11 +61,10 @@ // Verify requestAnimationFrame mechanism existence // use the prefixed name as the value - requestAnimationFrame: window.mozRequestAnimationFrame ? - 'mozRequestAnimationFrame' : - window.webkitRequestAnimationFrame ? - 'webkitRequestAnimationFrame' : - false, + requestAnimationFrame: + window['moz' + raf] ? 'moz' + raf : + window['webkit' + raf] ? 'webkit' + raf : + false, // Will be defined later deleteExpando: true,