<?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>6449</bug_id>
          
          <creation_ts>2009-01-19 20:49:06 +0000</creation_ts>
          <short_desc>Document Type detection from VERSION attribute</short_desc>
          <delta_ts>2009-01-23 23:55:16 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Validator</product>
          <component>check</component>
          <version>0.8.4</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P4</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Griff Ruby">ubipetrus</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>ot</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>23160</commentid>
    <comment_count>0</comment_count>
    <who name="Griff Ruby">ubipetrus</who>
    <bug_when>2009-01-19 20:49:06 +0000</bug_when>
    <thetext>A nice thing would be:
1) If the document has no &lt;!DOCTYPE&gt; declaration, and
2) If no Document Override is specified to the validator, and
3) If the document&apos;s Attribute &quot;VERSION&quot; of the &quot;HTML&quot; Element tag specifies a valid version of HTML,
Then the document should be parsed in accordance with the version of HTML specified in the VERSION attribute.
The lack of a &lt;!DOCTYPE&gt; declaration would still be a valid warning regarding the document, which would still not be Valid HTML until a &lt;!DOCTYPE&gt; is specified.
e. g. a document that begins with:
&lt;HTML VERSION=&quot;-//W3C//DTD HTML 3.2 Final//EN&quot;&gt; 
should be parsed as HTML 3.2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23183</commentid>
    <comment_count>1</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2009-01-20 15:10:49 +0000</bug_when>
    <thetext>(In reply to comment #0)
&gt; e. g. a document that begins with:
&gt; &lt;HTML VERSION=&quot;-//W3C//DTD HTML 3.2 Final//EN&quot;&gt; 
&gt; should be parsed as HTML 3.2.

That&apos;s an interesting idea, but is this used anywhere? Standardized anywhere? </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23231</commentid>
    <comment_count>2</comment_count>
    <who name="Griff Ruby">ubipetrus</who>
    <bug_when>2009-01-23 02:25:29 +0000</bug_when>
    <thetext>&gt; is this used anywhere? Standardized anywhere?

The DTDs for many versions of HTML, including all four flavors of HTML 2.0, HTML 3.2, HTML 4.01, and XHTML 1.1 all include this attribute for the HTML element.  Furthermore, when the attribute VERSION occurs in the HTML element of a file submitted to the present validator, it already checkes its contents against the version of HTML, and if there is a mismatch it issues the error message &quot;value of fixed attribute &apos;VERSION&apos; not equal to default.&quot;
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23232</commentid>
    <comment_count>3</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2009-01-23 11:13:11 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; &gt; is this used anywhere? Standardized anywhere?
&gt; 
&gt; The DTDs for many versions of HTML, including all four flavors of HTML 2.0,
&gt; HTML 3.2, HTML 4.01, and XHTML 1.1 all include this attribute for the HTML
&gt; element.  

Indeed, didn&apos;t know about that one. I just checked the spec for HTML4.01, which specifies that the VERSION attribute is deprecated as it duplicates the info present in the DOCTYPE declaration:
http://www.w3.org/TR/html401/struct/global.html#h-7.3

So maybe what we can do is:

* if there is a DOCTYPE declaration (or override), use that
* else
    + if there is a html VERSION attribute, 
        use that as a fallback and output a warning stating that 
        DOCTYPE declaration are the prefered identification method
    + else use the default fallback document type

Will have to ping the HTML WG to check that this is sound, but I guess this is feasible indeed.

thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23237</commentid>
    <comment_count>4</comment_count>
    <who name="Ville Skyttä">ville.skytta</who>
    <bug_when>2009-01-23 23:55:16 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; The DTDs for many versions of HTML, including all four flavors of HTML 2.0,
&gt; HTML 3.2, HTML 4.01, and XHTML 1.1 all include this attribute for the HTML
&gt; element.

Just for completeness, HTML 4.0/4.01 transitional and frameset have it, HTML 4.0/4.01 strict don&apos;t, and no XHTML 1.0 DTD does.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>