Specificity: nth-of-type versus attribute selector?

img[src*=photo]:nth-of-type(odd)

is selecting every odd image in the document, then checking to see if  
the attribute has the word photo.
Is that correct according to the spec?

I tried many configurations, including img[src*=photos]:nth-of- 
type(odd):not([src*=thumb])

No matter the source order, the first thing the browser selects is  
img:nth-of-type, before checking the attribute.

My assumption is that :nth-of-type, being a pseudo-class, has greater  
specificity than the attribute selector, but then shouldn't the :not  
pseudo have equal weight? I reversed the order, nothing seems to work.

The sandbox is here:

http://www.standardista.com/sandbox/selectors_test.html

Don't see in the specifications what order should take precedence. I  
think this is something that may need to be clarified.

-Estelle
http://www.standardista.com

Received on Sunday, 4 July 2010 07:50:34 UTC