Bug 7170

Summary: `window.parent.[frameName].location=' fails if the target frame has not yet loaded a document
Product: WebKit Reporter: rahul abrol <solushex>
Component: FramesAssignee: Nobody <webkit-unassigned>
Status: CLOSED FIXED    
Severity: Normal CC: ap, ian
Priority: P2 Keywords: HasReduction
Version: 420+   
Hardware: Mac   
OS: OS X 10.4   
Attachments:
Description Flags
testcase (start.tgz)
none
reduction.zip none

Description rahul abrol 2006-02-09 20:40:10 PST
(N.B. this is similar to bug #6281)

a safari user created a test site containing three frames, where one frame (main.htm) sets the location of the two other frames through javascript (e.g. window.parent.frame1.location=...).  apparently safari is the only browser that (occasionally?) fails to display the content in these two frames.  the full discussion is located here:

http://discussions.apple.com/thread.jspa?threadID=337792

i'm guessing this is due to security restrictions, but i've verified that firefox 1.5.0.1, camino 1.0rc1, and opera 9.0pre2 all allow this cross-frame javascript code.  both the latest safari stable and ToT fail.

i'm attaching a slightly reduced test-case of the problem.
Comment 1 rahul abrol 2006-02-09 20:50:13 PST
Created attachment 6377 [details]
testcase (start.tgz)

the attached archive contains four files.  open start.html.

the top frame (banner.htm) remains empty in safari (no js errors either), whereas other browsers seem to have no problems here.
Comment 2 Geoffrey Garen 2006-02-10 09:47:52 PST
Created attachment 6390 [details]
reduction.zip

Attached a more reduced reduction (reduction.zip).
Comment 3 Geoffrey Garen 2006-02-10 09:49:57 PST
The reduction will pass in Safari if and only if:
(1) The target frame loads an initial document (even an empty document).
(2) The target frame loads prior to the frame that tries to set its src value.
Comment 4 Alexey Proskuryakov 2006-02-10 12:41:32 PST
See also: bug 7161.
Comment 5 Joost de Valk (AlthA) 2006-02-17 14:36:54 PST
Good testcase. Confirmed.
Comment 6 mitz 2006-12-18 12:13:02 PST
Looks like this was fixed in r17144.
Comment 7 Alexey Proskuryakov 2006-12-18 12:43:26 PST
I added a layout test (committed r18278), because this bug got fixed "magically",