Bug 14327 - REGRESSION (r21367): dialogArguments not set in window generated by showModalDialog
Summary: REGRESSION (r21367): dialogArguments not set in window generated by showModal...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 523.x (Safari 3)
Hardware: Mac OS X 10.4
: P1 Major
Assignee: Nobody
URL: javascript:showModalDialog("data:text...
Keywords: HasReduction, InRadar, Regression
Depends on:
Blocks:
 
Reported: 2007-06-22 20:41 PDT by Dana
Modified: 2007-07-13 15:22 PDT (History)
2 users (show)

See Also:


Attachments
Test case (3.07 KB, application/zip)
2007-06-24 13:10 PDT, Dana
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Dana 2007-06-22 20:41:10 PDT
When I call showModalDialog, window.dialogArguments is always undefined in the resulting window, even though I am passing in an object.  This seems to be a regression because it works fine in Safari 419.3.
Comment 1 David Kilzer (:ddkilzer) 2007-06-23 11:23:41 PDT
Thanks for the bug report, Dana!  Could you provide a small test case demonstrating the issue?  (A zip file containing two HTML files is fine.)

Comment 2 David Kilzer (:ddkilzer) 2007-06-23 11:27:44 PDT
This URL seems to work for me:

javascript:showModalDialog('javascript:alert(window.dialogArguments)', new Object())

I'm using Safari 3.0 (522.12) with a local debug build of WebKit r23737 on Mac OS X 10.4.10 (8R218).

Comment 3 Dana 2007-06-24 13:10:05 PDT
Created attachment 15208 [details]
Test case

There are three files in the attached zip archive.  DialogTest.html is the page to load in your browser with a "Click Me" button, which will load dialog.html in a modal window.  The dialog.js file contains scripts run by dialog.html.
Comment 4 Dana 2007-06-24 13:11:48 PDT
Strangely, that URL works for me as well!  What's different?
Comment 5 David Kilzer (:ddkilzer) 2007-06-24 16:31:06 PDT
Verified the attached test case (Attachment 15208 [details]) is a regression from Safari 2.0.4 (419.3) using Safari 3.0 (522.12) with a local debug build of WebKit r23748 on Mac OS X 10.4.10 (8R218).

The test case needs further reduction to determine what's the difference between it and the one-liner in Comment #2.

Comment 6 David Kilzer (:ddkilzer) 2007-06-24 16:37:10 PDT
<rdar://problem/5291173>
Comment 7 mitz 2007-07-05 07:26:54 PDT
Regressed in <http://trac.webkit.org/projects/webkit/changeset/21367>.

Dave's test case doesn't fail because it uses a javascript: URL so it doesn't load a new document into the newly-opened window. Here is a minimal failing test case:

javascript:showModalDialog("data:text/html,<script>alert(dialogArguments)</script>", "PASS")

I think the window's dialogArguments property is cleared as when the new document is loaded, now that every window starts out with an empty document.
Comment 8 Anders Carlsson 2007-07-13 15:22:49 PDT
Committed revision 24276.