SVG SMIL:animateTransform 替换为设置(不透明度和缩放属性)

SVG SMIL: animateTransform replace to set(opacity and scale attributes)

我可以设置animateTransform raplace吗?

<animateTransform attributeName="transform" attributeType="XML" type="scale" from="1" to="1.15" repeatCount="1" begin="mousedown+0.2s" dur="0.2s" fill="freeze"></animateTransform>
<animateTransform attributeName="transform" attributeType="XML" type="scale" from="1.15" to="1" repeatCount="1" begin="mouseup+0.4s" dur="0.2s" fill="freeze"></animateTransform>

对于变换(缩放)的操作,就像我在此处使用 'stroke-opacity' 属性所做的那样:

<rect x="-0.5" y="-0.5" width="1" height="1" fill="white">
  <set attributeName="stroke-opacity" begin="mouseover" end="mouseout" to="0.5"></set>
  <set attributeName="stroke-opacity" begin="mouseout" end="mouseover" to="1"></set>
</rect>

我试着得到这样的东西

<rect x="-0.5" y="-0.5" width="1" height="1" fill="white">
      <set attributeName="transform" type="scale" begin="mousedown" end="mouseout" to="1.15"></set>
      <set attributeName="transform" type="scale" begin="mouseup" end="mouseover" to="1"></set>
</rect>

但是这个结构不行。

有效:

Example of hover(using set): http://jsfiddle.net/exn2qr0s/

Example of click (using animateTransform): http://jsfiddle.net/exn2qr0s/1/

没用:

Example of click (using set): http://jsfiddle.net/exn2qr0s/2/

我需要使用 set 标签而不是 animateTransform 来创建放大效果,因为 'mousedown' 因为 animateTransform 在上次 Fire Fox 更新后效果不佳(Deprecated SMIL SVG animation replaced with CSS or Web animations effects (hover, click))

根据 table in the SVG specification animateTransform 仅适用于变换,所有其他动画元素包括 <set> 不适用于变换。