Bug 6281

Summary: window.frames["frameName"].document does not work in Safari due to security checks
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Normal    
Priority: P3    
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
Test case none

Description Eric Seidel (no email) 2005-12-28 22:38:37 PST
window.frames["frameName"].document does not work in Safari

See test case.
Comment 1 Eric Seidel (no email) 2005-12-28 22:40:30 PST
Created attachment 5347 [details]
Test case
Comment 2 Eric Seidel (no email) 2005-12-28 22:44:01 PST
Hum, I'm wondering if this is a security issue... as the code looks like we should support this.  FireFox 
allows this test case to work.
Comment 3 Eric Seidel (no email) 2005-12-28 22:46:37 PST
Yes, this seems to be due to security checks.  Now the question becomes, why does firefox allow this (at 
least from in the file:// to http://apple.com case).
Comment 4 Geoffrey Garen 2005-12-28 22:55:28 PST
I think we need to add a check for whether the requesting frame is the parent of the requested frame, and 
allow that. Although I *don't* think that child frames get access to the parent frame -- in any browser.
Comment 5 Geoffrey Garen 2005-12-28 22:56:54 PST
On the other hand, what if a phishing site opens your bank site in a child frame and then scoops your 
data? Doesn't seem like we should allow that.
Comment 6 Maciej Stachowiak 2006-03-20 02:48:14 PST
This is due to security restrictions. Firefox has a slightly different model. Instead of keeping you from getting the document object at all on a frame where you don't have access, they give you the document but keep you from accessing most of its properties. I think we should keep the current model because it is simpler and therefore likely to be more robust.