SVG:沿动画路径的动画发挥作用



当我沿着动画路径使用动画移动时,Firefox(26)遵循原始路径,而Opera(17)和Chrome(32)遵循不断变化的路径。例如,在下面的SVG中,红色矩形在100,10的位置在FF中的位置结束,而在其他浏览器中为50,10:

<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 100 100">
 <path id="p" stroke="black" stroke-width="1" d="M 0,10 100,10"/>
 <rect id="r" x="-5" y="-5" width="10" height="10" fill ="red"/>
 <animate xlink:href="#p" attributeName="d" to="M 0,10 50,10" dur="5s" fill="freeze" repeatCount="1"/>
 <animateMotion xlink:href="#r" dur="5s" fill="freeze" repeatCount="1">
  <mpath xlink:href="#p"/>
 </animateMotion>
</svg>

根据SVG规格的正确行为是什么?

这已经修复了,您可以在每晚进行firefox立即进行测试,否则请等待Firefox117。

最新更新