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

Re: [selectors4] Consider :has() instead of the subject indicator

From: Brian Kardell <bkardell@gmail.com>
Date: Thu, 16 Jan 2014 11:38:22 -0500
Message-ID: <CADC=+jeOfRaANYv0EEdAHaaMeiwPKke48-q_fJFT9Zdd72O8Jg@mail.gmail.com>
To: Simon Sapin <simon.sapin@exyr.org>
Cc: www-style@w3.org
On Jan 16, 2014 11:35 AM, "Simon Sapin" <simon.sapin@exyr.org> wrote:
>
> Hi,
>
> I’d like that we consider removing the subject indicator and adding an
:has() pseudo-class (described below) instead. Reasons include:
>
> * "!" suggests a "boolean negation" meaning that the subject indicator
doesn’t have.
> * :has() already exists in hitchjs and (in limited form) in jQuery.
> * IMO having a name is preferable to assigning arbitrary meaning to ASCII
characters, and worth the verbosity.
> * This resolves the issue of whether to append or prepend the indicator.
> * Assuming :matches() exists, I believe they’re equal in power.
> * The performance concerns are the same.
>
>
> :has()
> ------
>
> :has(), is a functional pseudo-class taking a list of <a>relative
selectors</a> as its argument. It represents an element such that its
argument represents anything with the element as the <a>scoping root</a>.
>
> Example: div:has(p) represents a <div> element that has at least one <p>
descendant element.
>
> Example: div:has(> p) represents a <div> element that has at least one
<p> child element.
>
> :has() is not allowed in the <a>fast profile</a>.
>
> The specificity of :has() is calculated like :matches().
>
>
> --
> Simon Sapin

+so many.. This.
Received on Thursday, 16 January 2014 16:38:51 UTC

This archive was generated by hypermail 2.3.1 : Thursday, 16 January 2014 16:38:52 UTC