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
83439
HTMLCollection.namedItem returns a collection when there are multiple elements sharing the name
https://bugs.webkit.org/show_bug.cgi?id=83439
Summary
HTMLCollection.namedItem returns a collection when there are multiple element...
Boris Zbarsky
Reported
2012-04-08 16:11:06 PDT
Created
attachment 136159
[details]
Testcase Load the attached testcase. It should say PASS, and does in non-WebKit browsers. In WebKit it says FAIL.
Attachments
Testcase
(293 bytes, text/html)
2012-04-08 16:11 PDT
,
Boris Zbarsky
no flags
Details
View All
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2012-04-09 10:50:53 PDT
The difference with Firefox is that our result is a NodeList, not an HTMLImageElement. Re-titling the bug accordingly. The attached test case tests this in a very roundabout way, so we need to test what IE actually does - even if the test passes there, it might be for another reason. I'm not sure why we have this behavior, it seems like it was intentional at some point.
Boris Zbarsky
Comment 2
2012-04-09 11:01:12 PDT
I will bet you money you have this behavior because document.all needs it and as far as I can tell WebKit made document.all a vanilla HTMLCollection and propagated all its insanity to all HTMLCollections....
Pablo Flouret
Comment 3
2012-04-09 11:28:44 PDT
The implementations for namedItem are separate for document.all and other collections (in the bindings, which are custom), but they do the same thing. By looking at the history, it seems HTMLCollection.namedItem has always returned a list when there's more than one element with the same name (and maybe always at first). Doesn't seem to be due to wanting to align with document.all.
Ahmad Saleem
Comment 4
2022-08-01 14:18:53 PDT
I am unable to reproduce this bug in Safari 15.6 on macOS 12.5 using attached test case and it is showing "PASS" and it is matching with other browsers (Chrome Canary 106 and Firefox Nightly 105). I think it was fixed along the way and can be marked as "RESOLVED CONFIGURATION CHANGED". 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