Bug 18121 - Call to alert() fails after calling showModalDialog()
Summary: Call to alert() fails after calling showModalDialog()
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: 525.x (Safari 3.1)
Hardware: PC Windows Vista
: P2 Major
Assignee: Nobody
URL:
Keywords: InRadar, PlatformOnly
Depends on:
Blocks:
 
Reported: 2008-03-26 12:39 PDT by Robbie Paplin
Modified: 2008-03-27 19:49 PDT (History)
4 users (show)

See Also:


Attachments
Page that calls showModalDialog (2.16 KB, text/html)
2008-03-26 12:42 PDT, Robbie Paplin
no flags Details
Page called by showModalDialog (the dialog) (1.46 KB, text/html)
2008-03-26 12:51 PDT, Robbie Paplin
no flags Details
Page that calls showModalDialog (using Bugzilla url) (2.19 KB, text/html)
2008-03-26 13:01 PDT, Robbie Paplin
no flags Details
Testcase that doesn't use alert() to display the return value (2.34 KB, text/html)
2008-03-27 19:48 PDT, Adam Roben (:aroben)
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robbie Paplin 2008-03-26 12:39:47 PDT
If you call showModalDialog on a calling page, the window.returnvalue value that you set on the dialog page doesn't get passed back to the calling page.

See the attached files for an example.
Comment 1 Robbie Paplin 2008-03-26 12:42:01 PDT
Created attachment 20093 [details]
Page that calls showModalDialog

This page depends on the BrowserPicker.html attachment to be in the same directory.
Comment 2 Robbie Paplin 2008-03-26 12:51:56 PDT
Created attachment 20094 [details]
Page called by showModalDialog (the dialog)

This page depends upon the DialogTest.html file previosly attached
Comment 3 Robbie Paplin 2008-03-26 13:01:26 PDT
Created attachment 20095 [details]
Page that calls showModalDialog (using Bugzilla url)

Replaced (browerpicker.html) parameter in showModalDialog call w/ bugzilla attachment url (http://bugs.webkit.org/attachment.cgi?id=20094), so you can test on the bugzilla site.
Comment 4 Vicki Murley 2008-03-26 15:19:34 PDT
Note that this bug is Windows-only.
Comment 5 Vicki Murley 2008-03-27 10:00:40 PDT
In Radar, <rdar://problem/5825338>

Comment 6 Mark Rowe (bdash) 2008-03-27 19:19:00 PDT
Verified in Safari 3.1 that this works ok on the Mac.
Comment 7 Adam Roben (:aroben) 2008-03-27 19:40:38 PDT
After a little debugging, this is definitely a Safari issue, not a WebKit issue. <rdar://5825338> will continue to track this issue. Thanks for filing the bug report!
Comment 8 Adam Roben (:aroben) 2008-03-27 19:47:19 PDT
Here's a little more detail about what I discovered:

The return value from showModalDialog is getting passed back to the calling script. The call to alert() is what's failing in some cases. Scripts relying on showModalDialog should be able to get the return value. <rdar://5825338> will track the problematic interaction between showModalDialog() and alert().
Comment 9 Adam Roben (:aroben) 2008-03-27 19:48:03 PDT
Created attachment 20143 [details]
Testcase that doesn't use alert() to display the return value

Here's a testcase that proves the return value from showModalDialog is getting returned to the calling script. Instead of calling alert() we insert the value into the page.