modernizr
Version:
Modernizr is a JavaScript library that detects HTML5 and CSS3 features in the user’s browser.
22 lines (21 loc) • 651 B
JavaScript
/*!
{
"name": "requestAnimationFrame",
"property": "requestanimationframe",
"aliases": ["raf"],
"caniuse": "requestanimationframe",
"tags": ["animation"],
"authors": ["Addy Osmani"],
"notes": [{
"name": "W3C spec",
"href": "https://www.w3.org/TR/animation-timing/"
}],
"polyfills": ["raf"]
}
!*/
/* DOC
Detects support for the `window.requestAnimationFrame` API, for offloading animation repainting to the browser for optimized performance.
*/
define(['Modernizr', 'prefixed'], function(Modernizr, prefixed) {
Modernizr.addTest('requestanimationframe', !!prefixed('requestAnimationFrame', window), {aliases: ['raf']});
});