Bugzilla – Bug 978
Validator doesn't require body element
Last modified: 2013-09-05 07:15:29 CEST
Created attachment 230 [details] bad HTML file without body element The validator does not require a body element for the HTML document to be considered valid. According to the W3C candidate recommendation and current editors draft section 4.1.1, the html element must have a head and body element. I'm attaching a simple test case that should be invalid because it is missing the body element, but passes validation anyway.
The start tag and end tag for the body element can be omitted. See the "Tag omission in text/html" section here: http://www.whatwg.org/specs/web-apps/current-work/multipage/sections.html#the-body-element [[ A body element's start tag can be omitted if the element is empty, or if the first thing inside the body element is not a space character or a comment, except if the first thing inside the body element is a script or style element. A body element's end tag can be omitted if the body element is not immediately followed by a comment. ]]