[whatwg] On tag inference

Simon Pieters zcorpan at hotmail.com
Mon Sep 5 12:28:20 PDT 2005


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





More information about the whatwg mailing list