[Mediawiki-l] Rendering inline SVG in the browser

Platonides Platonides at gmail.com
Tue Sep 11 16:47:34 UTC 2007


Michael Daly wrote:
> David Gerard wrote:
>> If I assume my wiki users are using Mozilla browsers, which handle SVG
>> themselves, is it possible to tell MediaWiki to send inline SVGs
>> as-is? Can they then render in Firefox and SeaMonkey? (Is this even
>> possible?)
> 
> I can't remember all the details as I've done this in a test wiki a 
> while ago with little success.  You'd have to change the doctype in the 
> skin's php file (i.e. monobook.php).  There are a few other changes 
> you'd have to make too.  I've got it to the point where SVG may or may 
> not show properly in Firefox.  I haven't found out all the possible 
> reasons why and abandoned it to complete a few other projects.
> 
> SVG exposes you to potential security problems, since SVG can contain 
> scripts that may or may not be benign.  I wrote an SVG php class that, 
> among other things, provides the ability to disable embedded scripts 
> based on a wiki configuration setting in LocalSettings.php.
> 
> My take is that regardless of what you do with MW, the browsers are 
> still not ready for prime time when it comes to SVG.  They can display 
> an SVG file on its own if it is properly defined, but do a poor job of 
> handling SVG when it is part of a larger web page.
> 
> Mike
Were you including the SVG content in the article page?

I see two ways:
-Including the svg in the article page as another xhtml namespace

-Using <img src="file.svg"> instead of <img 
src="file.svg/convertedto.png">. Which doesn't work, you need instad to 
embed it as an iframe to have it rendered.

Also note that viewing pages with SVGs is much slower (as the work or 
SVG->raster is not done by the server, but the client, hehe).




More information about the MediaWiki-l mailing list