Re: The type document.body should be HTMLBodyElement, no ?

On Tue, 2003-02-25 at 14:46, Teng-Fong Seak wrote:
>     In the following two URLs, we can find the same definition line :
> attribute   HTMLElement   body;
> 
>     But I think it's more appropriate to have :
> attribute   HTMLBodyElement  body;
> 
> DOM 1 HTML:
> http://www.w3.org/TR/2000/WD-DOM-Level-1-20000929/level-one-html.html#ID-26809268
> DOM 2 HTML:
> http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268
> 
>     It's just a small documentation issue, I think, because major
> browsers are using HTMLBodyElement instead of HTMLElement anyway.  Or
> is this written intentionally like this so that browsers are advised to
> stop supporting attributes of document.body like aLink, bgColor, etc
> since they're deprecated ?  But the second paragraph of this URL seems
> to oppose what I thought :
> http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268

I believe that the description indicates why it is not always an
HTMLBodyElement object:
[[
The element that contains the content for the document. In documents
with BODY contents, returns the BODY element. In frameset documents,
this returns the outermost FRAMESET element.
]]
http://www.w3.org/TR/2003/REC-DOM-Level-2-HTML-20030109/html.html#ID-56360201

The body attribute may also contain an HTMLFrameSetElement object.

Philippe

Received on Thursday, 27 February 2003 16:31:25 UTC