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

Re: [css3-selectors] How do *-of-type selectors define the type?

From: fantasai <fantasai.lists@inkedblade.net>
Date: Thu, 16 Oct 2008 04:49:12 -0700
Message-ID: <48F72A38.1030507@inkedblade.net>
To: www-style@w3.org

L. David Baron wrote:
> After reading the text:
>   # The :nth-of-type(an+b) pseudo-class notation represents an
>   # element that has an+b-1 siblings with the same element name
>   # before it in the document tree,
> in http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#nth-of-type-pseudo
> it is not clear to me what "the same element name" means.
> 
> http://www.w3.org/TR/2006/REC-xml-names-20060816/#concepts defines
> three types of names.  Given the element:
>   <html:p xmlns:html="http://www.w3.org/1999/xhtml" />
> these names are:
>   expanded name:  the pair of strings ("http://www.w3.org/1999/xhtml", "p")
>   local name:     the string "p"
>   qualified name: the string "html:p"
> 
> css3-selectors should define which of these three names are referred
> to by the definitions of :nth-of-type() and :nth-last-of-type() (and
> thus, by reference, :first-of-type, :last-of-type, and
> :only-of-type).
> 
> I strongly prefer that it is the expanded name that matches.
> 
> I wrote a testcase at
> http://dbaron.org/css/test/2008/of-type-selectors .  The only
> implementation I could find that produced sensible results (Opera
> 9.5 beta) uses the expanded name (but doesn't support xmlns="").
> Konqueror 3.5.9 seems to parse the testcase as HTML instead of
> XHTML, and Safari 3.0.4 fails the control test and matches item (2)
> (along with (1), (4), and (5)).

Fixed by using the term "expanded name" instead of "name".

~fantasai
Received on Thursday, 16 October 2008 11:49:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:15 GMT