Re: [css3-transitions] Spec should mention mismatch in list lengths

On May 15, 2009, at 2:41 PM, L. David Baron wrote:

> The http://dev.w3.org/csswg/css3-transitions/ specification should
> mention what happens when the lists for the different 'transition-*'
> properties have different lengths.
>
> My preferred behavior (which I think is consistent with the
> multiple-backgrounds syntax in css3-background, to which this is
> most similar, with 'transition-property' analogous to
> 'background-image') would be that:
>
> (1) The computed value of each property has the number of values
> specified (which means that unused values in a list inherit, and
> inferred values do not inherit).
>
> (2) When the list for 'transition-duration',
> 'transition-timing-function', or 'transition-delay' is longer than
> the list for 'transition-property', the additional values at the
> end of the list are ignored.
>
> (3) When the list for 'transition-duration',
> 'transition-timing-function', or 'transition-delay' is shorter than
> the list for 'transition-property', the duration, timing function,
> or delay corresponding to each property is the one you would get if
> the list given were repeated enough times so that it were longer.
>
> In other words, the following four pairs of declarations would all
> do the same thing:
>
>  transition-property: color, margin-left, margin-top;
>  transition-duration: 2s, 3s;
>
>  transition-property: color, margin-left, margin-top;
>  transition-duration: 2s, 3s, 2s;
>
>  transition-property: color, margin-left, margin-top;
>  transition-duration: 2s, 3s, 2s, 3s;
>
>  transition-property: color, margin-left, margin-top;
>  transition-duration: 2s, 3s, 2s, 9738s;
>
> (Again, the wording here requires a little bit of care if shorthands
> are allowed on 'transition-property'.)


We follow the CSS rules for the background property, described in CSS3:

     http://www.w3.org/TR/css3-background/#layering

We follow this literally, so your last two examples would actually  
produce 4 transitions, with the 'color' property being duplicated.  
This would reduce back down to 3 transitions because the first 'color'  
property animation would be overridden by the second. So in your last  
example you'd end up with a color transition of 9738 seconds.

I think this is the appropriate way to interpret this rule. Adding  
special cases (as in your rules 2 and 3) just gives authors more  
things to remember.

-----
~Chris
cmarrin@apple.com

Received on Monday, 18 May 2009 18:29:54 UTC