Skip to content
This repository has been archived by the owner on Sep 6, 2022. It is now read-only.

Commit

Permalink
Closes #206 - Omitted sizes should be evaluated to 100vw per the …
Browse files Browse the repository at this point in the history
…spec; using `width: 100%` of viewport for the sake of older browsers.
  • Loading branch information
Wilto committed Apr 22, 2014
1 parent 9f9555a commit 437097b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 9 deletions.
6 changes: 2 additions & 4 deletions dist/picturefill.js
Expand Up @@ -224,11 +224,9 @@ window.matchMedia || (window.matchMedia = function() {
*/
pf.getCandidatesFromSourceSet = function( srcset, sizes ) {
var candidates = pf.trim( srcset ).split( /,\s+/ );
var widthInCssPixels = sizes ? pf.findWidthFromSourceSize( sizes ) : "100%";
var formattedCandidates = [];
var widthInCssPixels;
if ( sizes ) {
widthInCssPixels = pf.findWidthFromSourceSize( sizes );
}

for ( var i = 0, len = candidates.length; i < len; i++ ) {
var candidate = candidates[ i ];
var candidateArr = candidate.split( /\s+/ );
Expand Down
2 changes: 1 addition & 1 deletion dist/picturefill.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions src/picturefill.js
Expand Up @@ -175,11 +175,9 @@
*/
pf.getCandidatesFromSourceSet = function( srcset, sizes ) {
var candidates = pf.trim( srcset ).split( /,\s+/ );
var widthInCssPixels = sizes ? pf.findWidthFromSourceSize( sizes ) : "100%";
var formattedCandidates = [];
var widthInCssPixels;
if ( sizes ) {
widthInCssPixels = pf.findWidthFromSourceSize( sizes );
}

for ( var i = 0, len = candidates.length; i < len; i++ ) {
var candidate = candidates[ i ];
var candidateArr = candidate.split( /\s+/ );
Expand Down

0 comments on commit 437097b

Please sign in to comment.