W3C home > Mailing lists > Public > www-style@w3.org > March 2012

Re: [css3-values] multiplying and dividing complex units in calc?

From: Mike Lawther <mikelawther@chromium.org>
Date: Tue, 13 Mar 2012 10:14:15 +1100
Message-ID: <CAC7btF6pB+-=cg9QS8PzQe8cZ2m-6R-PKZadx_9Fev5jxpe85w@mail.gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>
Cc: Chris Eppstein <chris@eppsteins.net>, www-style@w3.org
On 9 March 2012 06:29, Tab Atkins Jr. <jackalmage@gmail.com> wrote:

> On Thu, Mar 8, 2012 at 11:21 AM, Chris Eppstein <chris@eppsteins.net>
> wrote:
> > On Thu, Mar 8, 2012 at 11:13 AM, Tab Atkins Jr. <jackalmage@gmail.com>
> > wrote:
> >> We don't have this yet; unit algebra means you can run into division by
> >> zero that can't be detected until computed or used value time, so it's
> too
> >> late to treat as a syntax error.
> >
> > Can you provide an example of this?
>
> width: calc(100px / (50% - 100px) )
>
> If layout ends up with 100% = 200px, this will produce a division by zero.


I had thought that you could only divide by a number -
http://www.w3.org/TR/css3-values/#calc currently says "At /, check that
the right side is <number>; resolve to the type of the left side.".
Received on Monday, 12 March 2012 23:15:03 GMT

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