Regression: 'fill' in <use xlink:href="blah" fill="#dddddd" /> is ignored
Issue Summary
There are SVG files which are rendered correctly everywhere else, but incorrectly by librsvg, because librsvg seems to not handle fill
in <use>
tags correctly.
Example SVG
<svg x="0" y="0" viewBox="0 0 100 100" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">;
<symbol id="cloud">
<path d="M55.7,5A23.94,23.94,0,0,0,34.37,18.05a9.9,9.9,0,0,0-12.78,5.56,15,15,0,0,0-1.71-.1A14.81,14.81,0,0,0,9.2,28,14.63,14.63,0,0,0,5,38.17v.21A14.83,14.83,0,0,0,19.88,53.06H75.59a14.3,14.3,0,0,0,3.67-28.14A23.93,23.93,0,0,0,55.7,5Z"></path>
</symbol>
<symbol id="s04">
<use xlink:href="#cloud" fill="#dddddd" x="0" y="0" width="100" height="100" transform="translate(3,18) scale(1,1)"></use>
</symbol>
<use xlink:href="#s04" x="0" y="0" width="100" height="100"></use>
</svg>
The <use xlink:href="#cloud" fill="#dddddd">
is what's being ignored. If I move fill="#dddddd"
to the <symbol id="cloud">
, the converted SVG looks as expected. The x
, y
, width
, height
and transform
attributes have the expected effect, just the fill
is broken.
Librsvg Version
The problem exists on 2.56.2, but not in 2.52.0. I'm unable to test 2.56.90 because of the bumped cairo version requirement.
I ran a bisect, and ffbec91a is the first bad commit.
Here's the PNG as generated by rsvg-convert built from ffbec91a:
Here's the PNG as generated by the commit before, 4245a418:
Platform
macOS 13
Additional logs
No output is generated from RSVG_LOG=1 rsvg-convert hello.svg
.