Merge pull request #192 from nthykier/gh-189-order-vs-SVGLength

Work around an exception in removeDefaultAttributeValue() caused by some rarely used filter attributes that allow an optional second value which SVGLength does not handle properly
This commit is contained in:
Patrick Storz 2018-06-30 19:03:15 +02:00 committed by GitHub
commit 8c95d950af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 3 deletions

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink= "http://www.w3.org/1999/xlink">
<defs>
<filter id="filter" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feConvolveMatrix order="3 1" kernelMatrix="0.3333 0.3333 0.3333" kernelUnitLength="3 1" edgeMode="none"/>
</filter>
</defs>
<!-- Use the filter (otherwise, scour discards it before it trips over it) -->
<image id="png" x="10" y="30" width="150" height="50" xlink:href="raster.png"
filter="url(#filter)"/>
</svg>

After

Width:  |  Height:  |  Size: 585 B

View file

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink= "http://www.w3.org/1999/xlink">
<defs>
<filter id="filter" filterUnits="objectBoundingBox" x="0%" y="0%" width="100%" height="100%">
<feGaussianBlur stdDeviation="0 0" x="10" y="10" dx="20" dy="20" />
</filter>
</defs>
<!-- Use the filter (otherwise, scour discards it before it trips over it) -->
<image id="png" x="10" y="30" width="150" height="50" xlink:href="raster.png"
filter="url(#filter)"/>
</svg>

After

Width:  |  Height:  |  Size: 546 B