<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[56217] trunk/WebKit/gtk</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/56217">56217</a></dd>
<dt>Author</dt> <dd>eric@webkit.org</dd>
<dt>Date</dt> <dd>2010-03-18 23:46:42 -0700 (Thu, 18 Mar 2010)</dd>
</dl>

<h3>Log Message</h3>
<pre>2010-03-18  Philip Chimento  &lt;philip.chimento@gmail.com&gt;

        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.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebKitgtkChangeLog">trunk/WebKit/gtk/ChangeLog</a></li>
<li><a href="#trunkWebKitgtkteststestwebviewc">trunk/WebKit/gtk/tests/testwebview.c</a></li>
<li><a href="#trunkWebKitgtkwebkitwebkitwebviewcpp">trunk/WebKit/gtk/webkit/webkitwebview.cpp</a></li>
<li><a href="#trunkWebKitgtkwebkitwebkitwebwindowfeaturescpp">trunk/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebKitgtkChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/ChangeLog (56216 => 56217)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/ChangeLog        2010-03-19 06:46:10 UTC (rev 56216)
+++ trunk/WebKit/gtk/ChangeLog        2010-03-19 06:46:42 UTC (rev 56217)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2010-03-18  Philip Chimento  &lt;philip.chimento@gmail.com&gt;
+
+        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.
+
</ins><span class="cx"> 2010-03-16  Xan Lopez  &lt;xlopez@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Gustavo Noronha.
</span></span></pre></div>
<a id="trunkWebKitgtkteststestwebviewc"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/tests/testwebview.c (56216 => 56217)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/tests/testwebview.c        2010-03-19 06:46:10 UTC (rev 56216)
+++ trunk/WebKit/gtk/tests/testwebview.c        2010-03-19 06:46:42 UTC (rev 56217)
</span><span class="lines">@@ -312,6 +312,30 @@
</span><span class="cx">     gtk_widget_destroy(window);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+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, &quot;map-event&quot;,
+                     G_CALLBACK(map_event_cb), loop);
+    g_main_loop_run(loop);
+    
+    /* Bug #36144 */
+    g_object_set(G_OBJECT(web_view), &quot;window-features&quot;, NULL, NULL);
+    
+    gtk_widget_destroy(window);
+}    
+
</ins><span class="cx"> int main(int argc, char** argv)
</span><span class="cx"> {
</span><span class="cx">     SoupServer* server;
</span><span class="lines">@@ -339,6 +363,7 @@
</span><span class="cx">     g_test_add_func(&quot;/webkit/webview/adjustments&quot;, test_webkit_web_view_adjustments);
</span><span class="cx">     g_test_add_func(&quot;/webkit/webview/destroy&quot;, test_webkit_web_view_destroy);
</span><span class="cx">     g_test_add_func(&quot;/webkit/webview/grab_focus&quot;, test_webkit_web_view_grab_focus);
</span><ins>+    g_test_add_func(&quot;/webkit/webview/window-features&quot;, test_webkit_web_view_window_features);
</ins><span class="cx"> 
</span><span class="cx">     return g_test_run ();
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkWebKitgtkwebkitwebkitwebviewcpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/webkit/webkitwebview.cpp (56216 => 56217)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/webkit/webkitwebview.cpp        2010-03-19 06:46:10 UTC (rev 56216)
+++ trunk/WebKit/gtk/webkit/webkitwebview.cpp        2010-03-19 06:46:42 UTC (rev 56217)
</span><span class="lines">@@ -3014,8 +3014,11 @@
</span><span class="cx"> static void webkit_web_view_set_window_features(WebKitWebView* webView, WebKitWebWindowFeatures* webWindowFeatures)
</span><span class="cx"> {
</span><span class="cx">     WebKitWebViewPrivate* priv = webView-&gt;priv;
</span><ins>+    
+    if (!webWindowFeatures)
+      return;
</ins><span class="cx"> 
</span><del>-    if(webkit_web_window_features_equal(priv-&gt;webWindowFeatures, webWindowFeatures))
</del><ins>+    if (webkit_web_window_features_equal(priv-&gt;webWindowFeatures, webWindowFeatures))
</ins><span class="cx">       return;
</span><span class="cx"> 
</span><span class="cx">     g_object_unref(priv-&gt;webWindowFeatures);
</span></span></pre></div>
<a id="trunkWebKitgtkwebkitwebkitwebwindowfeaturescpp"></a>
<div class="modfile"><h4>Modified: trunk/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp (56216 => 56217)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp        2010-03-19 06:46:10 UTC (rev 56216)
+++ trunk/WebKit/gtk/webkit/webkitwebwindowfeatures.cpp        2010-03-19 06:46:42 UTC (rev 56217)
</span><span class="lines">@@ -422,19 +422,24 @@
</span><span class="cx">  */
</span><span class="cx"> gboolean webkit_web_window_features_equal(WebKitWebWindowFeatures* features1, WebKitWebWindowFeatures* features2)
</span><span class="cx"> {
</span><ins>+    if (features1 == features2)
+        return TRUE;
+    if (!features1 || !features2)
+        return FALSE; 
+    
</ins><span class="cx">     WebKitWebWindowFeaturesPrivate* priv1 = features1-&gt;priv;
</span><span class="cx">     WebKitWebWindowFeaturesPrivate* priv2 = features2-&gt;priv;
</span><span class="cx"> 
</span><del>-    if((priv1-&gt;x == priv2-&gt;x) &amp;&amp;
-       (priv1-&gt;y == priv2-&gt;y) &amp;&amp;
-       (priv1-&gt;width == priv2-&gt;width) &amp;&amp;
-       (priv1-&gt;height == priv2-&gt;height) &amp;&amp;
-       (priv1-&gt;toolbar_visible == priv2-&gt;toolbar_visible) &amp;&amp;
-       (priv1-&gt;statusbar_visible == priv2-&gt;statusbar_visible) &amp;&amp;
-       (priv1-&gt;scrollbar_visible == priv2-&gt;scrollbar_visible) &amp;&amp;
-       (priv1-&gt;menubar_visible == priv2-&gt;menubar_visible) &amp;&amp;
-       (priv1-&gt;locationbar_visible == priv2-&gt;locationbar_visible) &amp;&amp;
-       (priv1-&gt;fullscreen == priv2-&gt;fullscreen))
</del><ins>+    if ((priv1-&gt;x == priv2-&gt;x)
+        &amp;&amp; (priv1-&gt;y == priv2-&gt;y)
+        &amp;&amp; (priv1-&gt;width == priv2-&gt;width)
+        &amp;&amp; (priv1-&gt;height == priv2-&gt;height)
+        &amp;&amp; (priv1-&gt;toolbar_visible == priv2-&gt;toolbar_visible)
+        &amp;&amp; (priv1-&gt;statusbar_visible == priv2-&gt;statusbar_visible)
+        &amp;&amp; (priv1-&gt;scrollbar_visible == priv2-&gt;scrollbar_visible)
+        &amp;&amp; (priv1-&gt;menubar_visible == priv2-&gt;menubar_visible)
+        &amp;&amp; (priv1-&gt;locationbar_visible == priv2-&gt;locationbar_visible)
+        &amp;&amp; (priv1-&gt;fullscreen == priv2-&gt;fullscreen))
</ins><span class="cx">         return TRUE;
</span><span class="cx">     return FALSE;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>