W3C home > Mailing lists > Public > www-style@w3.org > August 2015

Re: [selectors-4] :blank pseudo-class

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Mon, 24 Aug 2015 11:39:32 +0200
Message-ID: <CAAWBYDBcPmzNwcdy354pLaTu87iTmHe_+kPCcAsT8F-n4SrhDQ@mail.gmail.com>
To: Patrick Dark <www-style.at.w3.org@patrick.dark.name>
Cc: Brad Kemper <brad.kemper@gmail.com>, fantasai <fantasai.lists@inkedblade.net>, www-style list <www-style@w3.org>
On Mon, Aug 24, 2015 at 4:29 AM, Patrick Dark
<www-style.at.w3.org@patrick.dark.name> wrote:
> I think I'm leaning toward a conclusion that this pseudo-class is
> unnecessary (which would make naming a moot point). The single use-case
> presented in the spec isn't something that should be encouraged, and your
> replacement hypothesis gives me the impression that the :blank proposal is
> just a less restricted form of :empty meant to accommodate poor code where
> :empty would otherwise work. Or perhaps this pseudo-class proposal is meant
> to standardize the corresponding Mozilla property (mentioned in the spec)
> which itself isn't justified.

There's nothing wrong with this use-case.  We're not encouraging
elements with only whitespace; it's nonsensical to add such elements
to your page just because you can now select them

This is just "a better :empty".  It was a silly mistake of ours that
:empty didn't apply to elements with only whitespace, because it's
very easy to have all your elements print with their start and end
tags on different lines; there's no real difference between
"<foo></foo>" and "<foo>\n</foo>" in HTML, due to whitespace
collapsing, so lots of code has been written that will do the latter.

> If this proposal must go forward despite the above, :no-content seems like a
> decent alternative to :empty-or-white-space since white space is arguably
> not content. The name would make more sense though if the pseudo-class was
> redesigned to exclude replaced elements. It doesn't make a whole lot of
> sense to have a pseudo-class with a name reflecting nothingness or space
> select an element like img, for example, when clearly there is something
> there and there isn't necessarily any white space.

I do kinda like :no-content, of all the shorter names.

~TJ
Received on Monday, 24 August 2015 09:40:21 UTC

This archive was generated by hypermail 2.3.1 : Monday, 24 August 2015 09:40:23 UTC