W3C home > Mailing lists > Public > www-style@w3.org > October 2009

Re: [css3-selectors] LC issues #5

From: fantasai <fantasai.lists@inkedblade.net>
Date: Mon, 12 Oct 2009 17:23:20 -0700
Message-ID: <4AD3C878.7040605@inkedblade.net>
To: www-style@w3.org
Anton Prowse wrote:
> Congratulations on a very solid-looking specification!
> 
> Here are the things that I noticed when reading through the document.
> (Trivial editorial issues are listed separately at the end.)
> 
> ...
> 
> 6.6.5 :nth-child() pseudo-class
> (http://www.w3.org/TR/2009/WD-css3-selectors-20090310/#nth-child-pseudo) :
> 
>   # The :nth-child(an+b) pseudo-class notation represents an element
>   # that has an+b-1 siblings before it in the document tree, for a given
>   # positive integer or zero value of n, and has a parent element.
> 
> Issue 5a:  s/for a given/for some/.  Ditto for the description of the
> other related pseudo-elements.

Replaced with "for any".

>   # In other words, this matches the bth child of an element after all
>   # the children have been split into groups of a elements each.
> 
> Issue 5b:  It matches the bth child *of each group* after the children
> have been partitioned into groups (the last group having possibly fewer
> than 'a' elements).  Also, the sentence makes no sense when either a or
> b is zero or negative.  The sentence is not necessary, will be too long
> when corrected to accurately explain modular arithmetic, and should be
> omitted altogether.  Ditto for the description of the :nth-of-type()
> pseudo-class.

Replaced with
   # For values of <var>a</var> and <var>b</var> greater than zero, this
   # effectively divides the element's children into groups of <var>a</var>
   # elements (the last group taking the remainder), and selecting the
   # <var>b</var>th element of each group.
for :nth-child() and removed from :nth-of-type.

>   #   Examples:
>   #     [...]
>   #     p:nth-child(4n+1) { color: navy; }
>   #     p:nth-child(4n+2) { color: green; }
>   #     p:nth-child(4n+3) { color: maroon; }
>   #     p:nth-child(4n+4) { color: purple; }
> 
> Issue 5c:  It is much more natural to use :nth-child(4n) than
> :nth-child(4n+4) (although you would then want it to be first in the
> list rather than last).  It was probably avoided because the case b=0
> has not yet been discussed so far in the document --- but there is a
> precedent higher up in the example: :nth-child( +6 ).

I think it's written like that to keep the parallel with the other
selectors in that listing. I'm going to leave this as-is. I've also
reordered the examples so that syntax is only used after it has been
explained.

>   # When a=0, the an part need not be included (unless the b part is
>   # already omitted). When an is not included, the + sign before b (when
>   # allowed) may also be omitted.
> 
> Issue 5d:  s/When an is not included, the + sign before b (when allowed)
> may also be omitted/When an is not included and b is non-negative, a +
> sign before b may also be omitted/

Fixed.

> Issue 5e:  There is no discussion in this subsection of the omission of
> the + sign before a, which is curious given that all other possible
> omissions are discussed.

This is because the omission of + before a is covered by plus signs
on positive integers being optional. The + before the b, in the full
syntax, is considered binary operator between an and b, so saying
that an can be dropped is not enough.

>   # In this case the syntax simplifies to :nth-child(b) and the last
>   # example simplifies to :nth-child(5).
> 
> Issue 5f:  The only unsimplified cases which simplifies to :nth-child(5)
> when a is zero and b is non-negative are :nth-child(0n+5) and
> :nth-child(-0n+5), neither of which are the last (or indeed any) example.

Good catch. Removed and changed the next example to use 5 instead of 1.

Please let me know if these changes address your comments.

~fantasai
Received on Tuesday, 13 October 2009 00:23:55 GMT

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