Bug 10720 - REGRESSION: YUI getElementsByClassName returns wrong value
Summary: REGRESSION: YUI getElementsByClassName returns wrong value
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebCore JavaScript (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P1 Normal
Assignee: Nobody
URL:
Keywords: HasReduction, InRadar, Regression
Depends on:
Blocks:
 
Reported: 2006-09-04 00:48 PDT by Matt Lilek
Modified: 2006-11-06 05:40 PST (History)
3 users (show)

See Also:


Attachments
testcase (4.63 KB, application/zip)
2006-09-04 00:50 PDT, Matt Lilek
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Matt Lilek 2006-09-04 00:48:38 PDT
The collection returned by YUI's getElementsByClassName returns "[object HTMLAnchorElement]" instead of the expected value.  This is a regression from Safari 2.0.4 and Firefox.

However, as mitz pointed out on irc, when accessing the array item individually (getElementsByClassName('foo')[0]), the correct value is returned.

The testcase I will upload shortly shows this more clearly.  I've cut down as much of the unnecessary bits from the yahoo files as possible.
Comment 1 Matt Lilek 2006-09-04 00:50:11 PDT
Created attachment 10384 [details]
testcase
Comment 2 mitz 2006-09-04 00:57:32 PDT
This is apparently a regression from r14463 (patch for bug 8964, autogenerate HTMLAnchorElement).
Comment 3 mitz 2006-09-05 11:19:03 PDT
I think this HTMLAnchorElement regression exposed a bug in Array.prototype.toString() that was introduced when bug 3991 was fixed (r9842): according to the spec (15.4.4.5), unlike toLocaleString(), join() (and thus toString()) should not use the array elements' toString(), but rather apply the ToString operator to them.
Comment 4 Matt Lilek 2006-10-27 18:18:10 PDT
Filed in radar as 4808136
Comment 5 Mark Rowe (bdash) 2006-11-06 05:40:49 PST
It appears that the fix for bug 11524 in r17610 addressed this regression.