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

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

From: Simon Sapin <simon.sapin@kozea.fr>
Date: Tue, 13 Mar 2012 11:35:27 +0100
Message-ID: <4F5F22EF.6060108@kozea.fr>
To: www-style@w3.org
Le 12/03/2012 20:53, Stefan Wallin a écrit :
> Regarding that CSS is not event based I beg to disagree, I will not go
> through all possible events that are already supported, but :hover and
> :focus both respond to mouse events. Why should keyboard events be any
> different?

Actually, CSS attribute selectors *are* dynamic. If you change the 
attribute (eg. in JavaScript with some_element.setAttribute), this will 
affect CSS attribute selectors.

This thing is, the value of an input form (JS: input_element.value) is 
not propagated to its "value" attribute (JS: 
input_element.getAttribute('value')) and thus does not affect selectors.

So for this use case, what would be needed is a way to test the value of 
a form element (which is not an attribute).

I like [:value] mentioned elsewhere in this thread. It would be a 
"pseudo-attribute" selector and have all the attribute operators like 
~=. Normal attribute names are IDENT tokens so there is no syntax conflict.

How about adding this to Selectors 4?

Simon Sapin
Received on Tuesday, 13 March 2012 10:35:54 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 11 February 2015 12:35:06 UTC