W3C home > Mailing lists > Public > public-webapi@w3.org > January 2007

Re: Selectors API: Multiple elements with the same ID

From: Anne van Kesteren <annevk@opera.com>
Date: Mon, 29 Jan 2007 00:05:07 +0100
To: "Maciej Stachowiak" <mjs@apple.com>, "Boris Zbarsky" <bzbarsky@mit.edu>
Cc: "Robert Sayre" <sayrer@gmail.com>, "Bjoern Hoehrmann" <derhoermi@gmx.net>, "Simon Pieters" <zcorpan@gmail.com>, "public-webapi@w3.org" <public-webapi@w3.org>
Message-ID: <op.tmvzqtnm64w2qv@id-c0020.nomadprime.subscribe.loganwifi.com>

On Sun, 28 Jan 2007 23:58:51 +0100, Maciej Stachowiak <mjs@apple.com>  
wrote:
> I tried to make some test cases to figure out the difference (in current  
> WebKit sources we changed to return the first match in document order to  
> match IE, and, we thought, Firefox), but Gecko's getElementById seems to  
> be really buggy. For instance, this alerts null:
>
> <div id="foo">
> </div>
> <script>
> alert(document.getElementById("foo"));
> </script>
>
> This is with Firefox 2.0.0.1 on Mac OS X. What am I doing wrong here?

I suspect that's the parsing bug where <script> is moved to <head> because  
no significant content has occured yet (I'm not entirely sure how that  
works or is determined).


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Sunday, 28 January 2007 23:05:29 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:18:56 GMT