Bug 18407 - document.images with multiple named items returns back a collection
: document.images with multiple named items returns back a collection
Status: UNCONFIRMED
: WebKit
HTML DOM
: 525.x (Safari 3.1)
: Macintosh Mac OS X 10.5
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-04-10 09:04 PST by
Modified: 2008-04-14 00:46 PST (History)


Attachments


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-04-10 09:04:28 PST
If you have the following on a page:
<img src="http://image1" name="myimage" />
<img src="http://image2" name="myimage" />

Then in javascript reference document.images['myimage']. In IE, Firefox and Opera this returns back a reference to one of the images. However Safari is returning back a Collection object. 

According to DOM Level 1 (HTML) http://www.w3.org/TR/REC-DOM-Level-1/level-one-html.html:
The Node with a name or id attribute whose value corresponds to the specified string. Upon failure (e.g., no node with this name exists), returns null.