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

Re: Selector Syntax Survey - subject indicator vs :has()

From: Marat Tanalin <mtanalin@yandex.ru>
Date: Wed, 12 Feb 2014 01:14:49 +0400
To: Tab Atkins Jr. <jackalmage@gmail.com>, www-style list <www-style@w3.org>
Message-Id: <182961392153289@web10m.yandex.ru>
12.02.2014, 00:55, "Tab Atkins Jr." <jackalmage@gmail.com>:
> I've just posted the selector syntax survey I was charged with at the
> last f2f: https://docs.google.com/forms/d/1x0eXPBj1GN8Zau-7k9J_JGhoM6uGEqlJBkBBDFswT2w/viewform
> This will help us decide whether to use the subject indicator or the
> :has() pseudoclass. šPlease answer and share this poll!

Looks like a false dichotomy. As far as I understand, the subject selector is not capable of all things that `:has()` is capable of.

If to choose anyway, then, of course, `:has()` is preferred since it allows (at least potentially) to do more complex and useful things like using multiple `:has()` (including nested ones) in the same selector:

    .example:has(nav a:has(> img) + div:has(span))

So we can have multiple `:has()` subselectors while we cannot have multiple subject selectors (and even if we did, that most likely would not be as readable / intuitive / straightforward as `:has()` is).
Received on Tuesday, 11 February 2014 21:15:19 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:39:19 UTC