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

Commit

Permalink
Executing the pf function with window instead of this - Fixes scottje…
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-engel committed Jan 24, 2015
1 parent f8727be commit 7311305
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 15 deletions.
14 changes: 7 additions & 7 deletions dist/picturefill.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! Picturefill - v2.2.0 - 2014-10-30
/*! Picturefill - v2.2.0 - 2015-01-23
* http://scottjehl.github.io/picturefill
* Copyright (c) 2014 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT */
* Copyright (c) 2015 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT */
/*! matchMedia() polyfill - Test a CSS media type/query in JS. Authors & copyright (c) 2012: Scott Jehl, Paul Irish, Nicholas Zakas, David Knight. Dual MIT/BSD license */

window.matchMedia || (window.matchMedia = function() {
Expand Down Expand Up @@ -246,8 +246,8 @@ window.matchMedia || (window.matchMedia = function() {
*
* 1. Let input (`srcset`) be the value passed to this algorithm.
* 2. Let position be a pointer into input, initially pointing at the start of the string.
* 3. Let raw candidates be an initially empty ordered list of URLs with associated
* unparsed descriptors. The order of entries in the list is the order in which entries
* 3. Let raw candidates be an initially empty ordered list of URLs with associated
* unparsed descriptors. The order of entries in the list is the order in which entries
* are added to the list.
*/
var candidates = [];
Expand All @@ -274,7 +274,7 @@ window.matchMedia || (window.matchMedia = function() {
}
srcset = srcset.slice( pos + 1 );

// 6.2. Collect a sequence of characters that are not U+002C COMMA characters (,), and
// 6.2. Collect a sequence of characters that are not U+002C COMMA characters (,), and
// let that be descriptors.
if ( descriptor === null ) {
var descpos = srcset.indexOf( "," );
Expand Down Expand Up @@ -303,7 +303,7 @@ window.matchMedia || (window.matchMedia = function() {
};

pf.parseDescriptor = function( descriptor, sizesattr ) {
// 11. Descriptor parser: Let candidates be an initially empty source set. The order of entries in the list
// 11. Descriptor parser: Let candidates be an initially empty source set. The order of entries in the list
// is the order in which entries are added to the list.
var sizes = sizesattr || "100vw",
sizeDescriptor = descriptor && descriptor.replace( /(^\s+|\s+$)/g, "" ),
Expand Down Expand Up @@ -656,4 +656,4 @@ window.matchMedia || (window.matchMedia = function() {
w.picturefill = picturefill;
}

} )( this, this.document, new this.Image() );
} )( window, window.document, new window.Image() );
6 changes: 3 additions & 3 deletions dist/picturefill.min.js

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

10 changes: 5 additions & 5 deletions src/picturefill.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,8 +197,8 @@
*
* 1. Let input (`srcset`) be the value passed to this algorithm.
* 2. Let position be a pointer into input, initially pointing at the start of the string.
* 3. Let raw candidates be an initially empty ordered list of URLs with associated
* unparsed descriptors. The order of entries in the list is the order in which entries
* 3. Let raw candidates be an initially empty ordered list of URLs with associated
* unparsed descriptors. The order of entries in the list is the order in which entries
* are added to the list.
*/
var candidates = [];
Expand All @@ -225,7 +225,7 @@
}
srcset = srcset.slice( pos + 1 );

// 6.2. Collect a sequence of characters that are not U+002C COMMA characters (,), and
// 6.2. Collect a sequence of characters that are not U+002C COMMA characters (,), and
// let that be descriptors.
if ( descriptor === null ) {
var descpos = srcset.indexOf( "," );
Expand Down Expand Up @@ -254,7 +254,7 @@
};

pf.parseDescriptor = function( descriptor, sizesattr ) {
// 11. Descriptor parser: Let candidates be an initially empty source set. The order of entries in the list
// 11. Descriptor parser: Let candidates be an initially empty source set. The order of entries in the list
// is the order in which entries are added to the list.
var sizes = sizesattr || "100vw",
sizeDescriptor = descriptor && descriptor.replace( /(^\s+|\s+$)/g, "" ),
Expand Down Expand Up @@ -607,4 +607,4 @@
w.picturefill = picturefill;
}

} )( this, this.document, new this.Image() );
} )( window, window.document, new window.Image() );

0 comments on commit 7311305

Please sign in to comment.