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

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