Chrome Canary, Picturefill and the missing src attribute

392 Views Asked by At

I've been working on an implementation of RoyalSlider and Picturefill, which has been working really well in all browsers. However, I've noticed that the latest Chrome Canary no longer adds the correct src attribute to an img tag when picturefill runs on a page. This is different to every other browser currently, and I assume it's something to do with srcset being supported natively in canary now, but caniuse says that it has been supported in Chrome since v34, and I don't have any errors on Chrome.

Basically the implementation is now broken for me on Canary because RoyalSlider looks for a src attribute to create the slider from. Since there isn't one, RS can't create a slider and I just get the preloader.

Here are some screenshots that illustrate what I mean https://i.stack.imgur.com/EzJms.jpg

Notice in Canary that even though the srcset attribute remains small.jpg, even though the image shown is large.webp.

I need to figure out a way of telling RS which image to load, which seems near impossible at the moment as nothing has changed in the DOM specifying which file picturefill (or possibly Canary) has deemed appropriate to use.

1

There are 1 best solutions below

0
On

According to Picturefill no longer applying src in Chrome Canary #295 on Github, the reporter "got exactly the same result turning picturefill off." and closed the bug report. FYI: a src is required, not justsrcset.