RESOLVED FIXED 83533
html5test.com: input type=color - Field validation fails
https://bugs.webkit.org/show_bug.cgi?id=83533
Summary html5test.com: input type=color - Field validation fails
Kent Tamura
Reported 2012-04-09 18:38:00 PDT
It fails with Google Chrome 20.0.1096.1 OSX and Windows. I don't know why it fails. We need to investigate what is tested.
Attachments
Keishi Hattori
Comment 1 2012-04-09 19:06:44 PDT
Hmm. Opera 11(Mac) failed too. It seems to be testing element.validity.valid //engine.js validation = true; element.field.value = "foo"; validation &= !element.field.validity.valid element.field.value = '#000000'; validation &= element.field.validity.valid
Kent Tamura
Comment 2 2012-04-09 19:14:36 PDT
(In reply to comment #1) > validation = true; > > element.field.value = "foo"; > validation &= !element.field.validity.valid > > element.field.value = '#000000'; > validation &= element.field.validity.valid Does the 'element' have the required attribute?
Keishi Hattori
Comment 3 2012-04-09 19:17:57 PDT
(In reply to comment #2) > Does the 'element' have the required attribute? No. Here is the whole section /* input type=color */ var group = this.section.getGroup({ id: 'color' }); var element = this.createInput('color'); element.field.value = "foobar"; var sanitization = element.field.value != 'foobar'; var validation = false; if ('validity' in element.field) { validation = true; element.field.value = "foo"; validation &= !element.field.validity.valid element.field.value = '#000000'; validation &= element.field.validity.valid } group.setItem({ id: 'element', passed: element.field.type == 'color', value: 2 }); group.setItem({ id: 'ui', passed: baseline.field != getRenderedStyle(element.field) || baseline.wrapper != getRenderedStyle(element.wrapper), value: 2 }); group.setItem({ id: 'sanitization', passed: sanitization, required: true }); group.setItem({ id: 'validation', passed: validation, required: true }); this.removeInput(element);
Keishi Hattori
Comment 4 2012-04-09 19:18:36 PDT
createInput: function(type) { var wrapper = document.createElement('div'); document.body.appendChild(wrapper) var field = document.createElement('input'); wrapper.appendChild(field); try { field.setAttribute('type', type); } catch(e) { } /* Make sure our field is position absolutely for CSS style comparison */ wrapper.style.position = 'absolute'; wrapper.style.display = 'inline-block'; wrapper.style.top = '0px'; wrapper.style.left = '0px'; return { field: field, wrapper: wrapper }; },
Kent Tamura
Comment 5 2012-04-09 19:19:30 PDT
Oh, I remember the color type doesn't support the required attribute, and "foo" should be sanitized to "#000000". It seems the test is incorrect.
Kent Tamura
Comment 6 2012-04-09 20:01:16 PDT
I'll contact the author of html5test.com.
Kent Tamura
Comment 7 2012-04-09 20:41:09 PDT
Kent Tamura
Comment 8 2012-07-09 18:23:46 PDT
Will be fixed in the next release of html5test; http://alpha.html5test.com/
Note You need to log in before you can comment on or make changes to this bug.