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

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

From: Stefan Wallin <Stefan.W@festiz.com>
Date: Mon, 12 Mar 2012 20:59:24 +0100
Message-ID: <CA+9vH7AWdwnky7wsXmM9iqojaA0digTPyXvo=NDJba_QZWEwrg@mail.gmail.com>
To: Christoph Päper <christoph.paeper@crissov.de>
Cc: "www-style@w3.org Style" <www-style@w3.org>
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 GMT

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