Re: [css-selectors] Invalid selectors should not cause the entire group to be dropped

On 11/15/10 5:02 AM, Peter Beverloo wrote:
> The Selectors (Level 3) module defines[1] that a single invalid selector
> in a group is enough to drop the entire rule. While this was fine
> before, I believe this behavior should be revised: invalid selectors
> should not invalidate the entire selector-group anymore. Instead, they
> could be changed to ":not(*)"

I think the argument in the past has been that if you don't recognize 
the selector, then you don't have a way to tell where it ends and the 
rest of the selector group begins.

That said, I'm not sure that's true; if you can find the end of the 
selector group by looking for '{' that is not inside parens/quotes/etc, 
then you should be able to find the end of the selector by looking for 
',' that is not inside parens/quotes/etc, right?

If there's no actual fundamental problem with this behavior change, then 
I would somewhat support making it.  It would significantly simplify 
authoring and doesn't seem difficult to implement.

The main concern would be regression risk due to sites relying on this 
behavior.  The most common conscious reliance I know of is hiding rules 
from particular UAs by including selectors they don't recognize in the 
rule, or targeting rules to particular UAs by including selectors only 
they recognize (e.g. their vendor-prefixed selectors).  The former is 
already breakage-prone as UAs implement the entirety of Selectors (and 
hopefully fix whatever bugs are being worked around in parallel).  I 
wonder how widespread the latter is....

-Boris

Received on Monday, 15 November 2010 17:28:18 UTC