Skip to content

Commit

Permalink
Merge pull request scottjehl#300 from zcorpan/patch-2
Browse files Browse the repository at this point in the history
Properly check for sizes support
  • Loading branch information
scottjehl committed Sep 18, 2014
2 parents 5ba118e + d541aa9 commit f63ea9c
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/picturefill.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@
pf.ns = "picturefill";

// srcset support test
pf.srcsetSupported = "srcset" in doc.createElement( "img" );
pf.sizesSupported = w.HTMLImageElement.sizes;
(function() {
var img = doc.createElement( "img" );
pf.srcsetSupported = "srcset" in img;
pf.sizesSupported = "sizes" in img;
})();

// just a string trim workaround
pf.trim = function( str ) {
Expand Down

0 comments on commit f63ea9c

Please sign in to comment.