W3C home > Mailing lists > Public > www-smil@w3.org > October to December 2010

Events when adding and removing animation elements in play

From: Brian Birtles <birtles@gmail.com>
Date: Fri, 8 Oct 2010 09:45:51 +0900
Message-ID: <AANLkTi=KD_RgQrYxdn7ALCi7G9dTHgA0yY1hDCEY6rc3@mail.gmail.com>
To: www-smil@w3.org
Dear all,

I wish to clarify the expected behaviour of animations that are
dynamically removed and added from a document with regards to the
events that are generated.

Suppose an animation is in play when it is temporarily removed from
the document. Later, that same animation is re-attached to the
document. In the meantime however, the time of the document (or, more
accurately, the time container) may have changed either through
seeking the document or simply due to the wallclock time that has

When the animation is re-attached it must either catch-up or wind back
to the document time. However, just how this should be done is not, so
far as I know, specified.

Some options include:

1) When the element is removed, all information regarding the
animation's progress is lost. Re-attaching effectively performs a kind
of forwards-seek on the animation.

2) Animation progress is retained and when the element is re-attached
either a forwards or backwards seek is performed as required.

Personally, I think (1) is more intuitive, particularly as the element
may be re-attached to a different time container altogether.

However, regardless of which it is, there is still the question of the
nature of the seek. Generally, when seeking is performed most events
that would otherwise be generated along the way are suppressed.[1] So,
is attaching an element a genuine seek in that sense or should all
events still be generated? My feeling is that they should still be

Thus for the attached example which I've simplified below:

    function seek()
    document.addEventListener("SVGLoad", seek, true);
  <circle ...>
    <animate begin="2s; 6s; 10s" dur="2s" id="animate" .../>

My understanding is that we should get:

* 1 x beginEvent as a result of the initial seek to t=11s (as per my
interpretation of [1])
* 2 x beginEvent as a result of re-attaching the animation element
(which will drive the animation through begin times 2s and 6s)

Then after 3s,
* 1 x beginEvent when the third interval begins (at t=10s)

Another issue is whether detaching an animation that is in play should
generate an endEvent. Personally I think it should not since otherwise
a lot of events would be generated on document teardown unless
implementations differentiate between these two situations
(script-based removal and document teardown).

Any thoughts here would be greatly appreciated.

Best regards,

Brian Birtles

[1] http://www.w3.org/TR/SMIL3/smil-timing.html#q114

(image/svg+xml attachment: add-remove.svg)

Received on Friday, 8 October 2010 00:46:23 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:34:28 UTC