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

Re: Nesting <HTML>...</HTML> tag pairs

From: Lachlan Hunt <lachlan.hunt@lachy.id.au>
Date: Tue, 22 Feb 2005 02:05:46 +0000
Message-ID: <421A9303.70504@lachy.id.au>
To: neal.p.murphy@alum.wpi.edu
Cc: W3C HTML List <www-html@w3.org>

Neal Murphy wrote:
> As near as I can determine, the HTML spec allows for only one pair of 
> <HTML>...</HTML> tags to be present in a document. However, there are at 
> least a few browsers that happily nest these tags and seem to display the 
> information in the nested document as its author intended.

A lack of error messages does not indicate support for such nonsense. 
Browsers are built to deal with all sorts of messed up code like that, 
and simply ignore any tags for elements it doesn't understand.  In the 
case of nested <html> elements, the browser most likely doesn't even 
include the element within the DOM.  Firefox didn't when i tested it, 
and other browsers are likely to have similar behaviour.

> "Why would you want to do that?" you ask. Suppose I have a website built using 
> tables to define the various 'areas' of the page, and that one of the 
> website's pages displays the minutes from a meeting. I don't have the time to 
> take their Word docs containing the minutes, reformat them to fit the 
> website, create the HTML and install the document on the website. I would 
> like to allow authorized folks to prepare content for one of these page 
> 'areas' and upload the complete HTML doc that they've prepared without having 
> to rewrite the document to fit the website.

Ok, so because your broken publishing system produces non-conformant 
code, you want the HTML recommendation changed so that it is?

> Is this browser behavior 'proper'?

Yes, in the sense that user agents should ignore elements they don't 
understand and attempt to render the content.

> Should the spec allow nesting of <HTML>...</HTML> tag pairs so that
> any reasonable containing object can format and display an HTML document 
> fairly independently of the rest of the page?

No.  Why don't you try including each document within an <object> element.

<object data="document.html" type="text/html" ... >
<p><a href="document.html">[Document Title]</a></p>

Lachlan Hunt
http://GetFirefox.com/     Rediscover the Web
http://GetThunderbird.com/ Reclaim your Inbox
Received on Tuesday, 22 February 2005 02:27:17 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:06:10 UTC