rsvg on scaler does not support styling the root element
Closed, ResolvedPublic

Description

See also: The thumbnail of the original upload has a black background. It contains the following line:

<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="300px" height="200px" style="fill:#0072BC">

The most recent upload of the file has as only change a ; after the style comment:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="300px" height="200px" style="fill:#0072BC;">

The rsvg parser is supposed to force style element termination before feeding it to the css parser, just as the HTML parsers do with style="" attributes.


Version: unspecified
Severity: normal
URL: http://commons.wikimedia.org/wiki/File:Wanderwee_symbol_%2B.svg
See Also:
https://launchpad.net/bugs/921897

bzimport added a subscriber: wikibugs-l.
bzimport set Reference to bz31122.
TheDJ created this task.Via LegacySep 23 2011, 6:50 PM
TheDJ added a comment.Via ConduitSep 23 2011, 7:02 PM

Strike comment 1:

This does NOT work:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="300px" height="200px" style="fill:#0072BC">
<rect x="0" y="0" width="300px" height="200px"/>

This does work:
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="300px" height="200px">
<rect x="0" y="0" width="300px" height="200px" style="fill:#0072BC;" />

brion added a comment.Via ConduitSep 23 2011, 10:30 PM

I can confirm that this isn't handled on what's live... but it appears to be fixed upstream in librsvg.

Rendering them on my dev boxes running rsvg 2.32.1 (Ubuntu 11.04 stock) or 2.34.1 (Ubuntu 11.04 with GNOME 3 installed) renders a nice blue field.

Perhelion added a comment.Via ConduitSep 24 2011, 4:44 PM

Also most styling as XML attributes don't work anymore (fill=) http://upload.wikimedia.org/wikipedia/commons/1/1d/Testfile.svg

MarkAHershberger added a comment.Via ConduitSep 24 2011, 5:12 PM

(In reply to comment #3)

Also most styling as XML attributes don't work anymore (fill=)
http://upload.wikimedia.org/wikipedia/commons/1/1d/Testfile.svg

Did this used to work?

Otherwise duping RE:

(In reply to comment #2)

I can confirm that this isn't handled on what's live... but it appears to be
fixed upstream in librsvg.

Rendering them on my dev boxes running rsvg 2.32.1 (Ubuntu 11.04 stock) or
2.34.1 (Ubuntu 11.04 with GNOME 3 installed) renders a nice blue field.

  • This bug has been marked as a duplicate of bug 24000 ***
Perhelion added a comment.Via ConduitSep 25 2011, 10:39 PM

(In reply to comment #5)

(In reply to comment #3)
> Also most styling as XML attributes don't work anymore (fill=)
> http://upload.wikimedia.org/wikipedia/commons/1/1d/Testfile.svg

Did this used to work?

No this has the bug: [[file:Testfile.svg]]

> *** This bug has been marked as a duplicate of bug 24000 ***

Are now all fixed rsvg bugs in bug 24000??

This bug here is new.

Perhelion added a comment.Via ConduitDec 24 2011, 3:44 PM

*** Bug 33323 has been marked as a duplicate of this bug. ***

MarkAHershberger added a comment.Via ConduitDec 24 2011, 4:38 PM

Re-opening mis-duped bug. Since the bug was in the version of librsvg that shipped with Lucid, I've back ported the version of librsvg from precise (http://packages.ubuntu.com/precise/librsvg2-2) and submitted it for Ops to review in https://rt.wikimedia.org/Ticket/Display.html?id=2190 since there are some security issues involved.

Hopefully we'll be able to get this taken care of before the new year, but I wouldn't expect too much this weekend.

MarkAHershberger added a comment.Via ConduitJan 4 2012, 12:56 AM

An update: I've asked Tim to review the updated package so Ops can push it.

RobLa-WMF added a comment.Via ConduitJan 25 2012, 6:08 PM

Tim fixed a different issue associated with librsvg, but I don't believe that the actual bug referenced here was fixed. It would be good for someone to file an upstream bug and reference it here.

MarkAHershberger added a comment.Via ConduitJan 26 2012, 1:25 AM

(In reply to comment #10)

It would be good for someone to file
an upstream bug and reference it here.

Against Ubuntu's Lucid? The version in Ubuntu's Precise works.

MarkAHershberger added a comment.Via ConduitJan 26 2012, 1:29 AM

(In reply to comment #11)

Against Ubuntu's Lucid? The version in Ubuntu's Precise works.

Also, I provided patches to backport the version in Precise to Lucid in the RT ticket. I'm not sure why, if we're willing to patch what we consider security problems, we can't also backport working packages to fix bugs that we experience.

MarkAHershberger added a comment.Via ConduitJan 26 2012, 3:20 AM

For completeness, filed an upstream bug with the fix.

hashar added a comment.Via ConduitFeb 29 2012, 7:54 PM

Migrating bug to Wikimedia > SVG rendering

hashar added a comment.Via ConduitOct 25 2012, 9:47 AM

Wikimedia imagescaler have been upgraded to Precise which brings librsvg2 to 2.36. I have uploaded the bugged file http://upload.wikimedia.org/wikipedia/commons/archive/b/bd/20110922210513%21Test.svg as a new file :
https://commons.wikimedia.org/wiki/File:Bug31122-testfile.svg

Renders properly with a blue background. So I guess this bug is now fixed.

Add Comment

Column Prototype
This is a very early prototype of a persistent column. It is not expected to work yet, and leaving it open will activate other new features which will break things. Press "\" (backslash) on your keyboard to close it now.