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

Commit

Permalink
Merge remote-tracking branch 'origin/ios_scrollbug-544' into 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
aFarkas committed Jul 28, 2015
2 parents 96eab2d + d7f9407 commit 552823f
Show file tree
Hide file tree
Showing 9 changed files with 52 additions and 57 deletions.
55 changes: 27 additions & 28 deletions dist/picturefill.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
/*! Picturefill - v3.0.0-beta1 - 2015-07-27
* http://scottjehl.github.io/picturefill
* Copyright (c) 2015 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT
*/
/*! Gecko-Picture - v1.0
* https://github.com/scottjehl/picturefill/tree/3.0/src/plugins/gecko-picture
* Firefox's early picture implementation (prior to FF41) is static and does
* not react to viewport changes. This tiny module fixes this.
*/
/*! Picturefill - v3.0.0-beta1 - 2015-07-24
* http://scottjehl.github.io/picturefill
* Copyright (c) 2015 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT */
(function(window) {
/*jshint eqnull:true */
var ua = navigator.userAgent;
Expand Down Expand Up @@ -71,13 +65,13 @@
}
})(window);

/*! Picturefill - v3.0.0-beta
* http://scottjehl.github.io/picturefill
* Copyright (c) 2015 https://github.com/scottjehl/picturefill/blob/master/Authors.txt;
/*! Picturefill - Responsive Images that work today.
* Author: Scott Jehl, Filament Group, 2012 ( new proposal implemented by Shawn Jansepar )
* License: MIT
* Spec: http://picture.responsiveimages.org/
*/

(function( window, document, undefined ) {
/* global parseSizes */
// Enable strict mode
"use strict";

Expand Down Expand Up @@ -198,7 +192,7 @@
return string;
};

var buildStr = memoize(function(css) {
var buidlStr = memoize(function(css) {

return "return " + replace((css || "").toLowerCase(),
// interpret `and`
Expand Down Expand Up @@ -232,7 +226,7 @@
} else {
/*jshint evil:true */
try{
cssCache[css] = new Function("e", buildStr(css))(units);
cssCache[css] = new Function("e", buidlStr(css))(units);
} catch(e) {}
/*jshint evil:false */
}
Expand Down Expand Up @@ -746,6 +740,9 @@
} // (Close of big while loop.)
}

/* jshint ignore:start */
// jscs:disable

/*
* Sizes Parser
*
Expand Down Expand Up @@ -828,9 +825,9 @@

// (Loop forwards from the beginning of the string.)
while (true) {
chrctr = str.charAt(pos);
chrctr = str[pos];

if (chrctr === "") { // ( End of string reached.)
if (chrctr === undefined) { // ( End of string reached.)
pushComponent();
pushComponentArray();
return listArray;
Expand All @@ -848,7 +845,7 @@
// (If previous character in loop was also a space, or if
// at the beginning of the string, do not add space char to
// component.)
if ( (str.charAt(pos - 1) && isSpace( str.charAt(pos - 1) ) ) || !component ) {
if ((str[pos - 1] && isSpace(str[pos - 1])) || (!component)) {
pos += 1;
continue;
} else if (parenDepth === 0) {
Expand All @@ -864,11 +861,11 @@
} else if (chrctr === ")") {
parenDepth -= 1;
} else if (chrctr === ",") {
pushComponent();
pushComponent()
pushComponentArray();
pos += 1;
continue;
} else if ( (chrctr === "/") && (str.charAt(pos + 1) === "*") ) {
} else if ((chrctr === "/") && (str[pos + 1] === "*")) {
inComment = true;
pos += 2;
continue;
Expand Down Expand Up @@ -952,6 +949,8 @@
// size value, return 100vw.
return "100vw";
}
// jscs: enable
/* jshint ignore:end */

// namespace
pf.ns = ("pf" + new Date().getTime()).substr(0, 9);
Expand Down Expand Up @@ -1441,14 +1440,19 @@
}
};
};

var lastClientWidth = docElem.clientHeight;
var onResize = function() {
isVwDirty = true;
pf.fillImgs();
isVwDirty = Math.max(window.innerWidth || 0, docElem.clientWidth) !== units.width || docElem.clientHeight !== lastClientWidth;
lastClientWidth = docElem.clientHeight;
if ( isVwDirty ) {
pf.fillImgs();
}
};

on( window, "resize", debounce(onResize, 99 ) );
on( document, "readystatechange", run );

types[ "image/webp" ] = detectTypeSupport("image/webp", "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==" );
})();
}

Expand Down Expand Up @@ -1491,9 +1495,4 @@
define( "picturefill", function() { return picturefill; } );
}

// IE8 evals this sync, so it must be the last thing we do
if ( !window.HTMLPictureElement ) {
types[ "image/webp" ] = detectTypeSupport("image/webp", "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==" );
}

} )( window, document );
9 changes: 4 additions & 5 deletions dist/picturefill.min.js

Large diffs are not rendered by default.

7 changes: 3 additions & 4 deletions dist/plugins/intrinsic-dimension/pf.intrinsic.min.js

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

7 changes: 3 additions & 4 deletions dist/plugins/mutation/pf.mutation.min.js

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

7 changes: 3 additions & 4 deletions dist/plugins/oldie/pf.oldie.min.js

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

7 changes: 3 additions & 4 deletions dist/plugins/print/pf.print.min.js

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

7 changes: 3 additions & 4 deletions dist/plugins/typesupport/pf.type.min.js

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

9 changes: 6 additions & 3 deletions src/picturefill.js
Original file line number Diff line number Diff line change
Expand Up @@ -1368,10 +1368,13 @@
}
};
};

var lastClientWidth = docElem.clientHeight;
var onResize = function() {
isVwDirty = true;
pf.fillImgs();
isVwDirty = Math.max(window.innerWidth || 0, docElem.clientWidth) !== units.width || docElem.clientHeight !== lastClientWidth;
lastClientWidth = docElem.clientHeight;
if ( isVwDirty ) {
pf.fillImgs();
}
};

on( window, "resize", debounce(onResize, 99 ) );
Expand Down
1 change: 0 additions & 1 deletion tests/tests-functional.js
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,6 @@
//IE8/IE9 needs a clear remove here
$wimage.removeAttr('width');
$wimage.removeAttr('height');
debugger;

runViewportTests($wimage, viewports);
};
Expand Down

0 comments on commit 552823f

Please sign in to comment.