Animations in CSS or the DOM - what does the DOM community say?

Hello all again!

I  have been first down with a stomach flu and then exceptionally busy.

But now I have taken some time to look into my proposal to move 
animations to the DOM now, and perhaps present my case in a more 
coherent way. Since I wanted to hear from the DOM community, I took it 
to my blog:

http://itpastorn.blogspot.com/2010/04/why-declarative-animation-should-be-in.html

I am pasting the most relevant part here:

----------------------------
  OK, you are building a little library to animate stuff. What do you 
do? I suppose the following:

    1. First you capability detect support for declarative animation. 
That in itself would be easier if it was in the DOM, but it is at least 
doable now. But not in a neat fashion. Score one against having 
animations in CSS.

    2. If CSS-animation is indeed supported, you will wrap your animate 
function around className switches. Doable, but not neat.

    3. If CSS-animation is unsupported, you fall back to old school 
timed manipulation of the style attribute.

      * However, using the animation parameters from the CSS-file is a 
huge impracticality. You must find a way to read all CSS-files, parse 
them and interpret the cascade, the specificitivity of all animation 
rules and convert that information into timed logic. This is 
impractical, slow and CPU-draining and fragile.

      * The CSS Object Model (CSSOM) will not alleviate this problem. 
Browsers that need to parse the animation rules are the ones that 
neither implement animations, nor the corresponding CSSOM.

Alternatively, the author is required to re-specify the animation once 
again, now using a syntax for the fallback. We thus get code 
duplication, with all the error proneness and maintenance problems that 
follows from that approach. But it is the only approach currently 
available with reasonable results.

It can safely be said, that CSS-animations are not backwards compatible 
in any reasonable way. And we are going to need backwards compatible 
solutions for almost another decade or so.
---------------


-- 
Lars Gunther
http://keryx.se/
http://twitter.com/itpastorn/
http://itpastorn.blogspot.com/

Received on Thursday, 22 April 2010 23:08:06 UTC