Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
wants to merge 1 commit into from

5 participants

@int32t

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

@tkent-google tkent-google 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
@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.

@int32t

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.

@miketaylr

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

@NielsLeenheer

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

@int32t

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

Ok, it makes sense.

@int32t 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. @tkent-google

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

    tkent-google 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
View
3  index.html
@@ -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.