Hi there,
if we use the responsive_images module with blazy, we will get the fallback-image in IE11 and below, because they don't support the picture element. This is most often, a recommended smallest image, which looks bad on desktop.
The responsive_images module fixes this, by using a polyfill, called picturefill: http://scottjehl.github.io/picturefill/
This polyfill adds a src attribute with the correct image from the sources.
The problem is, that picturefill seems to expect only srcset to be present on the fallback image, but we changed that, when implementing the picture support.
See the discussion here: https://www.drupal.org/node/2752865
I still have to investigate more, since we need a src attribute to make blazy work...
What do you think?
Comment | File | Size | Author |
---|---|---|---|
#6 | blazy-ie-picture-2873319-6.patch | 8.27 KB | gausarts |
#3 | blazy-ie-picture-2873319.patch | 4.61 KB | gausarts |
Comments
Comment #2
gausarts CreditAttribution: gausarts commentedThanks for the report.
I am afraid, I didn't use picture element as mentioned at:
https://www.drupal.org/node/2752865#comment-11318343
I was happy to include it when you offered it:
https://www.drupal.org/node/2752865#comment-11771528
However as it is in, I am happy to give it more love like you do ;)
I am thinking to pass picturefill library into
BlazyManager::attach()
.But first we need to know that we are dealing with picture from the given "Responsive image style" setting.
We may need to investigate Responsive image module source code if any function that can be used to identify picture element from "Responsive image style". Once identified, we can tell
BlazyManager::attach()
to attach its library.Then it should be good, yes?
If not that easy, then we need to do more work on this ;)
Comment #3
gausarts CreditAttribution: gausarts commentedI know you are working on this. But I guess I found the old solution.
The solution was there at alpha2:
http://cgit.drupalcode.org/blazy/tree/js/blazy.load.js?id=97a3f1c8303f77...
It was removed later when SRCSET support was landed:
https://github.com/dinbror/blazy/issues/75
Tested against IE9, but I haven't got a chance for other IEs. Please verify.
It doesn't affect modern browsers as I noticed Picturefill outputs extra
[data-pfsrc]
for IE9 which is used to exclude modern browsers.I am not sure if
[data-pfsrc]
is also output for IE10+.If not, and not working for IE10+, please try removing the condition "&& ie":
Comment #4
gausarts CreditAttribution: gausarts commentedMay need clearing both Drupal and IE cache. Or regenerate JS if trouble.
Comment #5
tjwelde CreditAttribution: tjwelde at Thunder commentedgood find ;)
Works also perfectly in IE11.
Thanks.
Can you publish a new release after merging this?
Best Regards
Timo
Comment #6
gausarts CreditAttribution: gausarts commentedThank you.
I'm in the middle of something, yet will do tomorrow, or sooner, hopefully. ;)
ATM, safe to remove the
@todo
, and move thehasClass
into dBlazy to be re-usable.Attached for doc only, then.
Comment #7
gausarts CreditAttribution: gausarts commentedSorry, I couldn't make it "tomorrow" :(
I am still in the middle of something before I can release another RC. Hopefully it doesn't take days, though.
Comment #8
tjwelde CreditAttribution: tjwelde at Thunder commentedok, thanks for the update
Comment #9
daniel.bosenHas "tomorrow" happen yet? :-)
Comment #11
gausarts CreditAttribution: gausarts commentedSorry for delay ;)
I was adding a few basic tests and needed to sync them first with Slick, GridStack, etc. tests as well.
We'll have an RC2 shortly.
Thanks for the spirit ;)