renyard / validity

A Google Chrome extension for validating HTML.
https://chrome.google.com/webstore/detail/bbicmjjbohdfglopkidebfccilipgeif
Apache License 2.0
90 stars 22 forks source link

Reports valid HTML5 when no <html> tag is present #42

Closed multiwebinc closed 9 years ago

multiwebinc commented 9 years ago

This should be invalid, but it's not:

<!DOCTYPE html>
<head>
    <title>title</title>
</head>
<body>
</body>
</html>
renyard commented 9 years ago

HTML5 provides quite a lot of rules around error correction and as a result, this is a valid document.

The opening tag can be emitted if the first thing inside the element is not a comment. In this case, the opening is inferred by the opening and so can be closed at the end.

Validating the document directly on the W3C Validator (Validity uses an instance of the W3C validator for it's validation) produces the same result.