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

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

From: Lea Verou <leaverou@gmail.com>
Date: Thu, 07 Jun 2012 18:35:13 +0200
Message-ID: <4FD0D841.4080107@gmail.com>
To: www-style list <www-style@w3.org>
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, but thought I'd 
ask just in case I'm misunderstanding the spec in some way. If not, it 
might be a good idea to make it more clear in css4-selectors since, 
apparently, implementors are confused too.

[1]: https://github.com/LeaVerou/css3test/issues/22
[2]: https://twitter.com/keithclarkcouk/status/210765428753039360
[3]: http://css3test.com/#css3-selectors
[4]: http://www.w3.org/TR/css3-selectors/#nth-child-pseudo

-- 
Lea Verou (http://lea.verou.me | @LeaVerou)
Received on Thursday, 7 June 2012 16:35:47 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:55 GMT