In IE8-, I always get a javascript error on page load.
The error is in picturefill.js, on line 52 : frag.innerHTML = srcs.join( "" ); : 'null' is null or is not an object.
It seems that srcs is null…

Comments

luksak’s picture

The same problem applies for IE7. I tried updating Picturefill, but it seems to be incompatible with resp_img as the markup changed to:

  <div data-picture data-alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia">
        <div data-src="small.jpg"></div>
        <div data-src="medium.jpg"     data-media="(min-width: 400px)"></div>
        <div data-src="large.jpg"      data-media="(min-width: 800px)"></div>
        <div data-src="extralarge.jpg" data-media="(min-width: 1000px)"></div>

        <!-- Fallback content for non-JS browsers. Same img src as the initial, unqualified source element. -->
        <noscript>
            <img src="external/imgs/small.jpg" alt="A giant stone face at The Bayon temple in Angkor Thom, Cambodia">
        </noscript>
    </div>

But as you can see this example using not exactly the same version, but on that uses the <picture> element, is working in IE8 for me:

http://wil.to/picturefill/

Using this version of Picturefill doen't work either.

Is this a issue of Picturefill or resp_img itself? Can someone provide a working example?

luksak’s picture

I created a separate issue for updating the javasripts and the markup: #1835038: Update Picturefill to the latest release

I also created a patch for fixing the fallback: #1835384: scr attribute missing for fallback image

But both of them do not fix the issue in IE8 and below (yet). Is this a known issue? Or is it my setup that is causing this problem? Would be nice to get some feedback here, becaus sadly, I can't drop IE8 support on my websites yet :)

attiks’s picture

Thanks for the bug report, since picture is now part of Drupal 8, we will backport that code to Drupal 7, we will be creating a new version combining resp_img 7.x-2.x and picture 8.x into picture 7.x

You can try using the picturefill.js version of Drupal 8 at http://drupalcode.org/project/drupal.git/blob/refs/heads/8.x:/core/modul...

luksak’s picture

My main question is: Is it supposed to work on IE8? Is there a working demo?

I already did. It doesn't fix the issue. So I should be working on picture for 8.x to push forward to get a backport to 7.x? How do I find issues regarding picture? There is no component in the D8 issue queue.

attiks’s picture

"So I should be working on picture for 8.x to push forward to get a backport to 7.x?" Well not really, latest code to start from is in drupal core now.

"There is no component in the D8 issue queue" You can create a new issue against drupal core, to ask them to add the component.

"Is it supposed to work on IE8?" Yes, it should display the fallback image.

luksak’s picture

"So I should be working on picture for 8.x to push forward to get a backport to 7.x?" Well not really, latest code to start from is in drupal core now.

That is what I meant :)

"There is no component in the D8 issue queue" You can create a new issue against drupal core, to ask them to add the component.

I posted a issue: #1836418: Create a issue queue component for the picture module

"Is it supposed to work on IE8?" Yes, it should display the fallback image.

Do you have a working demo? Would you take a look at my installation if I posted a link to it?

attiks’s picture

See #1757518: D7 backport of Picture

Regarding your IE8 problem, feel free to post your link here or use my contact form

luksak’s picture

Picture elements loaded initially in the document are correctly being parsed. I am having this issue when applying the picturefill on AJAX-loaded content. See: #1830754: Not being applied to images loaded via AJAX

I found this:

https://github.com/scottjehl/picturefill/issues/13

So maybe #1835038: Update Picturefill to the latest release should reconsidered? What do you think?

I created a patch for picture that fixes this issue: #1841062: Updating picturefill to latest version

aquariumtap’s picture

@Lukas - I'm also seeking a working example in IE8. Are you sure the link you posted in #1 (http://wil.to/picturefill/) is working in IE8? For me, the image under "elements using both media and srcset attributes" does not appear at all. Under "source elements using media attributes only", I only see the small (fallback) image. Is that the behaviour you expected?

Did you get responsive images working in IE8 for all but ajax-loaded content? How did you get that far? By upgrading picturefill.js? By using the backport of the D8 picture module?

attiks’s picture

@aquariumtap have a look at the picture module, it has a demo

The problem with IE8 is that it doesn't understand media queries, but picture will allow you to specify any image style as a fallback.

aquariumtap’s picture

I had built a site with resp_img and didn't want to swap it with the new picture backport (my site is late into development), so I made an IE-specific fallback by adding this to the markup to theme_picture():

    $output[] = '<!--[if (lt IE 9) & (!IEMobile)]>
            <img ' . $images[0]['image'] . '/>
        <![endif]-->';

I understand the focus is now on the picture module backport, so I won't submit a patch, but a potential solution with resp_img would be to configure a fallback specifically for IE using this method.

attiks’s picture

Issue summary: View changes
Status: Active » Closed (won't fix)

Old issue, I think you better update to the picture module