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

Re: DOMObject.firstChild inconsistencies

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 21 Mar 2007 06:08:58 +0000 (UTC)
To: "Dailey, David P." <david.dailey@sru.edu>
Cc: Jim Barraud <jim.barraud@gmail.com>, public-html@w3.org
Message-ID: <Pine.LNX.4.62.0703210603410.3233@dhalsim.dreamhost.com>

On Tue, 20 Mar 2007, 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 a known, long-standing bug in Opera. There are in fact a series of 
bugs to do with its handling of <head>. (This isn't even an ambiguity in 
HTML4, like most incompatibilities.)

> The total number of children in a given document is usually entirely 
> different. If we wish to be able to parse a document according to what I 
> surmise are W3C standards, then it would be nice if our browsers could 
> agree on how many nodes there are.

For what it's worth, the WHATWG HTML5 spec does define this precisely:


Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Wednesday, 21 March 2007 06:09:03 UTC

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