W3C home > Mailing lists > Public > www-style@w3.org > April 2010

Re: transitions vs. animations

From: Håkon Wium Lie <howcome@opera.com>
Date: Mon, 5 Apr 2010 17:21:06 +0200
Message-ID: <19385.65506.342806.854277@gargle.gargle.HOWL>
To: Simon Fraser <smfr@me.com>
Cc: www-style@w3.org
Also sprach Simon Fraser:

 > In the simple case, consider:
 > .one {
 >   effect: on-entry jiggle 2s, on-exit bounce 1s;
 > }
 > .two {
 >   effect: on-entry sway 1s;
 > }
 > If the classname changes from  "one" to "two", do you run both "bounce and "sway"? 

When the class name changes, the element will get a new value on the
'effect' property. This causes both 'bounce' and 'sway' to play.

Think of 'on-exit' as a way of delaying the start of the animation,
and 'on-entry' to set the delay to 0. As such, these are just new
values on the delay property and a simple way to address the 'blue
bouncy ball' use case.

 > What if the classname changes from "one" to "one two"? 

Then there will, as per the normal cascading rules, be a new value on
the 'effect' property. So, again, both 'bounce' and 'sway' will play.

 > Now consider the classname changing from none to "one two". You now
 > run both "jiggle" and "sway".

This declaration will win:

   effect: on-entry sway 1s;

So, only 'sway' is played.

 > I also think that "states" here are poorly defined. Consider:
 > .one.two {
 >   effect: on-entry jiggle 1s;
 > }
 > .two.three {
 >   effect: on-entry twirl 1s;
 > }
 > and the class changes from "one" to "one two three". Am I entering
 > the "one two" state, as well as entering the "two three" state?

Think of property values, not states. In the change you describe, the
last declaration would win (as per the normal cascading rules) and the
effect would be that 'twirl' plays.

 > As I think was mentioned at the meeting, attaching effects to state
 > changes causes a combinatorial explosion in the number of changes
 > that an author has to deal with. I can see developers having to do
 > lots of special-casing because they only want to run an exit effect
 > on A when transitioning from A to B, and not A to C.

I'm not sure I understand. Are you saying that this scenario is
possible in the current specifications and that it will be hard to
specify with the 'effect' property (or some similar proposal)? If so,
could you provide a more concrete example?


              Håkon Wium Lie                          CTO °þe®ª
howcome@opera.com                  http://people.opera.com/howcome
Received on Monday, 5 April 2010 15:54:17 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:07:44 UTC