[whatwg] </html> with omitted tags

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