This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
When validating against a HTML DTD (either detected or through a manual overide) the Parser 'forgets' 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 "HEAD" which is not open 2. document type does not allow element "BODY" here In addition - any elements in the HEAD that follow the trigger element are reported in the form 'document type does not allow element "X" here', but any that precede it, and the trigger element itself, are accepted (unless they exhibit other errors).
Yes, the end tag for <head> is optional in HTML, so parsers automatically close the element when they encounter content that is not allowed in <head>. And text is not allowed in <head>, in <link/> the / closes the <link> start tag and the > is processed as text content. Which is not allowed in <head>. The "self- closing" tags in XHTML are not compatible with HTML. You don't get errors for e.g. <p><br/></p> because that's equivalent to <p><br>></p> which is allowed.
Of course, I knew the XHTML syntax was not compatible but had not fully thought through it's impact when element's parent was the head. Although not immediately obvious the reference to problems caused by "implicitly closed element" does indeed explain the nature of the problem. Final thought - would some form of "Possible instance of XHTML syntax used in error" type of "warning" (as opposed to error) be both possible and desirable?