Apply a modified patch submitted by Jan Thor in bug 717254 to fix a bug whereby Scour would keep the <defs/> element if it was there but had only whitespace or unreferenced children.

This commit is contained in:
Louis Simard 2011-02-11 12:29:20 -05:00
parent bdae2bafae
commit 4657cb7515
4 changed files with 61 additions and 20 deletions

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<defs id="defs_one">
<linearGradient id="testgradient">
<stop style="stop-color:#e4ff01" offset="0"/>
<stop style="stop-color:#befb00" offset=".36267"/>
<stop style="stop-color:#216908" offset=".78168"/>
<stop style="stop-color:#0a2002" offset="1"/>
</linearGradient>
<filter id="CDS" x="-0.2" y="0.2" width="1.4" height="1.4">
<feGaussianBlur stdDeviation="8"/>
<feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0.6 0"/>
</filter>
<pattern id="testpattern">
<rect x="0" y="0" width="10" height="10" style="fill:#f00;"/>
</pattern>
<symbol id="testsymbol">
<rect x="0" y="0" width="10" height="10" style="fill:#0f0;"/>
</symbol>
</defs>
</svg>

After

Width:  |  Height:  |  Size: 837 B

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<defs id="defs_whitespace">
</defs>
<defs id="defs_empty"/>
</svg>

After

Width:  |  Height:  |  Size: 169 B