Permalink
Browse files

Merge pull request #320 from mathiasbynens/patch-2

Minor tweak in WebP test
  • Loading branch information...
2 parents 2a7a26a + d704496 commit d9e8cedebf3e2a73d5fb822133db119db574d05f @paulirish paulirish committed Jul 8, 2011
Showing with 5 additions and 7 deletions.
  1. +5 −7 feature-detects/img-webp.js
@@ -2,21 +2,19 @@
// by rich bradshaw, ryan seddon, and paul irish
-// This test is ascynchronous. Watch out.
+// This test is asynchronous. Watch out.
(function(){
var image = new Image();
-
image.onerror = function() {
- Modernizr.addTest('webp', function () { return false; });
+ Modernizr.addTest('webp', false);
};
image.onload = function() {
- Modernizr.addTest('webp', function () { return image.width == 4; });
+ Modernizr.addTest('webp', function() { return image.width == 4; });
};
- image.src = 'data:image/webp;base64,UklGRjgAAABXRUJQVlA4ICwAAAAQAgCdASoEAAQAAAcIhYWIhYSIgIIADA1gAAUAAAEAAAEAAP7%2F2fIAAAAA';
-
-})();
+ image.src = 'data:image/webp;base64,UklGRjIAAABXRUJQVlA4ICYAAACyAgCdASoBAAEALmk0mk0iIiIiIgBoSygABc6zbAAA/v56QAAAAA==';
+}());

0 comments on commit d9e8ced

Please sign in to comment.