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

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?

Regards,
-- 
Simon Sapin

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