Skip to content

Commit

Permalink
Whoops. Fixing bug in browsers that aren't IE8 and below!
Browse files Browse the repository at this point in the history
  • Loading branch information
jansepar committed Mar 28, 2014
1 parent c86c866 commit 8540a66
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion dist/picturefill.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ window.matchMedia || (window.matchMedia = function() {
var imgs = doc.getElementsByTagName('img');
for (var h=0, ilen = imgs.length; h < ilen; h++) {
var img = imgs[h];
if (!img.hasAttribute('data-picture-src') || img.parentNode.nodeName !== 'PICTURE') {
if (!img.hasAttribute('data-picture-src') || img.parentNode.nodeName === 'PICTURE' || img.parentNode.nodeName === 'SOURCE') {
continue;
}
// if img element has already been evaluated, skip it
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.

2 changes: 1 addition & 1 deletion src/picturefill.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@
var imgs = doc.getElementsByTagName('img');
for (var h=0, ilen = imgs.length; h < ilen; h++) {
var img = imgs[h];
if (!img.hasAttribute('data-picture-src') || img.parentNode.nodeName === 'PICTURE') {
if (!img.hasAttribute('data-picture-src') || img.parentNode.nodeName === 'PICTURE' || img.parentNode.nodeName === 'SOURCE') {
continue;
}
// if img element has already been evaluated, skip it
Expand Down

1 comment on commit 8540a66

@liamjay66
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jansepar I'm not sure if this code is the cause, but the picturefill is still not working in IE8 (tested on Windows XP), and that includes the demo URL: http://jansepar.github.com/picturefill/. The page currently only loads the heading text with no images.

Please sign in to comment.