[selectors4] :empty psuedo class and input fields

Hi all!

This is my first attempt to contribute to the world of standards, so bare
with me. If I'm not doing this the proper way, please tell me. (This is the
second sending of this email, the first sent over 46 hours ago. Might been
messed up due to setting archival permissions on the mailing list.

My issue. I think the :empty pseudo class selector is not super intuitive
when it comes to form elements such as input fields.


Both Selectors 3 and Selectors 4 states the following:

> The :empty pseudo-class represents an element that has no children at
> all. In terms of the document tree, only element nodes and content nodes
> (such as DOM [DOM-LEVEL-3-CORE]<http://www.w3.org/TR/selectors/#DOM-LEVEL-3-CORE> text
> nodes, CDATA nodes, and entity references) whose data has a non-zero length
> must be considered as affecting emptiness; comments, processing
> instructions, and other nodes must not affect whether an element is
> considered empty or not.


This strikes a chord with me, I'd really like to see the possibility to
style input fields that do not fit to be classed as required but are still
empty to be styled differently. Today this has to be done with DOM
scripting, neither input[value=""] or input:empty works as I think it
should work.

input:empty always marks as true, regardless if the value attribute is
empty or not.

input[value=""] only detects initial status and not changes to the element
later on in the page lifetime.

Should one not be able to check the content of the DOM attr value
dynamically through CSS?

Humbly

Stefan Wallin
================================
+46 (0) 709-529 036 || stefan.w@festiz.com
http://www.stefan-wallin.se
http://twitter.com/Stefan_Wallin

Received on Monday, 12 March 2012 14:00:36 UTC