W3C home > Mailing lists > Public > whatwg@whatwg.org > September 2005

[whatwg] On tag inference

From: Simon Pieters <zcorpan@hotmail.com>
Date: Mon, 05 Sep 2005 19:28:20 +0000
Message-ID: <BAY109-F337D751A56CD8223E93491B4A40@phx.gbl>
Hi,

>IE7 Beta 1:
><HTML><HEAD><TITLE>...</TITLE><SECTION></HEAD>
><BODY>...</SECTION>
><DIV>...</DIV></BODY></HTML>
>
>(That's very wierd, IE just loves producing broken DOMs! :-/  I assume IE6 
>will produce a similar result, though I don't have it available to test)

I think that IE treats <section> as one empty element, and </section> as 
another empty element, so the DOM tree looks like:

HTML
- HEAD
- - TITLE
- - SECTION
- BODY
- - #text
- - /SECTION
- - DIV
- - - #text

Based on the results of:

javascript:alert(document.getElementsByTagName("SECTION")[0].nodeValue);
javascript:alert(document.getElementsByTagName("/SECTION")[0].nodeType);

(nodeType is interesting, because IE will grab nodes that are not 
ELEMENT_NODEs with getElementsByTagName, such as the doctype declaration 
which according to IE has a tagName of "!" and nodeType of 8...)

Regards,
Simon Pieters
Received on Monday, 5 September 2005 12:28:20 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:08:24 UTC