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

[whatwg] Input color state: type mismatch

From: Aryeh Gregor <Simetrical+w3c@gmail.com>
Date: Mon, 29 Mar 2010 15:49:32 -0400
Message-ID: <7c2a12e21003291249j44bf9717q5a38f20434e1345d@mail.gmail.com>
On Sat, Mar 27, 2010 at 9:48 AM, Mounir Lamouri
<mounir.lamouri at gmail.com> wrote:
> It looks like the input color state can't suffer from type mismatch
> according to the specs but it seems to be the only way to be sure the
> value is correct. Email and URL states can suffer from type mismatch for
> the exact same reason.

It isn't possible for color inputs to suffer from a type mismatch,
because the spec says "User agents must not allow the user to set the
value to a string that is not a valid lowercase simple color."  If the
user somehow selects an invalid color, the UA is required to simply
refuse it, or auto-correct it somehow.  This doesn't work well with a
text input, where the user has to type the color incrementally -- I
guess the UA could decide to not update the script-visible/submitted
value until the user no longer focuses the form field, and if the
value isn't valid at that time, it could revert to the previous value.
Received on Monday, 29 March 2010 12:49:32 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:22 UTC