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

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

From: Allan Sandfeld Jensen <kde@carewolf.com>
Date: Sat, 8 Mar 2008 15:35:48 +0100
To: www-style@w3.org
Message-Id: <200803081535.48598.kde@carewolf.com>

On Saturday 08 March 2008, 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)).
>
Konqueror will need a base XML mimetype like application/xml or text/xml to 
trigger the XML parser.  We use the HTML parser for XHTML just like MSIE 
which seems a lot safer.

`Allan
Received on Saturday, 8 March 2008 14:36:00 GMT

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