Re: QSA, the problem with ":scope", and naming

On Wed, Oct 19, 2011 at 4:39 AM, Ojan Vafai <ojan@chromium.org> wrote:
> Overall, I wholeheartedly support the proposal.
> I don't really see the benefit of allowing starting with a combinator. I
> think it's a rare case that you actually care about the scope element and in
> those cases, using :scope is fine. Instead of element.findAll("> div >
> .thinger"), you use element.findAll(":scope > div > .thinger"). That said, I
> don't object to considering the :scope implied if the selector starts with a
> combinator.

Right, I think the argument for allowing a combinator start is two-fold:

1.) the libraries allow it, so should DOM
2.) we know the thing on the left, it's the implicit scope. Shorter is
better, so allowing the implicitness here is a win on that basis

I have a mild preference for argument #2. Shorter, without loss of
clarity, for common stuff should nearly always win.

> On Tue, Oct 18, 2011 at 6:15 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:
>>
>> On 10/18/11 7:38 PM, Alex Russell wrote:
>>>
>>> The resolution I think is most natural is to split on ","
>>
>> That fails with :any, with the expanded :not syntax, on attr selectors,
>> etc.
>>
>> You can split on ',' while observing proper paren and quote nesting, but
>> that can get pretty complicated.
>
> Can we define it as a sequence of selectors and be done with it? That way it
> can be defined as using the same parsing as CSS.
>
>>>
>>> A minor point is how to order the
>>> items in the returned flattened list are ordered (document order? the
>>> natural result of concat()?).
>>
>> Document order.
>
> Definitely.
>>
>> -Boris
>>
>>
>
>

Received on Wednesday, 19 October 2011 08:25:56 UTC