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

Re: [css21][css3-values] <positive-integer>

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Wed, 09 May 2012 07:22:52 +0200
Message-ID: <4FA9FF2C.9030203@kozea.fr>
To: "Kang-Hao (Kenny) Lu" <kennyluck@csail.mit.edu>
CC: WWW Style <www-style@w3.org>
Le 09/05/2012 01:07, Kang-Hao (Kenny) Lu a écrit :
> (12/05/09 3:56), Simon Sapin wrote:
>> >  Whether or not it appears in the "Value:" line for properties, I think
>> >  that "positive" and such constraints should be defined in terms of
>> >  numerical comparison, not in character-based grammar.
> Why?<integer>  is already a syntactical constraint (i.e. 'z-index: 1.0'
> isn't valid, albeit 1.0 == 1). The questionable parts are
>
> 1. is '-0' non-negative?
>
> [snip other issues with numerical comparison]


Ok, I understand the issues. Numerical comparison is especially bad for 
non-zero values that are rounded to zero because of machine precision.

So if the constraint is syntactical, css3-syntax is the place to have 
it. The "new" state-machine-based css3-syntax already has an "integer" 
flag on numerical tokens. Adding "positive" and "zero" flags should be 
enough to define <positive-integer> and other variants.

Can V&U3 depend on Syntax3, or will the later not be ready in time?

-- 
Simon Sapin
Received on Wednesday, 9 May 2012 05:23:23 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:53 GMT