This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 20472 - spec doesn't make it clear that <title></title> is non-conforming
Summary: spec doesn't make it clear that <title></title> is non-conforming
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-21 08:11 UTC by Michael[tm] Smith
Modified: 2012-12-31 04:40 UTC (History)
2 users (show)

See Also:


Attachments

Description Michael[tm] Smith 2012-12-21 08:11:48 UTC
Hixie says <title></title> with no contents is non-conforming. But from the spec it's not clear that should be so.

The spec says that content model is "Text" (hyperlinked to a dfn). From just that it's not clear that the text must be non-empty or that it means a "Text node".

The link for "Text" takes you to a dfn with, "Text, in the context of content models, means Text nodes. Text is sometimes used as a content model on its own, but is also phrasing content, and can be inter-element whitespace (if the Text nodes are empty or contain just space characters)."

From that, someone (e.g, most authors, who don't think in terms of parsing behavior and the DOM) might assume that <title></title> is fine because it just contains "Text" that's empty -- or, for any of the very few of them who at that point spend time to think about it further, an empty Text node in the DOM.

Of course they're not going to end up a with any Text node at all in the DOM from parsing a source file/stream that contains <title></title>, but very few authors reading the spec are going to make that leap.

Anyway, it might be best to have an explicit statement in the spec along the lines of, "The contents of title element must be non-empty."
Comment 1 Michael[tm] Smith 2012-12-21 08:51:02 UTC
Note that the spec also says the content model for the textarea is "Text". I assume the intent there is not to make examples like <textarea cols=80 name=comments></textarea> in the spec non-conforming. So the title element and textarea elements are intended to contain different kinds of Text (non-empty vs optionally empty).
Comment 2 contributor 2012-12-31 04:39:26 UTC
Checked in as WHATWG revision r7622.
Check-in comment: Be clearer about the content models of <option>, <textarea>, <title>.
http://html5.org/tools/web-apps-tracker?from=7621&to=7622