Re: [css3-selectors] Grouping

On Fri, Jan 8, 2010 at 12:05 PM, Brad Kemper <brad.kemper@gmail.com> wrote:
> I really like the idea in general, but I'm not sure about it being a pseudo-class. I'm not against that at this point, mind you, but it is not obvious to me if the following two rules are equivalent:
>
> div :any(span,div)
> div:any(span,div)
>
> or would that second version be nonsense, and simple selectors as arguments could only be used with a universal selector (or naked, implying a universal selector there).

Basic rules of CSS grammar say that they're not equivalent - putting
spaces between simple selectors like in the first example *always*
indicates the descendant combinator.  Authors should be able to pull
this lesson in from the entire rest of CSS, where there is a clear
difference between "input :checked" and "input:checked" (even if they
do make that sort of mistake, it's a very simple and consistent rule
to explain).

The second example isn't nonsense, the :any() just isn't adding
anything to the existing element selector.  The selector will only
match <div>s.

~TJ

Received on Friday, 8 January 2010 18:15:51 UTC