Re: CSS Selectors test 146a/b

On Sunday 03 July 2005 23:37, Allan Sandfeld Jensen wrote:
> On Saturday 02 July 2005 16:58, Ian Hickson wrote:
> > On Wed, 29 Jun 2005, Allan Sandfeld Jensen wrote:
> > > I was debugging these tests to figure out why they failed in
> > > Konqueror when I discovered they used :nth-child(3n-1). According
> > > to CSS Selectors the b value cannot be negative, so it should be
> > > corrected to
> > >
> > > :nth-child(3n+2).
> >
> > Why can't b be negative?
>
> Because the syntax is "an+b" with comments on special cases of a=0,
> b=0 and negative a, but no mention of a special case of negative b.
> So if b was negative and the syntax was maintained it would be
> "an+-b".
>
> Besides the negative values of b are redundant, so I expect the
> exclusion of them to be deliberate.

There is definitely something unclear in the Selectors spec.

The spec says explicitly that b can be negative, but it doesn't say that 
the '+' then becomes a '-'. Which would indeed lead to '3n+-1'. (I must 
say that I overlooked negative b and only implemented[1] for b >= 0 
myself...)

I think we intended for '3n-1' to be legal (as the test case indicates), 
but not '3n+-1'.

I don't mind how we fix the spec, allow 'an-b' or not, but I think we 
should make it clear that '3n+-1' is *not* correct.


[1] in xselect, from http://www.w3.org/Status.html#HTML-XML-utils



Bert
-- 
  Bert Bos                                ( W 3 C ) http://www.w3.org/
  http://www.w3.org/people/bos                               W3C/ERCIM
  bert@w3.org                             2004 Rt des Lucioles / BP 93
  +33 (0)4 92 38 76 92            06902 Sophia Antipolis Cedex, France

Received on Tuesday, 5 July 2005 12:10:22 UTC