W3C home > Mailing lists > Public > public-html@w3.org > March 2007

RE: DOMObject.firstChild inconsistencies

From: Dailey, David P. <david.dailey@sru.edu>
Date: Tue, 20 Mar 2007 23:30:54 -0400
Message-ID: <1835D662B263BC4E864A7CFAB2FEEB3D258B84@msfexch01.srunet.sruad.edu>
To: "Daniel Glazman" <daniel.glazman@disruptive-innovations.com>, <public-html@w3.org>

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).


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.

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

This archive was generated by hypermail 2.3.1 : Monday, 29 September 2014 09:21:34 UTC