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

Christoph,

Great points! I would love a dynamic attribute-selector since that also
would solve the specific use case. But unfortunately I still have semantic
issues with what :empty means for elements which cannot have children.



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 7:42 PM, Christoph Päper <
christoph.paeper@crissov.de> 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.
>
> > input:empty always marks as true, regardless if the value attribute is
> empty or not.
>
> Of course, because the element is empty. The attribute doesn’t matter at
> all.
>
> > input[value=""] only detects initial status and not changes to the
> element later on in the page lifetime.
>
> Like I said.
>

Received on Monday, 12 March 2012 20:00:17 UTC