W3C home > Mailing lists > Public > www-style@w3.org > April 2013

Re: [css-syntax] Scientific notation: not on dimension and percentage?

From: Zack Weinberg <zackw@panix.com>
Date: Sun, 7 Apr 2013 08:56:49 -0400
Message-ID: <CAKCAbMjmYhAFij_R+CQTKDEK=M17Dg6qbZ6g=i4Bo8JuPy19rw@mail.gmail.com>
To: "www-style@w3.org" <www-style@w3.org>
On Sun, Apr 7, 2013 at 5:50 AM, Simon Sapin <simon.sapin@exyr.org> wrote:
> Syntax 3 adds scientific notation on number tokens. IIRC this is for
> compatibility with SVG, but it was mentioned on this list that SVG also
> allow scientific notation on percentages and dimension tokens. Should CSS do
> that too?

For reference, here are the relevant bits of SVG 1.1:

http://www.w3.org/TR/SVG/types.html#DataTypeNumber
http://www.w3.org/TR/SVG/types.html#DataTypePercentage
http://www.w3.org/TR/SVG/types.html#DataTypeLength

<number> always allows scientific notation (ignoring the attempt at
compatibility with CSS2.1's <number> in pseudo-CSS contexts, which is
the very thing we are changing here), and <percentage> and <length>
are defined in terms of <number>.  So for instance

<circle cx="1e3in" cy="1e3in" r="1e2in"/>

is, IIUC, a valid SVG fragment.

I support, but am not wedded to, the notion of adding scientific
notation to CSS <number>; but I definitely think that if we do it, we
should match SVG, if only because that will allow me to remove a
special case from Gecko's tokenizer.  As is, the scope of the special
case is narrowed but it's still there.

zw
Received on Sunday, 7 April 2013 12:57:16 UTC

This archive was generated by hypermail 2.3.1 : Sunday, 7 April 2013 12:57:17 UTC