Re: CSS Selectors test 146a/b

On 7/5/05 5:10 AM, "Bert Bos" <bert@w3.org> wrote:

> 
> 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'.

That's probably my fault.  I think I last edited that section.


> (I must 
> say that I overlooked negative b and only implemented[1] for b >= 0
> myself...)

I implemented both an+b and an-b in Tasman v0.9 which shipped a while ago in
MSN/MacOSX client, and later in Tasman 1.0 in Office2004/MacOSX.


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

Yes.  And that's what I implemented too.


> 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.

Yes.  Perhaps something to add to the test suite?

Thanks,

Tantek

Received on Wednesday, 6 July 2005 20:19:49 UTC