[SCM] WebKit Debian packaging branch, webkit-1.1, updated. upstream/1.1.22-985-g3c00f00
kov at webkit.org
kov at webkit.org
Wed Mar 17 17:59:28 UTC 2010
The following commit has been merged in the webkit-1.1 branch:
commit 367e5f04344ac20291367431f58ac4cbe9353475
Author: kov at webkit.org <kov at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Thu Feb 25 18:18:02 2010 +0000
2010-02-25 Gustavo Noronha Silva <gustavo.noronha at collabora.co.uk>
Reviewed by Xan Lopez.
[Gtk] crashed when destroying
https://bugs.webkit.org/show_bug.cgi?id=31271
NULL-check the page before relaying the focus out event, since
this might happen when destroying the widget without destroying
its parent, and we currently crash.
* tests/testwebview.c:
(delayed_destroy):
(test_webkit_web_view_destroy):
(main):
* webkit/webkitwebview.cpp:
(webkit_web_view_focus_in_event):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@55245 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index aac23a4..04080ea 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,21 @@
+2010-02-25 Gustavo Noronha Silva <gustavo.noronha at collabora.co.uk>
+
+ Reviewed by Xan Lopez.
+
+ [Gtk] crashed when destroying
+ https://bugs.webkit.org/show_bug.cgi?id=31271
+
+ NULL-check the page before relaying the focus out event, since
+ this might happen when destroying the widget without destroying
+ its parent, and we currently crash.
+
+ * tests/testwebview.c:
+ (delayed_destroy):
+ (test_webkit_web_view_destroy):
+ (main):
+ * webkit/webkitwebview.cpp:
+ (webkit_web_view_focus_in_event):
+
2010-02-24 Krzysztof Kotlenga <pocek at users.sf.net>
Reviewed by Gustavo Noronha Silva.
diff --git a/WebKit/gtk/tests/testwebview.c b/WebKit/gtk/tests/testwebview.c
index ceac8a0..8c61afe 100644
--- a/WebKit/gtk/tests/testwebview.c
+++ b/WebKit/gtk/tests/testwebview.c
@@ -1,6 +1,6 @@
/*
* Copyright (C) 2008 Holger Hans Peter Freyther
- * Copyright (C) 2009 Collabora Ltd.
+ * Copyright (C) 2009, 2010 Collabora Ltd.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
@@ -226,6 +226,37 @@ static void test_webkit_web_view_adjustments()
do_test_webkit_web_view_adjustments(TRUE);
}
+gboolean delayed_destroy(gpointer data)
+{
+ gtk_widget_destroy(GTK_WIDGET(data));
+ g_main_loop_quit(loop);
+ return FALSE;
+}
+
+static void test_webkit_web_view_destroy()
+{
+ GtkWidget* window;
+ GtkWidget* web_view;
+
+ window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+ web_view = webkit_web_view_new();
+
+ gtk_container_add(GTK_CONTAINER(window), web_view);
+
+ gtk_widget_show_all(window);
+
+ loop = g_main_loop_new(NULL, TRUE);
+
+ g_signal_connect(window, "map-event",
+ G_CALLBACK(map_event_cb), loop);
+ g_main_loop_run(loop);
+
+ g_idle_add(delayed_destroy, web_view);
+ g_main_loop_run(loop);
+
+ gtk_widget_destroy(window);
+}
+
int main(int argc, char** argv)
{
SoupServer* server;
@@ -251,6 +282,7 @@ int main(int argc, char** argv)
g_test_bug_base("https://bugs.webkit.org/");
g_test_add_func("/webkit/webview/icon-uri", test_webkit_web_view_icon_uri);
g_test_add_func("/webkit/webview/adjustments", test_webkit_web_view_adjustments);
+ g_test_add_func("/webkit/webview/destroy", test_webkit_web_view_destroy);
return g_test_run ();
}
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index 16c9477..993cd3a 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -6,7 +6,7 @@
* Copyright (C) 2008 Jan Alonzo <jmalonzo at unpluggable.com>
* Copyright (C) 2008 Gustavo Noronha Silva <gns at gnome.org>
* Copyright (C) 2008 Nuanti Ltd.
- * Copyright (C) 2008, 2009 Collabora Ltd.
+ * Copyright (C) 2008, 2009, 2010 Collabora Ltd.
* Copyright (C) 2009 Igalia S.L.
* Copyright (C) 2009 Movial Creative Technologies Inc.
* Copyright (C) 2009 Bobby Powers
@@ -676,8 +676,13 @@ static gboolean webkit_web_view_focus_out_event(GtkWidget* widget, GdkEventFocus
{
WebKitWebView* webView = WEBKIT_WEB_VIEW(widget);
- core(webView)->focusController()->setActive(false);
- core(webView)->focusController()->setFocused(false);
+ // We may hit this code while destroying the widget, and we might
+ // no longer have a page, then.
+ Page* page = core(webView);
+ if (page) {
+ page->focusController()->setActive(false);
+ page->focusController()->setFocused(false);
+ }
return GTK_WIDGET_CLASS(webkit_web_view_parent_class)->focus_out_event(widget, event);
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list