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

On 11/15/10 12:48 PM, Tab Atkins Jr. wrote:
> I suspect that sites rely on exactly that.  Like Boris pointed out,
> using a prefixed selector functions as a rendering-engine selector,
> like:
> foo bar, ::-webkit-foo {
>    /* These rules are only seen by Webkit */
> }
> Careful choice of the ::-webkit-foo (there's plenty of them choose
> from) will ensure that this hack doesn't have any extra effects on the
> page.

You don't really need careful choice, even:

   foo bar, #foo:not(#foo):-vendor-foo {
     /* These rules are only seen by "vendor" */

will make sure that nothing other than "foo bar" in rendering engine 
"vendor" is matched.  Of course there may still be performance effects, 
depending on how selector matching is implemented and depending on which 
:-vendor-foo is used.


Received on Monday, 15 November 2010 18:04:27 UTC