Not sure I like CSS3 transitions
One of the modules put forward in the proposed CSS3 specification is the transitions module. This adds a bunch of new CSS attributes which control the animation of property values over time, including everything you would expect (such as easing functions, speed, delays, repetition etc).
I know there are many grey areas where it’s hard to decide if something is really behavioural (so should be covered via javascript) or presentational (in CSS). I can’t help feeling that this is taking CSS too far into trying to accommodate behaviour. After all, mostly what we do with javascript is about changing the state of the DOM, which causes the browser to re-render with the change applied.
There are many problems that would need to be solved well in order for this to be viable, which are currently very simple to achieve in javascript using a decent library. These include…
- Managing multiple independent animations on an element
- Animating multiple elements simultaneously
- Cancelling all active animations on an element
- Transitioning either from the current value of a property, or from an absolute value
- Chaining animations (so when animation X finishes, trigger animation Y)
I think my other objection is simply that all of this is currently achievable in quite a simple way using existing web standards, and libraries built on top of those standards. I think deciding how to change a property over time is behavioural, not presentational and should stay in the realms of javascript. Given this, the only thing to consider is whether to extend the core DOM specification to standardise some of the behaviour that is currently provided by javascript libraries.
Personally I don’t quite see how this progresses anything – it will just add another way to achieve something we can do already and add inconsistency and confusion around how to approach animation.

Comments
No comments yet.
Leave a comment