Changeset 107351 in webkit
- Timestamp:
- Feb 9, 2012 8:33:33 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r107350 r107351 1 2012-02-09 Zan Dobersek <zandobersek@gmail.com> 2 3 [GTK] Add DRT support for modal dialogs 4 https://bugs.webkit.org/show_bug.cgi?id=53600 5 6 Reviewed by Martin Robinson. 7 8 Unskip the passing modal dialogs tests and log the remaining skipped test. 9 10 * platform/gtk/Skipped: 11 1 12 2012-02-09 Zan Dobersek <zandobersek@gmail.com> 2 13 -
trunk/LayoutTests/platform/gtk/Skipped
r107350 r107351 925 925 canvas/philip/tests/2d.pattern.paint.repeaty.outside.html 926 926 927 # Tests that user modal dialogs fail in the DRT for some reason. 928 # https://bugs.webkit.org/show_bug.cgi?id=53600 929 fast/animation/request-animation-frame-during-modal.html 927 # This modal dialog test still fails because the blur event is not dispatched on the opener 928 # window when running the modal dialog. 930 929 fast/events/show-modal-dialog-onblur-onfocus.html 931 fast/events/scroll-event-during-modal-dialog.html932 fast/harness/show-modal-dialog.html933 inspector/console/console-long-eval-crash.html934 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T10.html935 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T11.html936 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T2.html937 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T2.html938 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T4.html939 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T4.html940 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T6.html941 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T6.html942 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T8.html943 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T8.html944 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T10.html945 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T11.html946 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T1.html947 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T1.html948 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T3.html949 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T3.html950 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T5.html951 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T5.html952 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T7.html953 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T7.html954 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.1_T9.html955 sputnik/Conformance/10_Execution_Contexts/10.2_Entering_An_Execution_Context/10.2.2_Eval_Code/S10.2.2_A1.2_T9.html956 930 957 931 # pastes a space instead of a tab -
trunk/Source/WebKit/gtk/ChangeLog
r107350 r107351 1 2012-02-09 Zan Dobersek <zandobersek@gmail.com> 2 3 [GTK] Add DRT support for modal dialogs 4 https://bugs.webkit.org/show_bug.cgi?id=53600 5 6 Reviewed by Martin Robinson. 7 8 Add support for running modal dialogs. 9 10 A new signal is added to the WebKitWebView. When emitted, the web view 11 is requesting to be displayed as a modal dialog. If accepted, the 12 ChromeClient then establishes a loop that is run until the chrome is destroyed. 13 If denied, nothing is done. 14 15 * WebCoreSupport/ChromeClientGtk.cpp: 16 (WebKit::ChromeClient::ChromeClient): 17 (WebKit::ChromeClient::chromeDestroyed): 18 (WebKit::ChromeClient::canRunModal): 19 (WebKit::ChromeClient::runModal): 20 * WebCoreSupport/ChromeClientGtk.h: 21 (ChromeClient): 22 * webkit/webkitwebview.cpp: 23 (webkit_web_view_class_init): 24 1 25 2012-02-09 Zan Dobersek <zandobersek@gmail.com> 2 26 -
trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.cpp
r106901 r107351 80 80 , m_adjustmentWatcher(webView) 81 81 , m_closeSoonTimer(0) 82 , m_modalLoop(0) 82 83 , m_displayTimer(this, &ChromeClient::paint) 83 84 , m_lastDisplayTime(0) … … 94 95 if (m_repaintSoonSourceId) 95 96 g_source_remove(m_repaintSoonSourceId); 97 98 if (m_modalLoop) 99 g_main_loop_quit(m_modalLoop); 96 100 97 101 delete this; … … 181 185 bool ChromeClient::canRunModal() 182 186 { 183 notImplemented(); 184 return false; 187 return true; 185 188 } 186 189 187 190 void ChromeClient::runModal() 188 191 { 189 notImplemented(); 192 gboolean isHandled = false; 193 g_signal_emit_by_name(m_webView, "run-modal-dialog", &isHandled); 194 if (!isHandled) 195 return; 196 197 GMainContext* threadDefaultContext = g_main_context_ref_thread_default(); 198 g_main_context_acquire(threadDefaultContext); 199 200 m_modalLoop = g_main_loop_new(threadDefaultContext, FALSE); 201 g_main_loop_run(m_modalLoop); 202 g_main_loop_unref(m_modalLoop); 203 m_modalLoop = 0; 204 205 g_main_context_release(threadDefaultContext); 206 g_main_context_unref(threadDefaultContext); 190 207 } 191 208 -
trunk/Source/WebKit/gtk/WebCoreSupport/ChromeClientGtk.h
r106901 r107351 177 177 KURL m_hoveredLinkURL; 178 178 unsigned int m_closeSoonTimer; 179 GMainLoop* m_modalLoop; 179 180 180 181 Timer <ChromeClient> m_displayTimer; -
trunk/Source/WebKit/gtk/webkit/webkitwebview.cpp
r107252 r107351 213 213 RESOURCE_CONTENT_LENGTH_RECEIVED, 214 214 RESOURCE_LOAD_FAILED, 215 RUN_MODAL_DIALOG, 215 216 216 217 LAST_SIGNAL … … 2742 2743 WEBKIT_TYPE_WEB_RESOURCE, 2743 2744 G_TYPE_POINTER); 2745 2746 /* 2747 * WebKitWebView::run-modal-dialog 2748 * @webView: the object which received the signal 2749 * 2750 * Invoked when the @webView should be run in the modal mode. This can be 2751 * avoided if FALSE is returned in the signal handler. Otherwise, the 2752 * @webView (or its toplevel window) should be made transient for its parent, 2753 * set as a modal window, and TRUE should be returned in the signal handler. 2754 * After that, a loop will be created and run until the @webView is closed 2755 * (i.e. its chrome is destroyed). 2756 * 2757 * Since: 1.7.6 2758 */ 2759 webkit_web_view_signals[RESOURCE_LOAD_FAILED] = g_signal_new("run-modal-dialog", 2760 G_TYPE_FROM_CLASS(webViewClass), 2761 G_SIGNAL_RUN_LAST, 2762 0, 2763 g_signal_accumulator_true_handled, NULL, 2764 webkit_marshal_BOOLEAN__VOID, 2765 G_TYPE_BOOLEAN, 0); 2744 2766 2745 2767 /* -
trunk/Tools/ChangeLog
r107350 r107351 1 2012-02-09 Zan Dobersek <zandobersek@gmail.com> 2 3 [GTK] Add DRT support for modal dialogs 4 https://bugs.webkit.org/show_bug.cgi?id=53600 5 6 Reviewed by Martin Robinson. 7 8 Implement the modal dialogs handling in DumpRenderTree and GtkLauncher. 9 Most significantly, when creating a new web view in GtkLauncher, the window 10 of the web view opener is passed around. In DumpRenderTree, the window of 11 the main web view is always considered as the opener. This is required so 12 the modal dialog's toplevel can be made transient for the opener's toplevel. 13 14 * DumpRenderTree/gtk/DumpRenderTree.cpp: 15 (webViewRunModalDialog): 16 (createWebView): 17 * GtkLauncher/main.c: 18 (createWebViewCb): 19 (runModalDialogCb): 20 (createBrowser): 21 (createWindow): 22 (main): 23 1 24 2012-02-09 Zan Dobersek <zandobersek@gmail.com> 2 25 -
trunk/Tools/DumpRenderTree/gtk/DumpRenderTree.cpp
r106445 r107351 958 958 } 959 959 960 static gboolean webViewRunModalDialog(WebKitWebView* view) 961 { 962 GtkWindow* viewTopLevel = GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET(view))); 963 gtk_window_set_transient_for(GTK_WINDOW(viewTopLevel), GTK_WINDOW(window)); 964 gtk_window_set_modal(GTK_WINDOW(viewTopLevel), TRUE); 965 966 return TRUE; 967 } 968 960 969 static void databaseQuotaExceeded(WebKitWebView* view, WebKitWebFrame* frame, WebKitWebDatabase *database) 961 970 { … … 1283 1292 "signal::create-web-view", webViewCreate, 0, 1284 1293 "signal::close-web-view", webViewClose, 0, 1294 "signal::run-modal-dialog", webViewRunModalDialog, 0, 1285 1295 "signal::database-quota-exceeded", databaseQuotaExceeded, 0, 1286 1296 "signal::document-load-finished", webViewDocumentLoadFinished, 0, -
trunk/Tools/GtkLauncher/main.c
r103927 r107351 34 34 static gint windowCount = 0; 35 35 36 static GtkWidget* createWindow(WebKitWebView** outWebView );36 static GtkWidget* createWindow(WebKitWebView** outWebView, GtkWidget* openerWindow); 37 37 38 38 static void activateUriEntryCb(GtkWidget* entry, gpointer data) … … 106 106 { 107 107 WebKitWebView *newWebView; 108 createWindow(&newWebView );108 createWindow(&newWebView, window); 109 109 webkit_web_view_set_settings(newWebView, webkit_web_view_get_settings(webView)); 110 110 return newWebView; … … 124 124 } 125 125 126 static GtkWidget* createBrowser(GtkWidget* window, GtkWidget* uriEntry, GtkWidget* statusbar, WebKitWebView* webView) 126 static gboolean runModalDialogCb(WebKitWebView* webView, GtkWidget* openerWindow) 127 { 128 if (!openerWindow) 129 return FALSE; 130 131 GtkWidget *window = gtk_widget_get_toplevel(GTK_WIDGET(webView)); 132 gtk_window_set_transient_for(GTK_WINDOW(window), GTK_WINDOW(openerWindow)); 133 gtk_window_set_modal(GTK_WINDOW(window), TRUE); 134 return TRUE; 135 } 136 137 static GtkWidget* createBrowser(GtkWidget* window, GtkWidget* uriEntry, GtkWidget* statusbar, WebKitWebView* webView, GtkWidget* openerWindow) 127 138 { 128 139 GtkWidget *scrolledWindow = gtk_scrolled_window_new(NULL, NULL); … … 138 149 g_signal_connect(webView, "web-view-ready", G_CALLBACK(webViewReadyCb), window); 139 150 g_signal_connect(webView, "close-web-view", G_CALLBACK(closeWebViewCb), window); 151 g_signal_connect(webView, "run-modal-dialog", G_CALLBACK(runModalDialogCb), openerWindow); 140 152 141 153 return scrolledWindow; … … 191 203 } 192 204 193 static GtkWidget* createWindow(WebKitWebView** outWebView )205 static GtkWidget* createWindow(WebKitWebView** outWebView, GtkWidget* openerWindow) 194 206 { 195 207 WebKitWebView *webView; … … 215 227 statusbar = createStatusbar(webView); 216 228 gtk_box_pack_start(GTK_BOX(vbox), createToolbar(uriEntry, webView), FALSE, FALSE, 0); 217 gtk_box_pack_start(GTK_BOX(vbox), createBrowser(window, uriEntry, statusbar, webView ), TRUE, TRUE, 0);229 gtk_box_pack_start(GTK_BOX(vbox), createBrowser(window, uriEntry, statusbar, webView, openerWindow), TRUE, TRUE, 0); 218 230 gtk_box_pack_start(GTK_BOX(vbox), statusbar, FALSE, FALSE, 0); 219 231 … … 418 430 419 431 WebKitWebView *webView; 420 GtkWidget *main_window = createWindow(&webView );432 GtkWidget *main_window = createWindow(&webView, 0); 421 433 422 434 if (webkitSettings) {
Note: See TracChangeset
for help on using the changeset viewer.