Bug 71362 - [GTK] Add support for javascript dialogs in WebKit2 GTK+ API
Summary: [GTK] Add support for javascript dialogs in WebKit2 GTK+ API
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
Keywords: Gtk
Depends on: 69753
Blocks: 71447
  Show dependency treegraph
Reported: 2011-11-02 07:14 PDT by Carlos Garcia Campos
Modified: 2011-12-13 05:32 PST (History)
4 users (show)

See Also:

Patch (21.52 KB, patch)
2011-11-02 07:20 PDT, Carlos Garcia Campos
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos Garcia Campos 2011-11-02 07:14:21 PDT
Implement alert, confirm and prompt dialogs.
Comment 1 Carlos Garcia Campos 2011-11-02 07:20:33 PDT
Created attachment 113315 [details]
Comment 2 WebKit Review Bot 2011-11-02 07:22:55 PDT
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Comment 3 Martin Robinson 2011-12-12 07:34:40 PST
Comment on attachment 113315 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=113315&action=review

> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:343
> +     * Emitted when JavaScript code calls <function>alert</function>. If the

alert -> window.alert

> Source/WebKit2/UIProcess/API/gtk/WebKitWebView.cpp:392
> +     * signal is not handled a message dialog with Ok and Cancel buttons and

Ok -> OK

> Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp:109
> +        htmlString = g_strdup_printf(htmlOnLoadFormat, "self.close();");
> +    else if (g_str_equal(path, "/javascript_alert")) {
> +        GOwnPtr<char> alertDialogMessage(g_strdup_printf("alert('%s')", kAlertDialogMessage));
> +        htmlString = g_strdup_printf(htmlOnLoadFormat, alertDialogMessage.get());
> +    } else if (g_str_equal(path, "/javascript_confirm")) {
> +        GOwnPtr<char> alertDialogMessage(g_strdup_printf(jsConfirmFormat, kConfirmDialogMessage));

Could you skip soup server here again and just load a string?

> Source/WebKit2/UIProcess/API/gtk/tests/TestWebKitWebView.cpp:247
> +    g_main_loop_run(test->m_mainLoop);

It's a bit odd that the fixture takes care of ending the main loop, but the test takes care of running it. Maybe you could add a method to the fixture like: runMainLoopUntilAlertDialog.
Comment 4 Carlos Garcia Campos 2011-12-13 05:32:16 PST
Committed r102675: <http://trac.webkit.org/changeset/102675>