Additive animation

September 21st, 2005

Additive animation appears to be working. The test case I mentioned in the last post works, even the nasty tree re-ordering cases. I’ve also extended the additive test case a little to test a bit more of the dynamic behaviour.

In implementing this I’ve tightened up the implementation of the <animate> element somewhat and wrapped each sample in a pair of calls to suspendRedraw and unsuspendRedraw.

I’m putting feature work on hold while I tidy up the code and update the documentation on the wiki.

The remaining features I hope to add this year are:

  • fill modes
  • restart
  • accumulate
  • min and max
  • keyTimes
  • keySplines

I may have a chance to look at adding support for specifying target elements via xlink:href and perhaps CSS values and relative values but I’m not sure. I’ll be focussing more on thread safety, performance, optimisations, DOM interfaces etc.

The latest patch:
http://brian.sol1.net/svg/patches/smil-anim-2005-09-21-2129.patch

Additive animation nearly done

September 14th, 2005

I’ve done most of the work required for additive animation. The remaining part is to correctly order animations in the animation sandwich after changes to the document structure. So in this test case the last two squares don’t behave as they should. (However, ASV fails in the same way.)

Also, I’ve implemented from/to/by animation and animation using a list of values.

I’ve done a lot of tidying up too but the nsSVG(Animated)Length situation is still a nightmare.

By the end of September I hope to have:

  • cumulative animation, and
  • fill modes

and maybe:

  • restart, and
  • min and max

After that I’ll hopefully add keyTimes and keySplines and calcMode (at least for spline, linear and discrete) but mostly I’ll focus on integration, performance, testing etc. Something should be ready by December.

Here’s the patch for my latest changes: smil-anim-2005-09-14-2043.patch (about 230k).

I haven’t included configure in the diff so you’ll need to regenerate it from configure.in.

Under Cygwin the following works for me:

autoconf-2.13 configure.in > configure

Compositing underway

September 7th, 2005

I’ve begun work on implementing compositing. This will take some time. Also I’m no longer sure I’ll be able to deliver syncbase timing this year as instead I may need to focus on integration issues, performance, documentation, thread-safety and so on. Hopefully all this will mean it has a better chance of getting checked in sooner though.

Repeating

September 4th, 2005

I’ve added a basic implementation of repeating. This doesn’t include accumulating or repeat-based timing but this test [removed] and a whole lot of other unit tests seem to work. Also, I’ve added a couple more tests.

I’ve made up a patch of these latest changes and managed to remove the dependency on the changes in the wings for bug 301628 so the patch is a little smaller than last time but still 400k. Most of that is just changes to configure.

Here’s the patch again: smil-anim-2005-09-04-1725.patch

The same instructions and caveats apply as last time except I haven’t tested this patch on Linux like I did the last one.

Intervals

September 3rd, 2005

I’ve implemented handling for multiple begin and end values including calculating the active duration, selecting the correct interval etc.

Interestingly Adobe SVG Viewer (6 beta) seems to do things a little differently to what I’d expect based on the SMIL Animation spec. There are a few cases but probably the most important one is when you specify a list of begin times and a list of end times but the latest begin time is after the latest end time. The pseudocode in the spec says this is an error–it’s ok if the end time is not set as it will default to indefinite–but if it is set, then it needs to provide a valid end value for the intervals defined by the begin attribute. The pseudocode isn’t authoritative but I couldn’t find anywhere else where this is spelled out in the spec.

(Content authors can always work around this by adding indefinite to their end specifications, e.g. end="...; indefinite".)

New patch

August 29th, 2005

I thought I’d post this patch which contains my work so far.

This patch contains most of the classes I outlined in my design. It will do very simple animation of lengths using a very limited subset of timing specifiers. Please don’t look at the code in nsSVGLength and nsSVGAnimatedLength. It’s just a hack to get it to work while I wait to hear from others how this should be done in the end. Probably the implementation I included in the previous patch was better.

I wouldn’t really recommend applying it because it also contain’s tor’s patch for bug 301628 but along the way I’ve had to merge it with recent <textPath> and events checkins and I’ve possibly broken something along the way. So you’re better off just to leave it until bug 301628 gets checked-in and I re-create the patch.

If you’re feeling brave however, you’ll probably want to apply it from /mozilla and run:
patch -p 3 -u -N < smil-anim-2005-08-29-1947.patch
(I’ll fix the absolute paths someday so you don’t need -p 3). You’ll need to add --enable-smil to your .mozconfig and then do a full build. If you want to try just doing a minimal re-build, the following might work:

mozilla> ./configure (to re-create autoconf.mk, although this will have the effect of touching all the Makefiles meaning that when you run make libs later on it will take a while. You might want to just try and patch up autoconf.mk yourself).
mozilla/dom/public> make (to export the headers and make the IDL definitions)
mozilla/content/smil/public> make (to export the headers required by nsPresContext.h
mozilla/layout/base> make (to update nsPresContext)
mozilla/dom/src/base> make
mozilla/dom> make (not sure if this is necessary)
mozilla/content/smil> make
mozilla/content/svg/content/src> make
mozilla/layout/svg/base/src> make
mozilla/layout> make libs

Like I said, you’re probably better off doing a full build, I’m really not sure that the above approach will work. I’ve tried the patch on Windows and Linux and it works for these test cases.

Here’s the patch again: smil-anim-2005-08-29-1947.patch. It’s about 500k.

Iteration One

August 13th, 2005

Just a quick update in case anyone someone actually reads this page. I’ve implemented most of what I intended to cover in the first iteration and now some very basic animations work. If anyone is at all interested I’ll post a patch, but otherwise I’ll leave it for a while.

Draft design

July 19th, 2005

I’ve added a very draft design to the Mozilla wiki page. If you have any comments, please add them to the wiki page! Thanks to Patrick L. Schmitz for allowing me to use some of the ideas he proposed in his Batik Timing and Animation Support design.

Basic prototype

May 18th, 2005

I’ve put together a very basic prototype with some of the ideas discussed so far. Please be aware that it’s very limited. The idea was just to help with discussion and to help me try to understand some of the suggestions. So it’s not a serious proposal. I was working on something a bit more solid but I threw it away after I read some of the suggestions on usenet/IRC/wiki.

So there are about a bzillion things wrong with the prototype but I think it should still aid discussion.

I tried to implement Alex’s suggestion for the anim/base value split. It mostly works but produces a lot of assertions and doesn’t function correctly via the DOM (not sure if it’s because a modified QueryInterface is needed or because of vtable magic involved in XPConnect). I won’t look at this too much more because there seem to be a lot of (much more capable) people interested in this. Scooter and I agreed that he’d look at this and I’d look at the timegraph stuff.

This experiment only animates the x and y attributes of elements and only for very simple animations. Basically it runs this test case [removed] and probably nothing else.

Here it is: Animation experimenting patch (to be applied from /mozilla, I ran patch -p 3 -u -N < anim-proto-1.patch).

Please email me if you have any comments–or better yet email everyone or write something on the wiki.