W3C home > Mailing lists > Public > www-style@w3.org > December 2009

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

From: Shinichiro Hamaji <hamaji@chromium.org>
Date: Tue, 22 Dec 2009 23:31:34 +0900
Message-ID: <dc751ec00912220631q1bffa083w95ded99d4c897dec@mail.gmail.com>
To: "L. David Baron" <dbaron@dbaron.org>
Cc: www-style@w3.org
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:47:12 GMT