W3C home > Mailing lists > Public > public-webapps@w3.org > July to September 2009

Re: [selectors-api] Scoped Selectors

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Sun, 27 Sep 2009 09:14:38 +0200
Message-ID: <4ABF10DE.60108@lachy.id.au>
To: Boris Zbarsky <bzbarsky@MIT.EDU>
Cc: public-webapps <public-webapps@w3.org>
Boris Zbarsky wrote:
> On 9/26/09 4:36 PM, Lachlan Hunt wrote:
>> A scoped selector string is a string that begins with an exclamation
>> point followed by a the remainder of the selector.
> This assumes that '!' will never be allowed at the beginning of a CSS
> selector, right?

It does, but the workaround would be to insert an extra space at the 

I'd be willing to pick an alternative character to avoid any possible 
clash.  Perhaps a comma instead, like ",div div", which can never be 
used at the beginning of a conforming group of selectors.

I'm also considering adjusting the idea it so that it will work when the 
string simply begins with any combinator ('+', '~', or '>'), but we 
still need something to use in place of the descendant combinator as the 
space won't have the desired effect.

> Have you run this by the CSS working group?

Not yet, but will do so after I find out from this group if the 
technique is viable.

>> e.g. The selector ">em, >strong" supported by JS libraries can simply be
>> prefixed with a "!", like "!>em, >strong" and the implementation will be
>> able to process it to become ":scope>em, :scope>strong". Of course, it
>> will also work with the other combinators.
> That processing still needs to be defined, right?

Yes.  It would be useful to get feedback from implementers about how I 
should define this.

Lachlan Hunt - Opera Software
Received on Sunday, 27 September 2009 07:15:22 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:19 UTC