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

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

From: Brad Kemper <brad.kemper@gmail.com>
Date: Tue, 25 Aug 2015 09:22:38 -0700
Cc: Patrick Dark <www-style.at.w3.org@patrick.dark.name>, fantasai <fantasai.lists@inkedblade.net>, www-style list <www-style@w3.org>
Message-Id: <20D5BD00-A01E-4EB8-8762-05571B793675@gmail.com>
To: "Tab Atkins Jr." <jackalmage@gmail.com>


> On Aug 24, 2015, at 2:39 AM, Tab Atkins Jr. <jackalmage@gmail.com> wrote:
> 
> 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.

Agreed. So can we just fix :empty to be more broad, without breaking layouts? Or do we need a separate pseudo class?

>> 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.

Not bad. I agree that it shouldn't select something with an image or other replaced content in it. 
Received on Tuesday, 25 August 2015 16:23:10 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 25 August 2015 16:23:11 UTC