Re: :invalid

On Tue, Sep 28, 2010 at 4:17 AM, Anne van Kesteren <annevk@opera.com> wrote:
> On Mon, 27 Sep 2010 19:38:32 +0200, Jonas Sicking <jonas@sicking.cc> wrote:
>>
>> On Sat, Sep 25, 2010 at 2:19 AM, Anne van Kesteren <annevk@opera.com>
>> wrote:
>>>
>>> You previously stated that it would be up to the user agent to determine
>>> when the pseudo-class would match. I do not think that is a good idea. I
>>> would also like to keep :valid paired with :invalid. Whether we do
>>> :<x>:invalid or :<x>-invalid/:invalid-<x> I do not really care about.
>>
>> It sounds like the difference between what you are proposing, and the
>> :ui-invalid proposal that I'm making, is that your proposing a
>> specified set of rules that :<x> or :<x>-invalid should match, rather
>> than leaving it up to the UA. Is this correct?
>
> Right. I also want to keep :invalid the way it is.
>
>> If so, it sounds good, but I wonder if it will really work in practice
>> unless all UAs agrees to use the same rules for invalid markers and
>> thus all would have use for the :<x>/:<x>-invalid selector.
>
> Until we figure that out it could be a proprietary extension I suppose.

This would mean that almost all the time :invalid is not what you want
to use. For all CSS purposes people will want to use :<x>-invalid.
Basically the only time you'd want to use :invalid is if you want to
use querySelectorAll to find a list of all invalid controls, or
querySelector to find the first invalid control.

I guess there are worse uglynesses in the web. But it brings me back
to a question asked earlier and still hasn't been answered. What is
the use case for the above? And is it really worth sacrificing using
:invalid in CSS for that use case?

/ Jonas

Received on Wednesday, 29 September 2010 00:03:42 UTC