Skip to content
This repository

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

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
int32t commented June 24, 2012

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
Owner

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

Kent Tamura
int32t commented July 09, 2012

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 July 09, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Apr 10, 2012
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
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 2 additions and 1 deletion. Show diff stats Hide diff stats

  1. 3  index.html
3  index.html
@@ -2022,7 +2022,8 @@
2022 2022
 						validation = true;
2023 2023
 						
2024 2024
 						element.field.value = "foo";
2025  
-						validation &= !element.field.validity.valid
  2025
+						// "foo" is sanitized to "#000000", which is valid.
  2026
+						validation &= element.field.validity.valid
2026 2027
 	
2027 2028
 						element.field.value = '#000000';
2028 2029
 						validation &= element.field.validity.valid
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.