+2012-02-08 Carlos Garcia Campos <cgarcia@igalia.com>
+
+ [GTK] Fix a crash when WebKitWebView is created without a WebContext
+ https://bugs.webkit.org/show_bug.cgi?id=78104
+
+ Reviewed by Philippe Normand.
+
+ * UIProcess/API/gtk/WebKitWebView.cpp:
+ (webkitWebViewSetProperty): Make sure WebKitWebView:web-context
+ property is initialized to the default web context when a web
+ context is not passed to g_object_new().
+ * UIProcess/API/gtk/tests/TestWebKitWebView.cpp:
+ (testWebViewDefaultContext): Check that a web view created with
+ g_object_new has the default context.
+
2012-02-08 Michael BrĂ¼ning <michael.bruning@nokia.com>
[Qt][WK2] Compute and set cache capacities using the current CacheModel
WebKitWebView* webView = WEBKIT_WEB_VIEW(object);
switch (propId) {
- case PROP_WEB_CONTEXT:
- webView->priv->context = WEBKIT_WEB_CONTEXT(g_value_get_object(value));
+ case PROP_WEB_CONTEXT: {
+ gpointer webContext = g_value_get_object(value);
+ webView->priv->context = webContext ? WEBKIT_WEB_CONTEXT(webContext) : webkit_web_context_get_default();
break;
+ }
case PROP_ZOOM_LEVEL:
webkit_web_view_set_zoom_level(webView, g_value_get_double(value));
break;
static void testWebViewDefaultContext(WebViewTest* test, gconstpointer)
{
g_assert(webkit_web_view_get_context(test->m_webView) == webkit_web_context_get_default());
+
+ // Check that a web view created with g_object_new has the default context.
+ GRefPtr<WebKitWebView> webView = WEBKIT_WEB_VIEW(g_object_new(WEBKIT_TYPE_WEB_VIEW, NULL));
+ g_assert(webkit_web_view_get_context(webView.get()) == webkit_web_context_get_default());
}
static void testWebViewCustomCharset(WebViewTest* test, gconstpointer)