W3C home > Mailing lists > Public > www-style@w3.org > June 2012

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

From: Bjoern Hoehrmann <derhoermi@gmx.net>
Date: Thu, 07 Jun 2012 18:50:51 +0200
To: Lea Verou <leaverou@gmail.com>
Cc: www-style list <www-style@w3.org>
Message-ID: <snm1t7tsgm8bqvfmlc4sru63ogbbd5h3n6@hive.bjoern.hoehrmann.de>
* 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
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

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:00 UTC