Re: 3.2. Determining the Subject of a Selector

On Tue, Dec 15, 2015 at 4:43 AM, Xidorn Quan <quanxunzhen@gmail.com> wrote:
> On Fri, Dec 11, 2015 at 12:31 AM, J C <devscript@hotmail.com> wrote:
>> In the existing proposal, the trailing ! indicator is far superior to a
>> leading syntax, if at least to avoid the "not" connotation and lend more of
>> an "importance" relation.
>>
>>
>> However, consider the ambiguity of this syntax:
>>
>> *! > LI:only-child
>>
>> *! LI:only-child
>
> What you are reading is not the latest spec. Please read the latest
> editor draft at https://drafts.csswg.org/selectors-4/

In particular, we removed the subject indicator in favor of the :has()
pseudoclass, taken from jQuery.  :has() is equivalent in power, but
easier to use for complex cases (and similar for simple cases, just a
bit more typing).

One quick note, tho:

> *! > LI:only-child
>
> *! LI:only-child

These are not ambiguous.  Spaces always separate compound selectors
from each other.  The second one is definitely putting the subject
indicator on the !, not the LI:only-child.

~TJ

Received on Wednesday, 16 December 2015 18:23:52 UTC