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

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

From: Bruno de Oliveira Abinader <bruno.d@partner.samsung.com>
Date: Wed, 12 Feb 2014 13:17:34 +0000
To: Pete Boere <pete@the-echoplex.net>
Cc: Daniel Glazman <daniel.glazman@disruptive-innovations.com>, www-style list <www-style@w3.org>
Message-id: <F7498596-394A-4187-82E6-3F7A7512B6A2@partner.samsung.com>
On Feb 12, 2014, at 5:49 AM, Pete Boere <pete@the-echoplex.net> wrote:

> In the comments to the earlier survey, I noticed someone choosing :has() because '!' means negation in programming languages.
> 
> But this does not to apply to CSS for the following reasons:
> 
> 1. With `!important` the exclamation mark already has a meaning in CSS, which is *the opposite* of negation. Like in the regular written word, it indicates emphasis.
> 
> 2. CSS is not a programming language, like SASS (of which voters may be more familiar with).
> 
> So by that reasoning the exclaimation mark is a strong choice, since it indicates emphasis and already has precedence in CSS syntax.

I'd like to share my thoughts on this subject - CSS Selectors tend to behave similarly to regular expressions in some way, and for that I'd say that if we go on using "^E > F"  it could be also seen as "select all E elements except the ones in which F is a child". This is how POSIX regular expressions defines its usage under brackets [1]: "Within brackets, ^ can be used to invert the membership of the character class being specified."

Links:
[1] http://www.gnu.org/software/findutils/manual/html_node/find_html/posix_002dextended-regular-expression-syntax.html

Bruno

Received on Wednesday, 12 February 2014 13:18:05 UTC

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