Proposals/AnimateMotion DOM API

From SVG

This proposal adds a way to query the current position and rotation of a shape that is animated with animateMotion. It's related to ISSUE-2204 - Improve DOM Interfaces for SMIL Values.

partial interface SVGAnimateMotionElement {

  // The position on the path at the current time, the returned object is a snapshot and is not live.
  SVGPoint position;

  // The rotation angle (in degrees) at the current time, taking into account the 'rotate' attribute.
  readonly float angle; 


  • Could perhaps return an SVGAngle for the angle instead, but then the whole object should be read-only, and most of the methods there are only useful on mutable objects.
  • Could add as a convinience a transform property too, to get the combined translate/rotate transform.