Summary: | window.frames[i] interprets the type of "i" incorrectly | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Grant Gayed <grant_gayed> | ||||||
Component: | WebCore JavaScript | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | NEW --- | ||||||||
Severity: | Normal | CC: | ap, sam | ||||||
Priority: | P2 | ||||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | Mac (Intel) | ||||||||
OS: | OS X 10.5 | ||||||||
Attachments: |
|
Description
Grant Gayed
2009-09-10 11:55:12 PDT
I believe what you are seeing is that window.frames[] is overloaded for both number and name. So, since you named the frames "1" and "2", they are getting picked up. You're right, that's what's happening. I guess this is by design, so I'll close the report. Thanks for the quick response! Revisiting, I think I closed this too hastily. Comment 1 does explain what's happening, but it still seems wrong. JS knows the difference between a number and a string, so it should know whether the frame's name or its index is being provided. The other browsers don't get this case confused. Created attachment 39489 [details]
test case
Same test case, as an attachment.
This test doesn't work in Firefox at all, because trying to access a frame with another origin fails with an exception. It isn't too informative in Safari either, as the window name comes back as "undefined". Do you have a test that shows difference between Safari and other browsers? Created attachment 39546 [details]
test case
This test case shows the difference, just load test.html and wait two seconds. The browser behaviours are:
- IE6, IE8, Firefox 3.5.3 on Windows and Linux: i=0 has name=1, i=1 has name=2
- Firefox 3.5.3 on OSX 10.5.8: does not show this dialog
- Safari 4.0.3 (5531.9) on OSX 10.5.8: i=0 has name=1, i=1 has name=1, i=2 has name=2
I don't know why Firefox on OSX doesn't match Firefox on Windows and Linux, maybe something is set differently? Regardless, the difference can be seen with the other configurations.
|