W3C home > Mailing lists > Public > www-html@w3.org > February 2007

RE: [html] Elements within "title"?

From: Paul Nelson (ATC) <paulnel@winse.microsoft.com>
Date: Wed, 28 Feb 2007 13:10:41 -0800
Message-ID: <49C257E2C13F584790B2E302E021B6F912A0C694@winse-msg-01.segroup.winse.corp.microsoft.com>
To: Nicholas Shanks <contact@nickshanks.com>, <www-html@w3.org>

Let's consider real use cases. Where is the <title> element of the HTML
document rendered?

>From my experience, the title is normally rendered in places that have
very limited constraints. Does the <title> element really need to be
styled?

It would be great for people to give some scenarios based on where UAs
might benefit from styling the <title>.

Paul

-----Original Message-----
From: www-html-request@w3.org [mailto:www-html-request@w3.org] On Behalf
Of Nicholas Shanks
Sent: Thursday, March 01, 2007 5:00 AM
To: www-html@w3.org
Subject: Re: [html] Elements within "title"?

On 28 Feb 2007, at 15:20, Lachlan Hunt wrote:

> There are legacy documents on the web that include markup  
> significant characters like < and >.

There's nothing wrong with including > in PCDATA. It's only < and &  
that matter.

> Changing the parsing to handle them as markup would break such  
> pages simply because it is different from what browsers do today,  
> and what authors rely on.

Browsers handle entities already, so strings with & in them are not a  
problem, since they will already be broken, HTML5 won't change that.

Browsers don't handle "<text" as meaning an element currently, but  
could conceivably do so if they treated "< a" as CDATA, but "<a  
foo=bar>" as PCDATA. The space and/or closing greater-than sign could  
be defined as significant in how the title is to be handled.

Legacy pages that have markup such as "<title>> C@@L S7uff!!1! <</ 
title>" would still work as the author intended. Pages with titles  
such as "<title>Discussion of the <em> element.</title>" could either  
be updated to use &lt;em> as they should have been doing anyway, or  
the browser can use DOCTYPE switching and heuristics (looking for  
closing tag, say) to decide.
There are few enough of such pages, and their authors savvy enough,  
that I don't feel avoiding breaking such pages is sufficient reason  
to hinder progress of the format. The fix (use &lt;) is so trivial to  
implement that it seems a non-issue here.

I therefore don't see how the arguments against this being possible  
can hold water.
As to whether it should be implemented, well I can see where it would  
be critical: lang attributes on spans as has been cited, usage of  
<sub> and <sup> for scientific purposes. It would ease automatic  
generation of HTML pages from HTML extracts, ease conversion to HTML  
from LaTeX or other formats, and so on.

Indeed I have seen sites in the wild that use tags within their title  
element expecting them to work. These pages could be *fixed* by  
allowing this :-D

- Nicholas.
Received on Wednesday, 28 February 2007 21:10:07 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 27 March 2012 18:16:08 GMT