Re: [css3-animations] animate display, other non-animatable properties

On Wed, Aug 1, 2012 at 12:23 AM, Tab Atkins Jr. <jackalmage@gmail.com>wrote:

> On Wed, Aug 1, 2012 at 12:14 AM, François REMY
> <fremycompany_pub@yahoo.fr> wrote:
> > Oh dear, I just noticed you can’t use the 'display' property at all in
> > animations; I was really thinking you could and that just the
> interpolation
> > process was going to be ignored.
> >
> > Therefore, I propose to support ‘animations’ on *any property*; the
> behavior
> > of an animation of an non-animatable property would be to switch the used
> > value as soon as the halfway to the next keyframe is reached (i.e. the
> > initial value would be mapped to -1, the final one to +1; the used value
> > would be the initial one for strictly negative numbers, and the final one
> > for positive numbers (0 included)).
> >
> > This is (strangely) not what has been done for 'visibility' but I feel
> this
> > is what most authors will expect for other properties; we could probably
> > extend the definition used for 'visibility' to 'display' from and to
> 'none'
> > because it can make sense for those properties to keep the element
> visible
> > as long as possible. Also, if a way to animate the property is added
> later
> > one, the behavior will probably match more closely the change halfway
> than a
> > change when the next frame is reached only.
> >
> > This is a breaking change from the current implementations, whose some
> > already shipped unprefixed, but this should not be a problem because
> current
> > browser properly ignore those declarations, just like they ignore unknown
> > properties.
>
> The fact that they currently ignore them actually means that we
> probably can't change our behavior - people may have left properties
> in their animations and are now accidentally depending on them not
> working.
>
> However, the use-case is very valid.  I think we should be able to
> solve this with a new timing function that works for all properties
> (and define that the others only work for "animatable" values) -
> discrete(<percentage>).  The percentage indicates at what point in the
> time it should flip from the start value to the end value.
>

It would be terrific if we could make this happen.

A side issue is that animation are specified to not run if they have
'display:none'. So, as soon at the rule switches the display property, the
animation would stop running which is not what the author intended.
I have no idea how difficult it would be to implement this...

Received on Wednesday, 1 August 2012 19:36:53 UTC