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

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>15910</bug_id>
          
          <creation_ts>2012-02-06 12:17:35 +0000</creation_ts>
          <short_desc>Broken check for type attribute on button element</short_desc>
          <delta_ts>2015-08-23 07:07:05 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML Checker</product>
          <component>General</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>11557</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="William Hatever">julien.cayzac</reporter>
          <assigned_to name="Michael[tm] Smith">mike+validator</assigned_to>
          <cc>mike</cc>
          
          <qa_contact name="qa-dev tracking">www-validator-cvs</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>63733</commentid>
    <comment_count>0</comment_count>
    <who name="William Hatever">julien.cayzac</who>
    <bug_when>2012-02-06 12:17:35 +0000</bug_when>
    <thetext>The following HTML5 fragment fails to validate with a &quot;Bad value submit for attribute type on element button&quot; error message, whereas said value is perfectly valid according to HTML5 specs:

&lt;form id=&quot;action1&quot; action=&quot;/&quot;&gt;&lt;/form&gt;
&lt;button form=&quot;action1&quot; type=&quot;submit&quot;&gt;Submit&lt;/button&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63735</commentid>
    <comment_count>1</comment_count>
    <who name="William Hatever">julien.cayzac</who>
    <bug_when>2012-02-06 12:19:18 +0000</bug_when>
    <thetext>Link to current spec: http://dev.w3.org/html5/spec-author-view/the-button-element.html#attr-button-type-submit</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63736</commentid>
    <comment_count>2</comment_count>
    <who name="William Hatever">julien.cayzac</who>
    <bug_when>2012-02-06 12:20:39 +0000</bug_when>
    <thetext>Also when omitting the type attribute (which should default to type=&quot;submit&quot; anyway, according to the aforementioned document) the validator complains a required attribute is missing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63740</commentid>
    <comment_count>3</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2012-02-06 13:57:48 +0000</bug_when>
    <thetext>I can&apos;t reproduce this with the markup fragment you provided.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63888</commentid>
    <comment_count>4</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2012-02-08 12:53:53 +0000</bug_when>
    <thetext>Julien,

If you can please re-check your doc at http://validator.w3.org/nu/ I&apos;d appreciate it.

Over the last 10 days or so I had been making some changes to the the validator HTML5 backend, and that might have left things in an unstable state that caused the problem you reported. But I now have things synced up and stable, so I think you should not see this problem again. But please let me know if you can still reproduce it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63890</commentid>
    <comment_count>5</comment_count>
    <who name="William Hatever">julien.cayzac</who>
    <bug_when>2012-02-08 13:01:51 +0000</bug_when>
    <thetext>So it appears that by over-simplifying the fragment I removed the bug :)

This works fine:

&lt;form id=&quot;action1&quot; action=&quot;/&quot;&gt;&lt;/form&gt;
&lt;button form=&quot;action1&quot; type=&quot;submit&quot;&gt;Submit&lt;/button&gt;

But this triggers the error, even on http://validator.w3.org/nu/ tonight:

&lt;form id=&quot;action1&quot; action=&quot;/&quot;&gt;&lt;/form&gt;
&lt;button form=&quot;action1&quot; type=&quot;submit&quot; role=&quot;button&quot;&gt;Submit&lt;/button&gt;

Sorry for the bad report earlier :-(</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63892</commentid>
    <comment_count>6</comment_count>
    <who name="William Hatever">julien.cayzac</who>
    <bug_when>2012-02-08 13:04:14 +0000</bug_when>
    <thetext>It seems to be cause by the &quot;role&quot; attribute, specifically. Other attributes )e.g. data-whatever) don&apos;t trigger any error.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63921</commentid>
    <comment_count>7</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2012-02-09 03:11:25 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; So it appears that by over-simplifying the fragment I removed the bug :)
&gt; 
&gt; This works fine:
&gt; 
&gt; &lt;form id=&quot;action1&quot; action=&quot;/&quot;&gt;&lt;/form&gt;
&gt; &lt;button form=&quot;action1&quot; type=&quot;submit&quot;&gt;Submit&lt;/button&gt;
&gt; 
&gt; But this triggers the error, even on http://validator.w3.org/nu/ tonight:
&gt; 
&gt; &lt;form id=&quot;action1&quot; action=&quot;/&quot;&gt;&lt;/form&gt;
&gt; &lt;button form=&quot;action1&quot; type=&quot;submit&quot; role=&quot;button&quot;&gt;Submit&lt;/button&gt;
&gt; 
&gt; Sorry for the bad report earlier :-(

No problem at all.

Answer: Consider just removing the role attribute. I&apos;m not sure why you&apos;ve added it there, but if it&apos;s for the purpose of making your app accessible to users of AT software, I don&apos;t think it&apos;s necessary, because I think the AT already knows that the button element is a button, and the AT can let the user know that without you needing to put a role attribute on it.

That is, at least for the simple case. But if you also have some other aria-* attributes on that element, then please let me know. Because I think that&apos;s a bit of a different case. Or if there&apos;s some other reason you&apos;re adding it (customer requirement or guidelines published somewhere or something), lemme know.

So the background on this is that I know what&apos;s causing this problem and how to fix it but I&apos;m not ready to make that fix yet. The role-checking behaving is in the part of the validator backend that does ARIA checking, and that part is currently incomplete. I have a patch I&apos;ve been working on to make it more complete, but that patch is not finished yet:

https://bitbucket.org/validator/syntax-patches/src/default/aria

Also, the HTML5 spec currently does not clearly allow &lt;button role=button...&gt;. See the following bug:

&quot;Authors should not be allowed to specify roles on elements that they already have by default&quot;
https://www.w3.org/Bugs/Public/show_bug.cgi?id=11557

So I think what we are leaning toward is only allowing cases like &lt;button role=button..&gt; if there is also some other aria-* attribute(s) on the element; e.g., aria-pressed. 

So anyway, we are going to need an HTML5 spec change before I can do anything to make a validator change for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>86419</commentid>
    <comment_count>8</comment_count>
    <who name="Michael[tm] Smith">mike</who>
    <bug_when>2013-04-20 13:59:38 +0000</bug_when>
    <thetext>Fixed in the validator sources now. I&apos;ll push the change to the W3C validator later today.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>