<?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>1844</bug_id>
          
          <creation_ts>2005-08-12 08:26:11 +0000</creation_ts>
          <short_desc>Parser &apos;forgets&apos; HEAD start tag when encounting self-teminating empty child element</short_desc>
          <delta_ts>2005-08-12 17:16:42 +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>Parser</component>
          <version>0.7.0</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>steffan</reporter>
          <assigned_to name="Terje Bless">link</assigned_to>
          
          
          <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>5400</commentid>
    <comment_count>0</comment_count>
    <who name="">steffan</who>
    <bug_when>2005-08-12 08:26:11 +0000</bug_when>
    <thetext>When validating against a HTML DTD (either detected or through a manual overide)
the Parser &apos;forgets&apos; about the HEAD start tag when it encounters a (invalid)
self-terminating empty tag (i.e. one using XHTML syntax).

As a minimum this results in reports that you have the following errors:

1. end tag for element &quot;HEAD&quot; which is not open
2. document type does not allow element &quot;BODY&quot; here

In addition - any elements in the HEAD that follow the trigger element are
reported in the form &apos;document type does not allow element &quot;X&quot; here&apos;, but any
that precede it, and the trigger element itself, are accepted (unless they
exhibit other errors).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5401</commentid>
    <comment_count>1</comment_count>
    <who name="Bj">bjoern</who>
    <bug_when>2005-08-12 11:42:28 +0000</bug_when>
    <thetext>Yes, the end tag for &lt;head&gt; is optional in HTML, so parsers automatically close 
the element when they encounter content that is not allowed in &lt;head&gt;. And text 
is not allowed in &lt;head&gt;, in &lt;link/&gt; the / closes the &lt;link&gt; start tag and the 
&gt; is processed as text content. Which is not allowed in &lt;head&gt;. The &quot;self-
closing&quot; tags in XHTML are not compatible with HTML. You don&apos;t get errors for 
e.g. &lt;p&gt;&lt;br/&gt;&lt;/p&gt; because that&apos;s equivalent to &lt;p&gt;&lt;br&gt;&gt;&lt;/p&gt; which is allowed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>5403</commentid>
    <comment_count>2</comment_count>
    <who name="">steffan</who>
    <bug_when>2005-08-12 17:16:42 +0000</bug_when>
    <thetext>Of course, I knew the XHTML syntax was not compatible but had not fully thought
through it&apos;s impact when element&apos;s parent was the head. Although not immediately
obvious the reference to problems caused by &quot;implicitly closed element&quot; does
indeed explain the nature of the problem.

Final thought - would some form of &quot;Possible instance of XHTML syntax used in
error&quot; type of &quot;warning&quot; (as opposed to error) be both possible and desirable?</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>