Page MenuHomePhabricator

Thumbnail doesn't render when SVG isn't supported
Closed, ResolvedPublic

Description

When testing 288094: Allow brackets in createImgThumbnail, I discovered that if SVG isn't supported by the UA, then the thumbnail is requested but isn't rendered:

no-svg-support.gif (564×464 px, 55 KB)

This is because the styles that position the SVG thumbnail aren't applied to the <div> fallback created by #createImgThumbnail (see resource/ext.popups.core.less).


Browser: Google Chrome (50.0.2661.94)
OS: Mac OS X (10.11.4)

Event Timeline

Using the same browser and OS it seems like upon hovering on the http://en.wikipedia.beta.wmflabs.org/wiki/Birdlike_dinosaur a dwell on the Archaeopteryx link yields the SVG. Able to reproduce?

@dr0ptp4kt: I should've been clearer, you need to forcefully disable SVG support or use a UA that doesn't support SVG, e.g. IE, which is explicitly blacklisted.

What is the expected behavior? Do not request the SVG if it's not supported?

I think that's the simplest option in the short run. @Nirzar, cool?

What is the expected behavior? Do not request the SVG if it's not supported?

The SVG isn't being rendered. When SVG isn't supported, we render a <div> with a background-image style but it isn't styled correctly. The expected behaviour should be "the fallback div is rendered correctly".

So this one sucked me in.
A day later, I'm still confused. ResourceLoader doesn't support IE8 and IE9 can handle SVGs.

I was reading up on SVG rendering problems in IE9 (not to well documented in the code) and unfortunately didn't quite understand the code so ending up doing lots of code hygiene patches and found a fix for bug T68496 in the process.

I haven't got too far if someone wants to read through the chain of commits I've created to navigate through and document this code: https://gerrit.wikimedia.org/r/#/c/288552/
and pick up where I've left off...

Change 288636 had a related patch set uploaded (by Jdlrobson):
Make SVG thumbnails show for Internet Explorer

https://gerrit.wikimedia.org/r/288636

Boom. Just as I thought - we can render SVGs in IE9 so no need for a fallback. (Note in IE < 9 ResourceLoader blocks JavaScript support anyway).

Boom. Just as I thought - we can render SVGs in IE9 so no need for a fallback. (Note in IE < 9 ResourceLoader blocks JavaScript support anyway).

rm -rf support/ie8

phuedx claimed this task.

Verified. The original bug has now been fixed but there's still 288636: Make SVG thumbnails show for Internet Explorer to review, test, and merge.

Nothing to see here…

Change 288636 merged by jenkins-bot:
Make SVG thumbnails show for Internet Explorer

https://gerrit.wikimedia.org/r/288636

Jdlrobson claimed this task.