Re: [css3-selectors] Valid syntax that never represents an element

* Lea Verou wrote:
>I recently got into two separate unrelated discussions [1] [2] about 
>whether the failing (in WebKit) :nth-*(-n-1) tests in css3test.com [3] 
>should be removed, as these selectors would never match any element so 
>it's supposedly OK if browsers consider it invalid syntax. Apparently 
>the confusion arose from this excerpt from css3-selectors [4]: " The 
>value a can be negative, but only the positive values of an+b, for n?0, 
>may represent an element in the document tree.". I think it's quite 
>obvious that throwing an error on such cases is non-conforming, since 
>the syntax is perfectly valid according to the grammar, [...]

That is correct, there are many ways to write selectors that do not
match anything, and for :not for instance the specification notes as
much, as a reminder that matching no elements does not make selectors
invalid.
-- 
Björn Höhrmann · mailto:bjoern@hoehrmann.de · http://bjoern.hoehrmann.de
Am Badedeich 7 · Telefon: +49(0)160/4415681 · http://www.bjoernsworld.de
25899 Dagebüll · PGP Pub. KeyID: 0xA4357E78 · http://www.websitedev.de/ 

Received on Thursday, 7 June 2012 16:51:20 UTC