Bug 18200 - document.all("id") doesn't create a collection that supports indexing with round braces
Summary: document.all("id") doesn't create a collection that supports indexing with ro...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 525.x (Safari 3.1)
Hardware: PC Windows XP
: P2 Normal
Assignee: Nobody
URL: http://bf.sina.com.cn/sinarc_php/picl...
Keywords: HasReduction
Depends on:
Blocks: 7532
  Show dependency treegraph
Reported: 2008-03-28 17:03 PDT by jasneet
Modified: 2009-04-20 23:39 PDT (History)
2 users (show)

See Also:

reduction (468 bytes, text/html)
2008-03-28 17:04 PDT, jasneet
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description jasneet 2008-03-28 17:03:15 PDT
I Steps:
Go to 

II Issue:
In the left nav bar, try to click on "+" or "-". the tree doesn't expand or collapse on clicking + or -

III Conclusion:
Webkit doesn't create an array for all the elements found for the  "id" in document.all("id")

IV Other browsers:
IE7: ok
FF3: not ok
Opera9.24: ok

V Nightly tested: 31386
Comment 1 jasneet 2008-03-28 17:04:12 PDT
Created attachment 20174 [details]
Comment 2 Cameron Zwarich (cpst) 2009-04-20 21:33:53 PDT
This is not a bug about JS arrays, it is about DOM collections. Geoff mentioned that we have added this for other collections.
Comment 3 Sam Weinig 2009-04-20 22:20:07 PDT
Interesting.  JSHTMLAllCollection inherits from JSHTMLCollection which implements the funky IE emulating call notation.  I wonder why it is not getting hit.
Comment 4 Cameron Zwarich (cpst) 2009-04-20 22:40:43 PDT
This is a pretty bizarre bug. I can verify with GDB that the correct code in JSHTMLCollection is being called from JITStubs::cti_op_call_NotJSFunction() and a correct value is being returned, but it also reenters JITStubs::cti_op_call_NotJSFunction() and then thinks that the value is not a function.
Comment 5 Cameron Zwarich (cpst) 2009-04-20 23:34:40 PDT
Oh, I was just misreading things because I was tired. Doing document.all returns a JSHTMLAllCollection, and indexing by id in that collection returns a JSNamedNodesCollection, which does not support the function call syntax.
Comment 6 Sam Weinig 2009-04-20 23:39:25 PDT
Ah, I made the same mistake as well.  I thought the bug was in the HTMLAllCollection not supporting call notation.