W3C home > Mailing lists > Public > www-style@w3.org > March 2012

Re: [selectors4] :empty psuedo class and input fields

From: Schalk Neethling <sneethling@mozilla.com>
Date: Mon, 12 Mar 2012 10:38:13 -0700 (PDT)
To: Stefan Wallin <Stefan.W@festiz.com>
Cc: www-style@w3.org
Message-ID: <b1fb9c7b-5211-4fe9-a70d-cf3139f7b413@sneethling-05169.local>
Hey Stefan,

I know, I was pointing you more for interest regarding some additional work that is being done in this space. In terms of 

Regards,
Schalk

----- Original Message -----
From: "Stefan Wallin" <Stefan.W@festiz.com>
To: "Schalk Neethling" <sneethling@mozilla.com>
Cc: www-style@w3.org
Sent: Monday, March 12, 2012 5:24:26 PM
Subject: Re: [selectors4] :empty psuedo class and input fields

I'm don't really see how this differ from what Mounir posted. Since to trigger :invalid or :valid you must add the required attribute to the input field, which is not at all the same use case as what I'm trying to solve. Se my earlier message: 


http://lists.w3.org/Archives/Public/www-style/2012Mar/0273.html 

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



On Mon, Mar 12, 2012 at 3:17 PM, Schalk Neethling < sneethling@mozilla.com > wrote: 


Hey there Stefan, 

Maybe have a look at http://html5.org/tools/web-apps-tracker?from=6887&to=6888 

Might not be exactly what you are looking for but useful nonetheless 

Kind Regards, 
Schalk Neethling 



----- Original Message ----- 
From: "Stefan Wallin" < Stefan.W@festiz.com > 
To: www-style@w3.org 
Sent: Sunday, March 11, 2012 1:10:50 AM 
Subject: [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. 


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] 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 17:38:45 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 22 May 2012 03:48:51 GMT