Re: [css3-transitions] Automatically reversing transitions and multiple transition-delays

On Tue, 27 Dec 2011 01:41:57 +0100, Witold Baryluk  
<baryluk@smp.if.uj.edu.pl> wrote:

> Hi.
>
>
> I find it pretty disturbing that simple thing in CSS like

> Full example here http://jsfiddle.net/CTtxV/
>
> doesn't behave in consistent, symmetric or intuitive
> manner with respect to reversal.
>
> In fact it even works differently in Opera than in Firefox and Chrome.

The currently released Opera implementation of transitions is based on the  
pre-w3c webkit specification. It was before reversing transitions was  
described, so you shouldn't take the behavior there seriously. Also, it's  
transitioning specified style, not computed style. The implementation in  
Opera is currently being updated based on the recent EDs.

> Just play few minutes with mouse, and you will see what I mean. After
> starting transition everything is ok, and if we pull off mouse before
> second phase of transition triggers, then transition is nicly reversed.
> However if second phase of transition started, or transition ended
> complete, then pullng mouse off starts transitions which is not reversal
> of transition which lead us to this point.
>
> This is in oposition to the "This should just work." rule.

Transitions work on changed computed style value on a single CSS property  
at a time. There is no relationship between the width and height  
transitions as far as the browser is concerned. In order for that to "just  
work", the browser would have to keep track of the computed value  
transition history and know which transitions are related to which.

With the multi-step transitioning you're looking for here, CSS Animations  
is probably what you want. I haven't looked at that in enough detail to  
know how reversal works there.

> Maybe "Automatically reversing transitions" is just a special case? But
> then it is somehow aritical, because if we do not swap properties, but
> changes something back but with 1 pixel difference, it will not use
> automatical reversing transition, and will trigger very different
> transition (especially when using non-linear timing functions, or
> multiple transitions with various delays/durations).

Automatically reversing transitions is a heuristic for a common case, I'd  
say.

-- 
Rune Lillesveen
Layout Group Manager
Core Technology Department
Opera Software ASA

Received on Monday, 2 January 2012 16:55:27 UTC