[Webkit-unassigned] [Bug 17171] [Gtk] script-confirm and script-prompt signals are not binding-friendly

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Tue Feb 21 07:37:44 PST 2012


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


Zan Dobersek <zandobersek at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zandobersek at gmail.com




--- Comment #4 from Zan Dobersek <zandobersek at gmail.com>  2012-02-21 07:37:44 PST ---
I've discussed this with Martin on IRC and come to conclusion that it would be nice to introduce new API for JavaScript dialogs.

Here's an outline of how it might look:

WebKitJSDialog structure
methods:

- webkit_js_dialog_get_dialog_type
returns the type of the dialog, either ALERT, CONFIRM or PROMPT

- webkit_js_dialog_get_message
returns the message of the dialog

- webkit_js_dialog_set_confirmed
only useful on a dialog of type CONFIRM, sets whether the dialog has been confirmed

- webkit_js_dialog_set_response
only useful on a dialog of type PROMPT, sets the response

The WebKitWebView would then carry a signal, something named "script-dialog". The signature of a callback connecting to this signal would look like this:

gboolean callback(WebKitWebView*, WebKitWebFrame*, WebKitJSDialog*, gpointer data)

Some issues of the top of my head:
- the name. If the signal takes the "script-dialog" name, the structure might as well be named WebKitScriptDialog, indicating such dialogs originate from scripts.
- modal dialogs. Should they be included into this API? They're triggered from JavaScript, and their handling is pretty straightforward - handler should return TRUE if it wants to properly display the dialog, FALSE otherwise. Because of that I think they should be, but would like to hear others' opinions.

-- 
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