[whatwg] </html> with omitted tags
Calogero Alex Baldacchino
alex.baldacchino at email.it
Fri Dec 26 09:50:54 PST 2008
Geoffrey Sneddon ha scritto:
> On 26 Dec 2008, at 17:02, Calogero Alex Baldacchino wrote:
>> Philip Taylor ha scritto:
>>> 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.
>> AIUI, omitting those closing tags is a parse error anyway, but in
>> certain situations the parser can fix the code automatically because
>> the state to enter/remain in is unambigous. Thus a validator notifies
>> a parse error, while a browser keeps the error internally and handles
>> it when possible.
> The writing HTML documents section is meant to give what is a
> conforming HTML document, and those documents are conforming according
> to that. However, conformance checkers which are meant to follow the
> parser section (and throw the parse errors that produces) which in
> these cases differs. Therefore, either the writing section is wrong or
> the parser is wrong to throw the parse errors.
> Geoffrey Sneddon
Hmm, yeah, perhaps a </html> tag should be treated as stated for the "in
body" insertion mode also for the "in head" and "after head" (or better,
it should be treated as "anything else" for consistence with section
8.1); this way,
would be treated as
without any parse error.
Otherwise, if a document missing a body element is to be considered
non-conforming, that should be stated in section 18.104.22.168 (since actually
it seems to be conforming).
Caselle da 1GB, trasmetti allegati fino a 3GB e in piu' IMAP, POP3 e SMTP autenticato? GRATIS solo con Email.it http://www.email.it/f
Crea il tuo Webshire su Leiweb, fallo sfilare e vinci fantastici premi Locman e Coccinelle. Partecipa subito al concorso!
Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=8515&d=26-12
More information about the whatwg