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

Selectors API: Multiple elements with the same ID

From: Simon Pieters <zcorpan@gmail.com>
Date: Sat, 27 Jan 2007 19:18:15 +0100
To: "public-webapi@w3.org" <public-webapi@w3.org>
Message-ID: <op.tmtrspso7a8kvn@hp-a0a83fcd39d2>

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 than it would be to  
> continue searching for something which in a valid page wont be there.  
> Any browser that continues searching once it finds the first occurrence  
> of an id is just being inefficient.
  --  
http://www.sitepoint.com/forums/showthread.php?t=454192#post_message_3258069

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  
all elements that match the selector?

Regards,
-- 
Simon Pieters
Received on Saturday, 27 January 2007 18:18:19 GMT

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