Bug 7170 - `window.parent.[frameName].location=' fails if the target frame has not yet loaded a document
Summary: `window.parent.[frameName].location=' fails if the target frame has not yet l...
Status: CLOSED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Frames (show other bugs)
Version: 420+
Hardware: Mac OS X 10.4
: P2 Normal
Assignee: Nobody
URL:
Keywords: HasReduction
Depends on:
Blocks:
 
Reported: 2006-02-09 20:40 PST by rahul abrol
Modified: 2007-12-04 13:30 PST (History)
2 users (show)

See Also:


Attachments
testcase (start.tgz) (851 bytes, application/x-gzip)
2006-02-09 20:50 PST, rahul abrol
no flags Details
reduction.zip (2.02 KB, application/zip)
2006-02-10 09:47 PST, Geoffrey Garen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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",