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

Re: [selectors-api] Summary of Feature Requests for v2

From: Jonas Sicking <jonas@sicking.cc>
Date: Wed, 23 Sep 2009 23:36:21 -0700
Message-ID: <63df84f0909232336v5edf4f5bpa314a57ffb35013b@mail.gmail.com>
To: Maciej Stachowiak <mjs@apple.com>
Cc: Lachlan Hunt <lachlan.hunt@lachy.id.au>, public-webapps <public-webapps@w3.org>, John Resig <jresig@mozilla.com>, "L. David Baron" <dbaron@mozilla.com>
On Wed, Sep 23, 2009 at 9:57 PM, Maciej Stachowiak <mjs@apple.com> wrote:
>
> On Sep 23, 2009, at 5:26 PM, Jonas Sicking wrote:
>
>> On Wed, Sep 23, 2009 at 4:51 AM, Lachlan Hunt <lachlan.hunt@lachy.id.au>
>> wrote:
>>>
>>> *Scoped Queries*
>>> http://www.w3.org/Bugs/Public/show_bug.cgi?id=5860
>>>
>>> This has been discussed extensively in the past.  Basically, the idea is
>>> that the selector would be evaluated in the scope of the element, in a
>>> way
>>> more compatible with how libraries like JQuery work.  This slightly
>>> different from the :scope pseudo-class proposal, see bug for details.
>>
>> Note that what makes the ">strong, >em" selector (which apparently
>> some libraries support) hard to support spec-wise is that that is not
>> in fact valid CSS syntax. It's certainly possible to define behavior
>> for it, it's pretty clear to me how it's intended to work, but it
>> would mean specifying our own syntax.
>>
>> However if supporting commaseparated queries is critical for libraries
>> then I see no other choise. We'll one way or another have to specify
>> our own syntax, though it can be heavily based on the productions in
>> the Selector spec.
>
> I think we can define an algorithm for turning an implicitly scoped
> pseudo-selector like ">strong, >em" into a proper selector using :scope --
> in this case ":scope>strong, :scope>em". We could either have an API entry
> point that takes a scoped pseudo-selector, defined as transforming to a real
> selector plus establishing a scope node, or just present the algorithm as an
> option for libraries that want to expose pseudo-selector syntax.

Indeed, it's certainly possible. I'd like to find out if we can get
away with not doing that though. I'm curious to get feedback on how
far just having a :scope pseudo-class gets us.

/ Jonas
Received on Thursday, 24 September 2009 06:37:21 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:33 GMT