WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED CONFIGURATION CHANGED
18407
document.images with multiple named items returns back a collection
https://bugs.webkit.org/show_bug.cgi?id=18407
Summary
document.images with multiple named items returns back a collection
Daniel Wester
Reported
2008-04-10 09:04:28 PDT
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Ahmad Saleem
Comment 1
2022-07-25 17:07:47 PDT
I am unable to reproduce this bug and I am not clear on web-spec and I get following behavior based on this test case (changed to JSFiddle from
Comment 0
): Link -
https://jsfiddle.net/atxj48fo/show
** Safari 15.6 on macOS 12.5 - <img src="
http://image1
" name="myimage"> ** Firefox Nightly 104 - <img src="
http://image1
" name="myimage"> ** Chrome Canary 106 - <img src="
http://image1
" name="myimage"> All of them are matching but not sure on web-spec so I am going to just share this much update. Thanks!
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug