Re: 'animation' and 'transition' ambiguity?

On Thursday 2011-01-20 17:52 -0500, Eric A. Meyer wrote:
>    The point is that the value definition of 'transition' doesn't
> conform with the prose, which seems like a serious mistake to me.
> It should be possible to write syntax that doesn't require the text,
> right?  All that's needed is to decide which pattern to support and
> then fix the syntax to match.

There are plenty of cases where the prose expresses additional
restrictions over the syntax in the property's header.

I think expressing this syntax in the property definition would make
it pretty close to unreadable; you'd end up with something like (for
transition, the simpler case):

 ((<'transition-timing-function'> || <'transition-property'>)
  (<'transition-duration'> <'transition-delay'>?)?) |
 (<'transition-duration'>?
  (<'transition-timing-function'> || <'transition-property'>)) |
 (<'transition-duration'>
  (<'transition-timing-function'> || <'transition-property'>)
  <'transition-delay'>) |
 ((<'transition-duration'> <'transition-delay'>?)?
  (<'transition-timing-function'> || <'transition-property'>)) |

If we want the syntax to express this, I'd prefer saying that the ||
syntax, in cases of ambiguity, prefers filling whichever item in
the || is listed first.  This would mean that:
  <'transition-duration'> || <'transition-delay'>
would express the rule we want in this case whereas
  <'transition-delay'> || <'transition-duration'>
would express the opposite.  However, I'd rather not do this, since
the syntax is magical enough (and CSS-specific enough) already.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Thursday, 20 January 2011 23:15:21 UTC