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

(12/03/13 2:42), Christoph Päper wrote:
> Stefan Wallin:
>>
>> My issue. I think the :empty pseudo class selector is not super 
>> intuitive when it comes to form elements such as input fields.
> 
> Your issue, actually, is not with the ‘:empty’ pseudo-class. You 
> want a dynamic selector for the value (attribute). David Baron 
> suggested a pseudo-attribute, ‘[:value]’, for this
> <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-October/016544.html>. 
> The CSS WG wiki <http://wiki.csswg.org/spec/selectors4> currently lists 
> the ‘::value’ pseudo-element from the UI module 
> <http://dev.w3.org/csswg/css3-ui/#pseudo-value> as an alternative, but
> that’s wrong I think, because you cannot do attribute value comparison 
> (‘=’, ‘^=’, ‘$=’, ‘*=’ …) with that.

The wiki has

[[
dynamic values selector -
already handled by ::value pseudo-element in CSS3-UI.
]]

. I am not quite sure what it means. '::value:empty' maybe? Would
'input::value:empty' be too long to be useful? I'll note that selectors4
has this paragraph:

  # Syntactically, a pseudo-element may be followed by any combination
  # of the user action pseudo-classes. Whether these pseudo-classes can
  # match on the pseudo-element depends on the pseudo-class and
  # pseudo-element's definition: unless otherwise-specified, none of
  # these pseudo-classes will match on the pseudo-element.

so I guess we might be able to say :empty applies to ::value. Maybe.


Cheers,
Kenny

Received on Monday, 12 March 2012 23:18:46 UTC