W3C home > Mailing lists > Public > www-style@w3.org > May 2010

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

From: L. David Baron <dbaron@dbaron.org>
Date: Mon, 10 May 2010 18:40:09 -0700
To: www-style@w3.org
Message-ID: <20100511014009.GA1950@pickering.dbaron.org>
In the new text in
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.


L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Tuesday, 11 May 2010 01:40:38 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:46 UTC