[css3 animations][css3 transitions] ambiguous or unclear shorthand grammar

Hi,

This comment is about the animation shorthand in the CSS3 animations WD published in
April2012, but it can also apply to CSS3 transitions, since the grammar is similar.

All the animation-* properties allow several values, comma-separated, to refer to
different transitions. Let's say I have

ex { animation-direction: normal, reverse }
ex { animation-duration: 1s, 1s, 1s }
ex { animation-fill-mode: none, forwards }

The shorthand grammar says you can put the individual properties in the order you like, e.g.
ex { animation: normal, reverse 1s, 1s, 1s none, forwards }

But it seems to me that the intent of the spec is that the comma separates each animation,
so the correct thing to write would be:
ex { animation: normal 1s none, reverse 1s forwards, 1s }

Also there's surely an ambiguity since animation-name and animation-fill-mode both
allow "none" as a value. (maybe change one of those 2 names?)

My suggestion is to rewrite the grammar in the same style as background is written:
- rewrite all the animation-xyz properties e.g. for animation-fill-mode:

<animation-fill-mode> =  <anim-fill-mode> [, <anim-fill-mode> ]*

with <anim-fill-mode> = [ none | forwards | backwards | both ]


- describe the shorthand in terms of anim-xyz instead of animation-xyz:

[<anim-name> || <anim-duration> || <anim-timing-function> || <anim-delay> || <anim-iteration-count> || <anim-direction> || <anim-fill-mode>] [, [<anim-name> || <anim-duration> || <anim-timing-function> || <anim-delay> || <anim-iteration-count> || <anim-direction> || <anim-fill-mode>] ]* 


I hope that I've clearly described the issue.

-- 
Carine Bournez -+- W3C Europe

Received on Thursday, 20 September 2012 14:22:35 UTC