requestanimationframe.js 651 B

123456789101112131415161718192021
  1. /*!
  2. {
  3. "name": "requestAnimationFrame",
  4. "property": "requestanimationframe",
  5. "aliases": ["raf"],
  6. "caniuse": "requestanimationframe",
  7. "tags": ["animation"],
  8. "authors": ["Addy Osmani"],
  9. "notes": [{
  10. "name": "W3C Spec",
  11. "href": "https://www.w3.org/TR/animation-timing/"
  12. }],
  13. "polyfills": ["raf"]
  14. }
  15. !*/
  16. /* DOC
  17. Detects support for the `window.requestAnimationFrame` API, for offloading animation repainting to the browser for optimized performance.
  18. */
  19. define(['Modernizr', 'prefixed'], function(Modernizr, prefixed) {
  20. Modernizr.addTest('requestanimationframe', !!prefixed('requestAnimationFrame', window), {aliases: ['raf']});
  21. });