W3C home > Mailing lists > Public > www-style@w3.org > January 2013

Re: Selector Parsing for Selectors API

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Tue, 15 Jan 2013 22:10:44 +0100
Message-ID: <50F5C5D4.3080503@lachy.id.au>
To: Sylvain Galineau <sylvaing@microsoft.com>
CC: "Tab Atkins Jr." <jackalmage@gmail.com>, www-style <www-style@w3.org>
On 2013-01-15 18:02, Sylvain Galineau wrote:
> 
> [Lachlan Hunt:]
>>
>> You need to separate scoped stylesheets from the API.  HTML scoped
>> stylesheets use scope-contained by default. find() uses scope-relative.
>>  matches() uses a variant of scope-relative that isn't yet defined there.
>>
> Do we believe developers will keep these straight in their heads? 
> Note: I'm not trying to be facetious; there seem to be important nuances 
> involved. Has any kind of usability testing been done or is this something 
> to be figured out once implementations get out there?

Yes, I think so.  The API was designed to match JQuery and similar
libraries as closely as possible, so it is already fairly clear that web
developers will understand the API.

>From what I know about the scoped stylesheets, they were redesigned
based on what web developers asked for and to address their complaints
about the way it was originally designed.  The original design for
scoped stylesheets was done under the assumption that selectors should
work effectively the same way as they do ordinary stylesheets, except
for being scope-filtered.

Given that the use cases for scoped stylesheets and the API are also
very different, they ultimately have different requirements that must be
met independently.

As for find() vs. matches(), this is based an on inherent difference
between the two methods.  In the case of find(), the context element is
typically expected to match a selector at the beginning of the chain,
but with matches, the context element is expected to be the subject of
the selector. This, therefore, requires a different handling of implied
:scope.

-- 
Lachlan Hunt
http://lachy.id.au/
http://www.opera.com/
Received on Tuesday, 15 January 2013 21:11:08 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:04 GMT