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

[selectors4] feedback

From: G. A. Light U1365222 <U1365222@unimail.hud.ac.uk>
Date: Mon, 29 Aug 2016 13:47:57 +0000
Message-ID: <AM4PR0101MB16026429FC18E400340F470E8CE10@AM4PR0101MB1602.eurprd01.prod.exchangelabs.com>
To: www-style@w3.org, www-style@w3.org
Hello w3.

I believe that it would be beneficial for a selector similar to :blank & :empty to be added...

This selector would include elements with content that are not visible (for example through display:none)

It is worth noting that this could be used to style the parent of an element - without any concerns over abuse;

<ul>
<li><a href="bad link">invalid</a></li>
<li><a href="./valid.html">valid</a></li>
</ul>

With the following styles:

a[href="bad link"] { display:none; }
li:nodisplay { display:none; }

Where :nodisplay is a temporary name simply to illustrate it.

In this case the link would be set to display:none and subsequently as there are no more visible elements in its parent element, the parent would also be hidden.

The performance in this case should be minimally affected as whenever a single child is found to have visible content, it returns false.

>From Gareth Light.
Received on Wednesday, 31 August 2016 13:49:21 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 31 August 2016 13:49:21 UTC