Changeset 108278 in webkit
- Timestamp:
- Feb 20, 2012 6:04:29 PM (12 years ago)
- Location:
- trunk/Source
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r108276 r108278 1 2012-02-20 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] Web content oftens steals focus from other widgets 4 https://bugs.webkit.org/show_bug.cgi?id=77791 5 6 Reviewed by Gustavo Noronha Silva. 7 8 * platform/gtk/WidgetGtk.cpp: 9 (WebCore::Widget::setFocus): No longer do anything special to try 10 to grab "real" widget focus. This matches the behavior on Qt. 11 * plugins/gtk/PluginViewGtk.cpp: 12 (WebCore::PluginView::setFocus): Moved the focus handling to here. 13 This ensures that behavior for plugins does not change. 14 1 15 2012-02-20 Yael Aharon <yael.aharon@nokia.com> 2 16 -
trunk/Source/WebCore/platform/gtk/WidgetGtk.cpp
r88696 r108278 59 59 void Widget::setFocus(bool focused) 60 60 { 61 if (!focused)62 return;63 64 GtkWidget* widget = platformWidget() ? platformWidget() : root()->hostWindow()->platformPageClient();65 if (widget) {66 gtk_widget_grab_focus(widget);67 return;68 }69 70 // We are running WK2.71 if (Frame* frame = Frame::frameForWidget(this))72 frame->page()->chrome()->focus();73 61 } 74 62 -
trunk/Source/WebCore/plugins/gtk/PluginViewGtk.cpp
r106155 r108278 166 166 { 167 167 ASSERT(platformPluginWidget() == platformWidget()); 168 if (focused && platformWidget()) 169 gtk_widget_grab_focus(platformWidget()); 168 170 Widget::setFocus(focused); 169 171 } -
trunk/Source/WebKit/gtk/ChangeLog
r108264 r108278 1 2012-02-20 Martin Robinson <mrobinson@igalia.com> 2 3 [GTK] Web content oftens steals focus from other widgets 4 https://bugs.webkit.org/show_bug.cgi?id=77791 5 6 Reviewed by Gustavo Noronha Silva. 7 8 * tests/testwebview.c: Added a WebKit1 test to verify this behavior. 9 1 10 2012-02-20 Gustavo Noronha Silva <gns@gnome.org> 2 11 -
trunk/Source/WebKit/gtk/tests/testwebview.c
r106559 r108278 383 383 } 384 384 385 static void test_webkit_web_view_does_not_steal_focus() 386 { 387 loop = g_main_loop_new(NULL, TRUE); 388 389 GtkWidget *window = gtk_offscreen_window_new(); 390 GtkWidget *webView = webkit_web_view_new(); 391 GtkWidget *entry = gtk_entry_new(); 392 GtkWidget *box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 0); 393 394 gtk_container_add(GTK_CONTAINER(box), webView); 395 gtk_container_add(GTK_CONTAINER(box), entry); 396 gtk_container_add(GTK_CONTAINER(window), box); 397 gtk_widget_show_all(window); 398 399 gtk_widget_grab_focus(entry); 400 g_assert(gtk_widget_is_focus(entry)); 401 402 g_signal_connect(webView, "notify::load-status", G_CALLBACK(idle_quit_loop_cb), NULL); 403 webkit_web_view_load_html_string(WEBKIT_WEB_VIEW(webView), 404 "<html><body>" 405 " <input id=\"entry\" type=\"text\"/>" 406 " <script>" 407 " document.getElementById(\"entry\").focus();" 408 " </script>" 409 "</body></html>", "file://"); 410 411 g_main_loop_run(loop); 412 413 g_assert(gtk_widget_is_focus(entry)); 414 415 gtk_widget_destroy(window); 416 g_main_loop_unref(loop); 417 } 418 385 419 int main(int argc, char** argv) 386 420 { … … 411 445 g_test_add_func("/webkit/webview/window-features", test_webkit_web_view_window_features); 412 446 g_test_add_func("/webkit/webview/webview-in-offscreen-window-does-not-crash", test_webkit_web_view_in_offscreen_window_does_not_crash); 447 g_test_add_func("/webkit/webview/webview-does-not-steal-focus", test_webkit_web_view_does_not_steal_focus); 413 448 414 449 return g_test_run ();
Note: See TracChangeset
for help on using the changeset viewer.