Bugzilla – Bug 1017
Lack of <title> element should cause a warning, not an error message
Last modified: 2015-01-16 10:27:53 CET
Currently the lack of <title> causes the message “Element head is missing a required instance of child element title.” However, even the explanation after the message says that it is not required “if the document is an iframe srcdoc document or if title information is available from a higher-level protocol”. The HTML5 specification explicitly says, at the end of the description of the <head> element: “The title element is a required child in most situations, but when a higher-level protocol provides title information, e.g. in the Subject line of an e-mail when HTML is used as an e-mail authoring format, the title element can be omitted.” The message should thus be changed to a warning, e.g. “Element head lacks a child element title.” It would be more informative to say e.g. “The document lacks a title element”, but since the message is issued after switching from <head> to <body>, it is probably better to keep the text as referring to the <head> element content. It may be argued that making this just a warning will make authors regard <title> as generally optional. This is a real risk, but in my opinion more acceptable than issuing an error message about something that is not necessarily an error.