diff --git a/lib/OpenLayers/Animation.js b/lib/OpenLayers/Animation.js index cadc14dedb..4a4ccc5637 100644 --- a/lib/OpenLayers/Animation.js +++ b/lib/OpenLayers/Animation.js @@ -5,6 +5,7 @@ * full text of the license. * * @requires OpenLayers/SingleFile.js + * @requires OpenLayers/Vendor.js */ /** @@ -19,11 +20,8 @@ OpenLayers.Animation = (function(window) { * Property: isNative * {Boolean} true if a native requestAnimationFrame function is available */ - var isNative = !!(window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame); + var requestAnimationFrame = OpenLayers.Vendor.jsPrefix(window, "requestAnimationFrame"); + var isNative = !!(requestAnimationFrame); /** * Function: requestFrame @@ -36,11 +34,7 @@ OpenLayers.Animation = (function(window) { * element - {DOMElement} Optional element that visually bounds the animation. */ var requestFrame = (function() { - var request = window.requestAnimationFrame || - window.webkitRequestAnimationFrame || - window.mozRequestAnimationFrame || - window.oRequestAnimationFrame || - window.msRequestAnimationFrame || + var request = window[requestAnimationFrame] || function(callback, element) { window.setTimeout(callback, 16); }; diff --git a/tests/Animation.html b/tests/Animation.html index f113690933..b07308d3e0 100644 --- a/tests/Animation.html +++ b/tests/Animation.html @@ -6,6 +6,7 @@ // dependencies for tests var OpenLayers = [ + "OpenLayers/Vendor.js", "OpenLayers/Animation.js" ];