<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>83533</bug_id>
          
          <creation_ts>2012-04-09 18:38:00 -0700</creation_ts>
          <short_desc>html5test.com: input type=color - Field validation fails</short_desc>
          <delta_ts>2012-07-09 18:23:46 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Forms</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc>http://html5test.com/index.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>40829</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Kent Tamura">tkent</reporter>
          <assigned_to name="Kent Tamura">tkent</assigned_to>
          <cc>syoichi</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>598845</commentid>
    <comment_count>0</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-04-09 18:38:00 -0700</bug_when>
    <thetext>It fails with Google Chrome 20.0.1096.1 OSX and Windows.
I don&apos;t know why it fails.  We need to investigate what is tested.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598883</commentid>
    <comment_count>1</comment_count>
    <who name="Keishi Hattori">keishi</who>
    <bug_when>2012-04-09 19:06:44 -0700</bug_when>
    <thetext>Hmm. Opera 11(Mac) failed too.

It seems to be testing element.validity.valid

//engine.js

validation = true;
				
element.field.value = &quot;foo&quot;;
validation &amp;= !element.field.validity.valid

element.field.value = &apos;#000000&apos;;
validation &amp;= element.field.validity.valid</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598894</commentid>
    <comment_count>2</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-04-09 19:14:36 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; validation = true;
&gt; 
&gt; element.field.value = &quot;foo&quot;;
&gt; validation &amp;= !element.field.validity.valid
&gt; 
&gt; element.field.value = &apos;#000000&apos;;
&gt; validation &amp;= element.field.validity.valid

Does the &apos;element&apos; have the required attribute?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598899</commentid>
    <comment_count>3</comment_count>
    <who name="Keishi Hattori">keishi</who>
    <bug_when>2012-04-09 19:17:57 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; Does the &apos;element&apos; have the required attribute?

No. Here is the whole section

/* input type=color */
			
var group = this.section.getGroup({
  id:		&apos;color&apos;
});
			
var element = this.createInput(&apos;color&apos;);
									
element.field.value = &quot;foobar&quot;;					
var sanitization = element.field.value != &apos;foobar&apos;;

var validation = false;
if (&apos;validity&apos; in element.field) {
  validation = true;
				
  element.field.value = &quot;foo&quot;;
  validation &amp;= !element.field.validity.valid

  element.field.value = &apos;#000000&apos;;
  validation &amp;= element.field.validity.valid
}
			
group.setItem({
  id:			&apos;element&apos;,
  passed:		element.field.type == &apos;color&apos;,
  value: 		2
});
			
group.setItem({
  id:			&apos;ui&apos;,
  passed:		baseline.field != getRenderedStyle(element.field) || baseline.wrapper != getRenderedStyle(element.wrapper),
  value: 		2
});
				
group.setItem({
  id:			&apos;sanitization&apos;,
  passed:		sanitization,
  required:	true
});
				
group.setItem({
  id:			&apos;validation&apos;,
  passed:		validation,
  required:	true
});

this.removeInput(element);</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598900</commentid>
    <comment_count>4</comment_count>
    <who name="Keishi Hattori">keishi</who>
    <bug_when>2012-04-09 19:18:36 -0700</bug_when>
    <thetext>		createInput: function(type) {
			var wrapper = document.createElement(&apos;div&apos;);
			document.body.appendChild(wrapper)

			var field = document.createElement(&apos;input&apos;);
			wrapper.appendChild(field);
			
			try {
				field.setAttribute(&apos;type&apos;, type);
			} catch(e) {
			}
			
			/* Make sure our field is position absolutely for CSS style comparison */
			wrapper.style.position = &apos;absolute&apos;;
			wrapper.style.display = &apos;inline-block&apos;;
			wrapper.style.top = &apos;0px&apos;;
			wrapper.style.left = &apos;0px&apos;;
			
			return { field: field, wrapper: wrapper };
		},</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598901</commentid>
    <comment_count>5</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-04-09 19:19:30 -0700</bug_when>
    <thetext>Oh, I remember the color type doesn&apos;t support the required attribute, and &quot;foo&quot; should be sanitized to &quot;#000000&quot;.  It seems the test is incorrect.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598934</commentid>
    <comment_count>6</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-04-09 20:01:16 -0700</bug_when>
    <thetext>I&apos;ll contact the author of html5test.com.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>598955</commentid>
    <comment_count>7</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-04-09 20:41:09 -0700</bug_when>
    <thetext>I made a pull request: https://github.com/NielsLeenheer/html5test/pull/131</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>665378</commentid>
    <comment_count>8</comment_count>
    <who name="Kent Tamura">tkent</who>
    <bug_when>2012-07-09 18:23:46 -0700</bug_when>
    <thetext>Will be fixed in the next release of html5test; http://alpha.html5test.com/</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>