W3C home > Mailing lists > Public > www-style@w3.org > July 2009

Re: Increasing specificity through pseudo-class repetition

From: Daniel Glazman <daniel.glazman@disruptive-innovations.com>
Date: Wed, 15 Jul 2009 12:13:51 +0200
Message-ID: <4A5DABDF.5090508@disruptive-innovations.com>
To: Sylvain Galineau <sylvaing@microsoft.com>
Cc: "www-style@w3.org" <www-style@w3.org>
> Should repeated instances of a pseudo-class be ignored by the parser ?
> Or do they increase the selector's specificity ? (See testcase below).

First, these repeated instances are not invalid or ignored according to
the current spec. If we ignore :first-child:first-child, then we should
also ignore .foo.foo or even the allowed #foo#foo...
After all, JS or c++ allow |if (foo && foo)|, right ?

Second, yes, they increase selector's specificity. Relying on that is
hacky and should be strongly discouraged but I don't think we should
rule out such repeated instances.

My 0.02.

</Daniel>
Received on Wednesday, 15 July 2009 10:14:37 GMT

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