Re: Selectors API: Multiple elements with the same ID

2007-01-28 Thread Boris Zbarsky
Maciej Stachowiak wrote: For what it's worth, that's not what Gecko does, and I personally would rather not try to enforce that -- it's somewhat expensive to do so in the face of DOM mutations. I tried to make some test cases to figure out the difference (in current WebKit sources we changed

Re: Selectors API: Multiple elements with the same ID

2007-01-28 Thread Anne van Kesteren
On Sun, 28 Jan 2007 23:58:51 +0100, Maciej Stachowiak <[EMAIL PROTECTED]> 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

Re: Selectors API: Multiple elements with the same ID

2007-01-28 Thread Maciej Stachowiak
On Jan 27, 2007, at 7:56 PM, Boris Zbarsky wrote: Robert Sayre wrote: MSDN says it returns the "first object". For what it's worth, that's not what Gecko does, and I personally would rather not try t

Re: Selectors API: Multiple elements with the same ID

2007-01-27 Thread Boris Zbarsky
Bjoern Hoehrmann wrote: Note: .foo("#id") is not equivalent to document.getElementById('id') if multiple elements have the same ID. This method returns the first element in document order with the given ID, while getElementById's behavior is undefined in this case. I would like to pu

Re: Selectors API: Multiple elements with the same ID

2007-01-27 Thread Boris Zbarsky
Robert Sayre wrote: MSDN says it returns the "first object". For what it's worth, that's not what Gecko does, and I personally would rather not try to enforce that -- it's somewhat expensive to do so in

Re: Selectors API: Multiple elements with the same ID

2007-01-27 Thread Bjoern Hoehrmann
* Anne van Kesteren wrote: >Yes, they are prolly slightly different (although I haven't actually seen >any documentation on how getElementById exactly works). Do you have any >proposed text? Or should we wait until it's clear how getElementById >really works? Well, something like: Note:

Re: Selectors API: Multiple elements with the same ID

2007-01-27 Thread Robert Sayre
On 1/27/07, Anne van Kesteren <[EMAIL PROTECTED]> wrote: Yes, they are prolly slightly different (although I haven't actually seen any documentation on how getElementById exactly works). MSDN says it returns the "first object".

Re: Selectors API: Multiple elements with the same ID

2007-01-27 Thread Anne van Kesteren
On Sat, 27 Jan 2007 13:30:58 -0500, Bjoern Hoehrmann <[EMAIL PROTECTED]> wrote: This is out of scope of the document. The method would return all elements that match the selector. When an element matches a selector is defined by the CSS Selectors specification. If that specification is unclear

Re: Selectors API: Multiple elements with the same ID

2007-01-27 Thread Anne van Kesteren
On Sat, 27 Jan 2007 13:18:15 -0500, Simon Pieters <[EMAIL PROTECTED]> wrote: Perhaps this case has to be defined explicitly. Should getAll() (or whatever it ends up being called) catch only the first element when there's an ID in the selector (not group of selectors), or would it catch al

Re: Selectors API: Multiple elements with the same ID

2007-01-27 Thread Bjoern Hoehrmann
* Simon Pieters wrote: >> Since having a second element with the same ID is invalid there is no >> need for a browser to continue looking once it finds the first one since >> the subsequent ones shouldn't be there and it is therefore more correct >> to ignore them and assume that they don't

Selectors API: Multiple elements with the same ID

2007-01-27 Thread Simon Pieters
Hi, Stephen Chapman said: Since having a second element with the same ID is invalid there is no need for a browser to continue looking once it finds the first one since the subsequent ones shouldn't be there and it is therefore more correct to ignore them and assume that they don't exist