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

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

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Saturday, 8 March 2008 00:51:10 UTC