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

Re: [css3-selectors] Grouping

From: Brad Kemper <brad.kemper@gmail.com>
Date: Fri, 8 Jan 2010 10:40:30 -0800
Cc: Nikita Popov <privat@ni-po.com>, www-style list <www-style@w3.org>
Message-Id: <029ED641-F148-4BD5-AED8-64D415A69E35@gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>

On Jan 8, 2010, at 10:25 AM, Tab Atkins Jr. wrote:

> On Fri, Jan 8, 2010 at 12:19 PM, Nikita Popov <privat@ni-po.com> wrote:
>> I have yet another question about the exact syntax of the pseudo-class:
>> Could I for example use this rule
>> .page form:any(> input, label select)
>> to match all input elements, that are direct descendants of forms or selects
>> what are contained in a label?
>> (At least it would make sense, if allowing the attribute selectors in
>> :any())
> Hmm, that's interesting.  You want a space between the form and :any,
> since this isn't a pseudoclass for the form. (That is, you're not
> trying to match the form.)

See?It's not just me.

> It's still just syntax sugar for ".page form > input, .page form label
> select",

Wouldn't making it a pseudo-class mean that the specificity of the rule might be different (in general; I didn't calculate for this particular example)? If so, that is more than just syntax sugar.

> so I don't see any technical problems with it.  I don't know
> if we want to allow a naked combinator at the front like that, though.
> You could avoid that with:
> .page form :any(form > input, label select) {}

Yeah, unless the "form" part was important (due to an id, for instance):

.page form :any(form#myform > input, form#myform label select) {}

That's back to repeating, so you'd want to be able to do it the other way:

.page form#myform :any(> input, label select)

Received on Friday, 8 January 2010 18:41:05 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:13:42 UTC