mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-24 18:41:03 +00:00
36 lines
1.1 KiB
JavaScript
36 lines
1.1 KiB
JavaScript
/*!
|
|
{
|
|
"name": "Webp Animation",
|
|
"async": true,
|
|
"property": "webpanimation",
|
|
"aliases": ["webp-animation"],
|
|
"tags": ["image"],
|
|
"authors": ["Krister Kari", "Rich Bradshaw", "Ryan Seddon", "Paul Irish"],
|
|
"notes": [{
|
|
"name": "WebP Info",
|
|
"href": "https://developers.google.com/speed/webp/"
|
|
}, {
|
|
"name": "Chromium blog - Chrome 32 Beta: Animated WebP images and faster Chrome for Android touch input",
|
|
"href": "https://blog.chromium.org/2013/11/chrome-32-beta-animated-webp-images-and.html"
|
|
}]
|
|
}
|
|
!*/
|
|
/* DOC
|
|
Tests for animated webp support.
|
|
*/
|
|
define(['Modernizr', 'addTest'], function(Modernizr, addTest) {
|
|
Modernizr.addAsyncTest(function() {
|
|
var image = new Image();
|
|
|
|
image.onerror = function() {
|
|
addTest('webpanimation', false, {aliases: ['webp-animation']});
|
|
};
|
|
|
|
image.onload = function() {
|
|
addTest('webpanimation', image.width === 1, {aliases: ['webp-animation']});
|
|
};
|
|
|
|
image.src = 'data:image/webp;base64,UklGRlIAAABXRUJQVlA4WAoAAAASAAAAAAAAAAAAQU5JTQYAAAD/////AABBTk1GJgAAAAAAAAAAAAAAAAAAAGQAAABWUDhMDQAAAC8AAAAQBxAREYiI/gcA';
|
|
});
|
|
});
|