当半径为零时,带有feMorphology的链式svg滤镜会在firefox中导致白色图像

时间:2015-10-08 11:30:21

标签: firefox svg svg-filters

我有以下带有链式过滤器的svg(无操作参数)。这会显示chrome中的图像,但不会显示在firefox中。

https://jsfiddle.net/8hpu033j/



<filter  id="filter0" class="image-filter">

                    <feGaussianBlur color-interpolation-filters="sRGB"  stdDeviation="0" result="out1" ></feGaussianBlur>
                    <feColorMatrix color-interpolation-filters="sRGB" type="saturate"  result="out2"  in="out1" values="1"></feColorMatrix>
                    <feColorMatrix color-interpolation-filters="sRGB" type="hueRotate"  result="out3" in="out2" values="0"></feColorMatrix>
                    <feMorphology color-interpolation-filters="sRGB" operator="dilate" result="out4" in="out3" radius="0"></feMorphology>

                  </filter>
&#13;
&#13;
&#13;

如果我在feMorphology radius-attribute中添加0.001(windows)或0.0001(mac),图像也会在firefox中显示。

https://jsfiddle.net/zbeyhvq7/

&#13;
&#13;
<filter  id="filter0" class="image-filter">

                    <feGaussianBlur color-interpolation-filters="sRGB"  stdDeviation="0" result="out1" ></feGaussianBlur>
                    <feColorMatrix color-interpolation-filters="sRGB" type="saturate"  result="out2"  in="out1" values="1"></feColorMatrix>
                    <feColorMatrix color-interpolation-filters="sRGB" type="hueRotate"  result="out3" in="out2" values="0"></feColorMatrix>
                    <feMorphology color-interpolation-filters="sRGB" operator="dilate" result="out4" in="out3" radius="0.001"></feMorphology>

                  </filter>
&#13;
&#13;
&#13;

似乎在firefox中,feMorphologyFilter的值半径不能为0.如果我删除了最后一个过滤器,那么everthing就可以了。

我正在做某事。这里错了还是火狐虫?

1 个答案:

答案 0 :(得分:0)

来自SVG specification

  

radius =“&lt; number-optional-number&gt;”

...

  

值为零会禁用给定滤镜图元的效果(即,结果是透明的黑色图像)。

所以Firefox按照规范做得对,不是吗?随意报告Chrome错误。