Page MenuHomePhabricator

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

Details

Reference
bz31122

Event Timeline

bzimport raised the priority of this task from to High.Nov 21 2014, 11:50 PM
bzimport set Reference to bz31122.
bzimport added a subscriber: Unknown Object (MLST).

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;" />

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.

(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 ***

(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.

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

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.

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

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.

(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.

(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.

For completeness, filed an upstream bug with the fix.

Migrating bug to Wikimedia > SVG rendering

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.