Re: [css3-values] calc()'s <number-multiplicative-expression> incorrect

Hi,

On Thu, Dec 17, 2009 at 6:06 AM, L. David Baron <dbaron@dbaron.org> wrote:
>
> In http://dev.w3.org/csswg/css3-values/#the-calc-function , there is
> currently text:
>
> #  <number-multiplicative-expression> :=
> #     <number-term> |
> #     <length-multiplicative-expression> S* '/' S* <length-term> |
> #     <length-multiplicative-expression> S+ 'mod' S+ <length-term>

I'm not sure, but I guessed the intention of this grammar is that
users can calculate how many ems they can put by calc(100%/1em). This
would explain why there isn't a rule for multiplication here.
However, I can see a sentence that says "Issue: At a later ...
division by length units etc. may be added." in the draft. Sorry if my
uneducated guess is totally wrong.

Anyway, if we will have '/' and mod for numbers, I think we should add
'*', too. Otherwise, the users may complain why they can
calc((2/2)*2px) but cannot calc((2*2)*2px). My personal preference is
supporting both, i.e.,

#  <number-multiplicative-expression> :=
#     <number-term> |
#     <length-multiplicative-expression> S* '/' S* <length-term> |
#     <length-multiplicative-expression> S+ 'mod' S+ <length-term>
#     <number-multiplicative-expression> S* '*' S* <number-term> |
#     <number-multiplicative-expression> S* '/' S* <number-term> |
#     <number-multiplicative-expression> S+ 'mod' S+ <number-term>

Thanks,

Received on Wednesday, 23 December 2009 22:59:14 UTC