[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

Gustavo Noronha Silva gns at gnome.org
Thu Apr 8 02:24:14 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 7bda3837b1495e516383bab44b6095f1c1ae38da
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Mar 19 06:46:42 2010 +0000

    2010-03-18  Philip Chimento  <philip.chimento at gmail.com>
    
            Reviewed by Oliver Hunt.
    
            Setting the GObject WebKitWebView property 'window-features' to NULL
            causes a crash.
            https://bugs.webkit.org/show_bug.cgi?id=36144
    
            * tests/testwebview.c: Add unit test for this bug.
            * webkit/webkitwebview.cpp: Don't allow the 'window-features' property
            to be set to NULL.
            * webkit/webkitwebwindowfeatures.cpp:
            (webkit_web_window_features_equal): Don't examine the members of either
            web_window_features argument if either is NULL, just return that they
            are not equal. Additionally, if they are the same object, return that
            they are equal.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@56217 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/gtk/ChangeLog b/WebKit/gtk/ChangeLog
index d003c8d..4589719 100644
--- a/WebKit/gtk/ChangeLog
+++ b/WebKit/gtk/ChangeLog
@@ -1,3 +1,20 @@
+2010-03-18  Philip Chimento  <philip.chimento at gmail.com>
+
+        Reviewed by Oliver Hunt.
+
+        Setting the GObject WebKitWebView property 'window-features' to NULL
+        causes a crash. 
+        https://bugs.webkit.org/show_bug.cgi?id=36144
+
+        * tests/testwebview.c: Add unit test for this bug.
+        * webkit/webkitwebview.cpp: Don't allow the 'window-features' property
+        to be set to NULL.
+        * webkit/webkitwebwindowfeatures.cpp: 
+        (webkit_web_window_features_equal): Don't examine the members of either
+        web_window_features argument if either is NULL, just return that they
+        are not equal. Additionally, if they are the same object, return that 
+        they are equal.
+
 2010-03-16  Xan Lopez  <xlopez at igalia.com>
 
         Reviewed by Gustavo Noronha.
diff --git a/WebKit/gtk/tests/testwebview.c b/WebKit/gtk/tests/testwebview.c
index bd35122..36511d7 100644
--- a/WebKit/gtk/tests/testwebview.c
+++ b/WebKit/gtk/tests/testwebview.c
@@ -312,6 +312,30 @@ static void test_webkit_web_view_destroy()
     gtk_widget_destroy(window);
 }
 
+static void test_webkit_web_view_window_features()
+{
+    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);
+    
+    /* Bug #36144 */
+    g_object_set(G_OBJECT(web_view), "window-features", NULL, NULL);
+    
+    gtk_widget_destroy(window);
+}    
+
 int main(int argc, char** argv)
 {
     SoupServer* server;
@@ -339,6 +363,7 @@ int main(int argc, char** argv)
     g_test_add_func("/webkit/webview/adjustments", test_webkit_web_view_adjustments);
     g_test_add_func("/webkit/webview/destroy", test_webkit_web_view_destroy);
     g_test_add_func("/webkit/webview/grab_focus", test_webkit_web_view_grab_focus);
+    g_test_add_func("/webkit/webview/window-features", test_webkit_web_view_window_features);
 
     return g_test_run ();
 }
diff --git a/WebKit/gtk/webkit/webkitwebview.cpp b/WebKit/gtk/webkit/webkitwebview.cpp
index a2ba221..d8e854b 100644
--- a/WebKit/gtk/webkit/webkitwebview.cpp
+++ b/WebKit/gtk/webkit/webkitwebview.cpp
@@ -3014,8 +3014,11 @@ WebKitWebInspector* webkit_web_view_get_inspector(WebKitWebView* webView)
 static void webkit_web_view_set_window_features(WebKitWebView* webView, WebKitWebWindowFeatures* webWindowFeatures)
 {
     WebKitWebViewPrivate* priv = webView->priv;
+    
+    if (!webWindowFeatures)
+      return;
 
-    if(webkit_web_window_features_equal(priv->webWindowFeatures, webWindowFeatures))
+    if (webkit_web_window_features_equal(priv->webWindowFeatures, webWindowFeatures))
       return;
 
     g_object_unref(priv->webWindowFeatures);
diff --git a/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp b/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
index cdb6858..a6fe1df 100644
--- a/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
+++ b/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp
@@ -422,19 +422,24 @@ WebKitWebWindowFeatures* webkit_web_window_features_new_from_core_features(const
  */
 gboolean webkit_web_window_features_equal(WebKitWebWindowFeatures* features1, WebKitWebWindowFeatures* features2)
 {
+    if (features1 == features2)
+        return TRUE;
+    if (!features1 || !features2)
+        return FALSE; 
+    
     WebKitWebWindowFeaturesPrivate* priv1 = features1->priv;
     WebKitWebWindowFeaturesPrivate* priv2 = features2->priv;
 
-    if((priv1->x == priv2->x) &&
-       (priv1->y == priv2->y) &&
-       (priv1->width == priv2->width) &&
-       (priv1->height == priv2->height) &&
-       (priv1->toolbar_visible == priv2->toolbar_visible) &&
-       (priv1->statusbar_visible == priv2->statusbar_visible) &&
-       (priv1->scrollbar_visible == priv2->scrollbar_visible) &&
-       (priv1->menubar_visible == priv2->menubar_visible) &&
-       (priv1->locationbar_visible == priv2->locationbar_visible) &&
-       (priv1->fullscreen == priv2->fullscreen))
+    if ((priv1->x == priv2->x)
+        && (priv1->y == priv2->y)
+        && (priv1->width == priv2->width)
+        && (priv1->height == priv2->height)
+        && (priv1->toolbar_visible == priv2->toolbar_visible)
+        && (priv1->statusbar_visible == priv2->statusbar_visible)
+        && (priv1->scrollbar_visible == priv2->scrollbar_visible)
+        && (priv1->menubar_visible == priv2->menubar_visible)
+        && (priv1->locationbar_visible == priv2->locationbar_visible)
+        && (priv1->fullscreen == priv2->fullscreen))
         return TRUE;
     return FALSE;
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list