W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2010

[whatwg] :invalid

From: <whatwg@alanhogan.com>
Date: Fri, 31 Dec 2010 16:15:09 -0500
Message-ID: <3oUgdc-1PYmJZ3hKL-0000bd@infong522.perfora.net>



On Fri, Dec 31, 2010 at 3:28 AM, Mounir Lamouri <mounir.lamouri at gmail.com> wrote:
> On 12/31/2010 02:13 AM, Ian Hickson wrote:
> > On Thu, 23 Sep 2010, Mounir Lamouri wrote:
> >>
> >> The current specification of :invalid is pretty simple: it matches all
> >> invalid elements which are candidate for constraint validation.
> >>
> >> ? Unfortunately, :invalid is far from being perfect and most
> >> UI/UX guys would tell you that the current :invalid behavior is really
> >> bad. For example, having the invalid style applying as soon as you load
> >> the page (ie. for <input required>) is not a good thing. 
> >>

I consider myself a UI/UX guy and I completely agree on this point.

> Since then, we have implemented something you can try with Firefox
> 4.0b8: :-moz-ui-invalid and :-moz-ui-valid. By default, all element
> matching :-moz-ui-invalid have a red box shadow.
>
> The rules for :-moz-ui-invalid are the following:
> a. When not focused (AND list)
> ?1. The element has its default value changed OR the element is in a
> form that the user tried to submit (but was invalid) ;
> ?2. The element is invalid (:invalid applies).
> b. When focused (OR list):
> ?1. If the element had :-moz-ui-invalid before it was focused,
> :-moz-ui-invalid applies if the element is invalid (IOW, if the element
> was valid or no style was applying, the element will not be shown as
> invalid as long as the user do not blur the elemnet) ;
> ?2. Otherwise, :-moz-ui-invalid will not apply as long as the element is
> focused.
>

This sounds fantastic. I will have to play with this beta, but it sounds like exactly what UAs should be doing to let authors easily create a fantastic user experience.

Alan Hogan
Received on Friday, 31 December 2010 13:15:09 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:02 UTC