Re: [css3-values] calc() constraints too strong for * and /

What about (5px / 3em) / 5ms being used to represent a frequency?

~6 out of 5 statisticians say that the number of statistics that either make
no sense or use ridiculous timescales at all has dropped over 164% in the
last 5.62474396842 years.

On Mon, May 10, 2010 at 6:40 PM, L. David Baron <dbaron@dbaron.org> wrote:

> In the new text in
> http://dev.w3.org/csswg/css3-values/#the-calc-min-and-max-functions
> describing calc(), I think these constraints:
>  > 2. At "*":
>  > check: at least one side is "number"
>  > return: the type of the other side
>  > 3. At "/":
>  > check: either right side is "number," or both have the same type
>  > return: if the former, type of left side; otherwise "number"
> are too strong.  And, additionally, since the new definition of the
> binary operators is nonrecursive, they're also ambiguous.
>
> In particular, I think it's bad that they make:
>  2em * (2em / 3em)
> legal while the mathematically equivalent:
>  (2em * 2em) / 3em
> is illegal and it's unclear whether:
>  2em * 2em / 3em
> is legal or not.  I think these should be handled consistently.
>
>
> That said, in my implementation in Gecko I'm not implementing
> division by values at this time.
>
> -David
>
> --
> L. David Baron                                 http://dbaron.org/
> Mozilla Corporation                       http://www.mozilla.com/
>
>

Received on Tuesday, 11 May 2010 02:01:08 UTC