[whatwg] Handling <title> inside <body>

Tommy Thorsen tommy at kvaleberg.com
Mon Nov 10 02:51:34 PST 2008

I noticed that, according to the html5 algorithm, when the parser sees a 
<title> start tag when in the "in body" insertion mode, it's not 
supposed to relocate it to the head element. Opera matches this 
behaviour, but Firefox moves any title tag  it finds into the head element.

The description of the title element in the spec ("4.2.2 The title 
element") says:

    Contexts in which this element may be used:
        In a head element containing no other title elements.

I don't care very strongly about whether or not title elements are 
allowed anywhere, but I do think the output of the parsing algorithm 
should be valid html according to the rest of the spec. So, in my 
opinion, we need to change either the allowed context of the title 
element, or the parsing algorithm.

I think everything I've said about the <title> element also applies to 
the <base> element.

FWIW: In our implementation, I've changed the handling of "base" and 
"title" in "in body" to:

    Process the token using the rules for the "after head" insertion mode.

instead of processing them with the rules for "in head".

Best regards,

More information about the whatwg mailing list