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 27921 - Full documents without root <html> validate
Summary: Full documents without root <html> validate
Status: RESOLVED WORKSFORME
Alias: None
Product: HTML Checker
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: ---
Assignee: Michael[tm] Smith
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-01-29 00:14 UTC by Jonathan Wilde [:jwilde]
Modified: 2015-08-23 07:07 UTC (History)
1 user (show)

See Also:


Attachments

Description Jonathan Wilde [:jwilde] 2015-01-29 00:14:31 UTC
The following document passes HTML5 strict in the validator, even when the "full document" checkbox is checked for direct input mode:

  <!DOCTYPE html>
  <head>
    <title>Invalid</title>
  </head>
  <body>
    <p>Hello world</p>
  </body>

Per my reading of <http://www.w3.org/TR/html5/syntax.html#writing>, this should at least throw a warning, if not fail validation entirely, due to the lack of an enclosing html element:

> Documents must consist of the following parts, in the given order:
>
>   ...
>
>   5. The root element, in the form of an html element.

Thanks!
Comment 1 Michael[tm] Smith 2015-02-06 22:17:24 UTC
The start tag and end tag for the html element can be omitted.
See http://www.w3.org/TR/html5/semantics.html#the-html-element

The start tags and end tags for the body and head elements can be omitted also, so the following is also a valid full document:

  <!DOCTYPE html>
    <title>Invalid</title>
    <p>Hello world</p>