Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Fix "input type=color - Field validation" test. #131

Closed
wants to merge 1 commit into from

4 participants

Kent Tamura Peter Beverloo Mike Taylor Niels Leenheer
Kent Tamura

A color type field never be invalid because any invalid values are sanitized to
a valid value "#000000".

Opera and WebKit will pass this test.
https://bugs.webkit.org/show_bug.cgi?id=83533

Kent Tamura Fix "input type=color - Field validation" test.
A color type field never be invalid because any invalid values are sanitized to
a valid value "#000000".
d62a699
Peter Beverloo

Section of the specification which describes this behavior:
http://www.whatwg.org/specs/web-apps/current-work/multipage/states-of-the-type-attribute.html#color-state-(type=color)

Will element.field.value reflect the internal change to "#000000"? If so, it's probably good practice to verify whether it's actually being changed to that when invalid values are being set.

Kent Tamura

Will element.field.value reflect the internal change to "#000000"?

Yes. But I don't think we should verify the resultant value because the previous test "Value sanitization" should be responsible for it.

Mike Taylor

+1 for @int32t's change. As is, this test doesn't make much sense.

Niels Leenheer

Going to remove the validation test completely in the next version (current at alpha.html5test.com)

Kent Tamura

Going to remove the validation test completely in the next version (current at alpha.html5test.com)

Ok, it makes sense.

Kent Tamura int32t closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Apr 10, 2012
  1. Fix "input type=color - Field validation" test.

    Kent Tamura authored
    A color type field never be invalid because any invalid values are sanitized to
    a valid value "#000000".
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 1 deletion.
  1. +2 −1  index.html
3  index.html
View
@@ -2022,7 +2022,8 @@
validation = true;
element.field.value = "foo";
- validation &= !element.field.validity.valid
+ // "foo" is sanitized to "#000000", which is valid.
+ validation &= element.field.validity.valid
element.field.value = '#000000';
validation &= element.field.validity.valid
Something went wrong with that request. Please try again.