This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 14685 - Missing < in body start tag not detected
Summary: Missing < in body start tag not detected
Status: RESOLVED WONTFIX
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: Michael[tm] Smith
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-03 10:00 UTC by DHerding
Modified: 2015-08-23 07:07 UTC (History)
1 user (show)

See Also:


Attachments

Description DHerding 2011-11-03 10:00:26 UTC
In the following code, the opening body tag is missing an opening bracket:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<title>Titel</title>
</head>
body>
Foo
</body>
</html>

The validator doesn't detect this. It should report a stray end tag or a similar error.
Comment 1 Michael[tm] Smith 2011-11-07 08:44:39 UTC
It doesn't report it because it's not an error. The validator conforms to the HTML spec here.

The spec says that the body start tag is optional in document instances. If it's omitted, parsers behave as if it had been seen anyway. So basically every document ends up having a body start tag in the DOM,  and so the body end tag in your example is not a "stray" end tag, but instead an end tag for a body start that the parser has already added to the DOM.

And the parser used by the validator follows the HTML parsing algorithm and does not have any special states for attempting to recognize mistyped start tags. For all it knows, you did actually mean to intentionally type "body> FOO".

And trying to have the validator check the parser output to see if there are cases of potentially mistyped start tags is not something we're planning to do.