W3C home > Mailing lists > Public > whatwg@whatwg.org > December 2008

[whatwg] </html> with omitted tags

From: Philip Taylor <excors+whatwg@gmail.com>
Date: Fri, 26 Dec 2008 11:55:51 +0000
Message-ID: <ea09c0d10812260355y850c1f8w65001b78c7c06d29@mail.gmail.com>
I can start with a simple document that's probably conforming and that
the validator doesn't complain about:

  <!DOCTYPE html><html><head><title></title></head><body></body></html>

Then I can read the "Writing HTML document: Optional tags" section, which says:

  "A head element's end tag may be omitted if the head element is not
immediately followed by a space character or a comment.

  A body element's start tag may be omitted 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 may be omitted if the body element is not
immediately followed by a comment."

So I choose to omit the </head><body></body> because I think those
rules say I can do so. I get:

  <!DOCTYPE html><html><head><title></title></html>

But now I get a parse error, which I think is because the </html>
comes in the "in head" insertion mode and is "Any other end tag: Parse
error. Ignore the token.", so something seems wrong.

-- 
Philip Taylor
excors at gmail.com
Received on Friday, 26 December 2008 03:55:51 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:46 UTC