- From: Lars Gunther <gunther@keryx.se>
- Date: Mon, 29 Mar 2010 23:17:20 +0200
- To: www-style@w3.org
2010-03-29 18:57, Simon Fraser skrev: > Let me reiterate the reasons why we think declarative animation in CSS is a good idea: > > * Declarative animation is good for ease of authoring. I am defending declarative animation! I can't see that it has to be in CSS, though. Animations in JQuery are quite declarative today and served as an inspiration for my post. > * Declarative animation allows the user agent to make optimizations that > are impossible with iterative animation via script > (this is very important on lower-power devices). Ditto. I am not talking about iterative animation. > * Many CSS animations are presentational; ambient backgrounds animations, button that pulse when hovered etc. Yes, but what about those that are not. The DOM could satisfy both use cases. CSS only one. It can also be argued that when presentation starts to mean animation, that we are starting to cross the line into behaviour. > * Animations operate on CSS properties, so it makes sense to declare the keyframes in CSS. Every single CSS property already has a corresponding DOM property, used when manipulating it. > * Given declarative animations in CSS, you can easily layer a JavaScript API on top (even via a JS library). > It's not possible to do the reverse. Yes, but the only way to hook up an arbitrary event is through adding or removing a class. I do not think that is a clean solution within the library. > * It would be odd to have presentational changes in the document > (like animation via some non-CSS-based API) coming from a non-CSS source. > What would getComputedStyle() return? My turn to not compute. If I would like to run an animation triggered by a submit event, a load event, or on arbitrary element B triggered by hovering on element A, how is this odd? I see lots of applications that could use this. If we turn the table and look at this from the users perspective and not from a developers perspective: Would a user expect animations to run even if he/she has turned JavaScript off? I suspect a lot of animations will be ads, some annoying, some tasteful, but users of NoScript would probably want to have them blocked nevertheless. -- Lars Gunther http://keryx.se/ http://twitter.com/itpastorn/ http://itpastorn.blogspot.com/
Received on Monday, 29 March 2010 21:17:52 UTC