RE: DOMObject.firstChild inconsistencies

Okay, but consider that in the page at http://srufaculty.sru.edu/david.dailey/javascript/DOMProbe.html
 
for the value of count at the end of
 
count=0;for (i in document.forms[0]) count++
 
IE returns a value of 94
Opera returns a value of 187
FF returns a value of 102
 
Most of this is due to different handling of white space (I think).
 
DD

 
________________________________

From: public-html-request@w3.org on behalf of Daniel Glazman
Sent: Tue 3/20/2007 11:19 PM
To: public-html@w3.org
Subject: Re: DOMObject.firstChild inconsistencies




On 21/03/2007 03:24, Dailey, David P. wrote:

> Or, for one simple example, consider the following simple code in which FF and IE return (via alert) "HEAD", but Opera returns "SCRIPT".
>
> <html>
>       <script>
>       alert(document.documentElement.firstChild.nodeName)
>       </script>
>       <body>Hello</body>
> </html>

This is not an inconsistency at all. This is a bug in Opera... HTML
model states that there is an implicit head element. And it's
probably not a bug in the DOM implementation of firstChild but a bug
in their HTML parser not building the implicit structures missing in
the document instance.

</Daniel>

Received on Wednesday, 21 March 2007 03:30:41 UTC