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

Re: [selectors] Is ::pseudo-element:empty valid?

From: Tab Atkins Jr. <jackalmage@gmail.com>
Date: Tue, 25 Nov 2014 12:56:44 -0800
Message-ID: <CAAWBYDAfsYCPzBmA5nrdWReBt5iwp+6uqHUXHJ-90jDvgiNRHQ@mail.gmail.com>
To: Brad Kemper <brad.kemper@gmail.com>
Cc: Dan Beam <dbeam@chromium.org>, "www-style@w3.org" <www-style@w3.org>
On Tue, Nov 25, 2014 at 6:44 AM, Brad Kemper <brad.kemper@gmail.com> wrote:
>> On Nov 24, 2014, at 1:15 PM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
>> :empty either *always* matches ::before pseudos, or isn't applicable
>> to them at all (depending on some unstated additional requirements in
>> the spec that really need to be written down*).  It's not actually
>> useful for anything.
> ::before doesn't exist unless it has content, so your second statement seems more true. Except that an empty string as content does bring it into existence, and that should match :empty, I would think.
> But not generally useful. Once you insert an image into it, it is not empty, even if the image hasn't loaded.

:empty is based on DOM content, which ::before doesn't have any of, so
that's why it's either always true (because ::before has no DOM
contents) or isn't applicable/is always false (because ::before isn't
a DOM element either).

The 'content' property obviously can't have any effect on whether
:empty matches, for circularity reasons, but also because :empty's
definition doesn't mention it.

Received on Tuesday, 25 November 2014 20:57:31 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:48 UTC