On Monday 2009-07-06 17:36 +1200, Robert O'Callahan wrote:
> Maybe this is a totally crazy idea, but could you compare the
> specificities of the rules setting the property value for the "old
> value" and "new value"? If the specificity decreases, then run the
> transition function in reverse. So if you add a class or pseudo-state,
> do a transition, then remove the class or pseudo-state, the transition
> runs in reverse.
I think I'd like to avoid trying to run transitions in reverse, at
least for now, because that specificity comparison is a good bit of
work, I think. But it might be a good idea in the future. (I think
this is a weakness of the spec, especially given that the default
transition-timing-function is asymmetric.)
One idea I had just now is that we use the following algorithm,
which I think should be pretty simple:
Let O be the old value of the property (including transitions)
Let E be the old value of the property (not including transitions,
i.e., the endpoint of the currently running transition)
Let N be the new value of the property.
Run the transition from O to N. (That's the part we're doing
now.)
However, if abs(O-N) < abs(E-N), reduce the transition-duration by
their ratio. If transition-delay is negative, also reduce the
transition-delay by the same ratio. (Or maybe just reduce
transition-delay unconditionally?)
-David
--
L. David Baron http://dbaron.org/
Mozilla Corporation http://www.mozilla.com/
_______________________________________________
dev-tech-layout mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-tech-layout