Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added a test for animated WebP images #1155

Merged
merged 1 commit into from
Dec 11, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 37 additions & 0 deletions feature-detects/img/webp-animation.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*!
{
"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": "http://code.google.com/speed/webp/"
},{
"name": "Chormium blog - Chrome 32 Beta: Animated WebP images and faster Chrome for Android touch input",
"href": "http://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';
});
});
1 change: 1 addition & 0 deletions lib/config-all.json
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
"test/img/srcset",
"test/img/webp-lossless",
"test/img/webp-alpha",
"test/img/webp-animation",
"test/img/webp",
"test/indexedDB",
"test/input",
Expand Down