Error with Blur Spoiler

(Evgeny) #1

I’m not sure what’s going on. But the photo is not displayed, or in some cases they are shifted.

Created a post on the demo site:

(Sam Saffron) #2

We reset try, can you reproduce this here?

(Evgeny) #3




There are errors in the console.

(Sam Saffron) #4

@vinothkannans can you add this to your list, looks like something is bust in spoliers.

(Jeff Atwood) #5

Likely related to the new image handling code we added @sam, might be best for @eviltrout to look at it since he touched it last.

(Sam Saffron) #7

Confirmed… yeah the bug is coming from lazy loading for sure… image.parentNode is null when it tries to switch it back in.

(Robin Ward) #9

This was a lot more complicated than I thought it would be. The issue here is that our spoiler alert plugin replaces images with SVGs so that IE11 can blur them properly, since it doesn’t support CSS blurring. This would cause all sorts of issues with lazy loading because it could be partially loading an image which is suddenly swapped out for a SVG.

The spoiler alert plugin would also replace the SVG frequently which caused even more havoc. Here’s the fix I came up with:

I didn’t merge it right away since it might be somewhat controversial - in IE11 I simply hide the image rather than blurring it. This fixes everything, and means less hacky SVG stuff to carry. The downside is a worse experience for a 5+ year old browser.


(Jeff Atwood) #10

Sounds totally :cool: to me! Especially if it is less code.

(Robin Ward) #11

And it’s now merged. Let’s see if there’s any more feedback.

(Jeff Atwood) #12