GNOME Bugzilla – Bug 786372
Certain black/white SVG files only display black (due to <style> missing a type="text/css" attribute)
Last modified: 2017-08-18 09:57:44 UTC
Created attachment 357728 [details] user.svg Image viewer is not showing svgs. See attached samples
Created attachment 357729 [details] sitemap.svg
Created attachment 357730 [details] 5.svg
Ubuntu 17.04
Same if you import those SVG files into e.g. GIMP... I can imagine that all SVG files are correctly displayed but that they are black and have a transparent background. And the background in EOG is black. So you have black on black. I would have expected a checkered background if this is the case. (Not "critical" priority by definition.)
It looks like this may be a bug/limitation in librsvg as the thumbnails in Nautilus are also fully black, as is the display in rsvg-view (which maps transparency to the window background). Also on zooming you can sometimes see the checkerboard pattern shine through at the image borders.
Ah, good catch. The example files have <style>.a{fill:#010101;}.b{fill:none;}</style> and later the path elements use the "a" and "b" classes. However, librsvg expects the <style> to have a type="text/css" attribute; it's ignoring the <style> because it doesn't have that attribute. The SVG spec in https://www.w3.org/TR/SVG/styling.html#StyleElementTypeAttribute mandates that if the type attribute is not specified, it should default to "text/css". I'll fix this; the problem is in rsvg_start_style(). (If you add type="text/css" to those <style> tags, the images render correctly.)
Fixed in b2cc9ce in the librsvg-2.40 branch, and caf234c in the master branch.