[Webkit-unassigned] [Bug 74961] window.prompt() returns incorrect value when Cancel is pressed

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Jan 10 15:58:46 PST 2012


https://bugs.webkit.org/show_bug.cgi?id=74961


Daniel Bates <dbates at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |andersca at apple.com,
                   |                            |dbates at webkit.org,
                   |                            |sam at webkit.org




--- Comment #1 from Daniel Bates <dbates at webkit.org>  2012-01-10 15:58:46 PST ---
>From briefly debugging, m_client.runJavaScriptPrompt() (*) in WebUIClient::runJavaScriptPrompt() returns the empty string when the Cancel button is pressed in the NSAlert dialog. Concatenating the multi-process call chains into one chain, the call chain leading up to WebUIClient::runJavaScriptPrompt() has the form: 

... => DOMWindow::prompt() => Chrome::runJavaScriptPrompt() => WebChromeClient::runJavaScriptPrompt() => ... => WebUIClient::runJavaScriptPrompt()

Ultimately WebUIClient::runJavaScriptPrompt() returns the empty string through this chain (in reverse order) to JavaScript. Therefore we return the empty string when the Cancel button is pressed in the JavaScript prompt() dialog.

(*) <http://trac.webkit.org/browser/trunk/Source/WebKit2/UIProcess/WebUIClient.cpp?rev=102935#L142>

For completeness, this bug doesn't occur in single-process mode in Mac Safari Version 5.1.2 (7534.52.7). That is, window.prompt() returns null when the Cancel button is pressed in the JavaScript prompt() dialog.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list