<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#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>
<title>[28496] trunk</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/28496">28496</a></dd>
<dt>Author</dt> <dd>ggaren@apple.com</dd>
<dt>Date</dt> <dd>2007-12-06 13:19:07 -0800 (Thu, 06 Dec 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>WebCore:

        Reviewed by Sam Weinig.

        Fixed http://bugs.webkit.org/show_bug.cgi?id=16328
        REGRESSION (r28470): Crash expanding a GMail conversation
        
        * page/Frame.cpp:
        (WebCore::Frame::scriptProxy): Only return 0 if JS seems disabled *and*
        we haven't created the proxy yet. If we've created the proxy already, a
        script may be in the midst of execution, even though we've lost our
        settings object. During execution, scripts assume they have free access
        to the proxy.

LayoutTests:

        Reviewed by Sam Weinig.

        Test for http://bugs.webkit.org/show_bug.cgi?id=16328
        REGRESSION (r28470): Crash expanding a GMail conversation

        * fast/frames/location-put-after-removal.html: Added.
        * fast/frames/resources/location-put-after-removal-frame.html: Added.
        * fast/frames/resources/location-put-after-removal-frame-expected.txt: Updated.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCorepageFramecpp">trunk/WebCore/page/Frame.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastframeslocationputafterremovalexpectedtxt">trunk/LayoutTests/fast/frames/location-put-after-removal-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastframeslocationputafterremovalhtml">trunk/LayoutTests/fast/frames/location-put-after-removal.html</a></li>
<li><a href="#trunkLayoutTestsfastframesresourceslocationputafterremovalframehtml">trunk/LayoutTests/fast/frames/resources/location-put-after-removal-frame.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (28495 => 28496)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2007-12-06 21:17:05 UTC (rev 28495)
+++ trunk/LayoutTests/ChangeLog        2007-12-06 21:19:07 UTC (rev 28496)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2007-12-06  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Reviewed by Sam Weinig.
+
+        Test for http://bugs.webkit.org/show_bug.cgi?id=16328
+        REGRESSION (r28470): Crash expanding a GMail conversation
+
+        * fast/frames/location-put-after-removal.html: Added.
+        * fast/frames/resources/location-put-after-removal-frame.html: Added.
+        * fast/frames/resources/location-put-after-removal-frame-expected.txt: Updated.
+
</ins><span class="cx"> 2007-12-06  Darin Adler  &lt;darin@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Eric Seidel.
</span></span></pre></div>
<a id="trunkLayoutTestsfastframeslocationputafterremovalexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/frames/location-put-after-removal-expected.txt (0 => 28496)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/frames/location-put-after-removal-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/frames/location-put-after-removal-expected.txt        2007-12-06 21:19:07 UTC (rev 28496)
</span><span class="lines">@@ -0,0 +1,5 @@
</span><ins>+This page tests for a crash when assigning to the location property of a window whose frame has been removed from the document. See http://bugs.webkit.org/show_bug.cgi?id=16328.
+
+If the test passes, you'll see a PASS message below.
+
+PASS: You didn't crash.
</ins></span></pre></div>
<a id="trunkLayoutTestsfastframeslocationputafterremovalhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/frames/location-put-after-removal.html (0 => 28496)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/frames/location-put-after-removal.html                                (rev 0)
+++ trunk/LayoutTests/fast/frames/location-put-after-removal.html        2007-12-06 21:19:07 UTC (rev 28496)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;p&gt;This page tests for a crash when assigning to the location property of a window
+whose frame has been removed from the document. See &lt;a href=&quot;http://bugs.webkit.org/show_bug.cgi?id=16328&quot;&gt;
+http://bugs.webkit.org/show_bug.cgi?id=16328&lt;/a&gt;.&lt;/p&gt;
+&lt;p&gt;If the test passes, you'll see a PASS message below.&lt;/p&gt;
+
+&lt;script&gt;
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+&lt;/script&gt;
+
+&lt;iframe src=&quot;resources/location-put-after-removal-frame.html&quot;&gt;&lt;/iframe&gt;
+&lt;div&gt;PASS: You didn't crash.&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastframesresourceslocationputafterremovalframehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/frames/resources/location-put-after-removal-frame.html (0 => 28496)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/frames/resources/location-put-after-removal-frame.html                                (rev 0)
+++ trunk/LayoutTests/fast/frames/resources/location-put-after-removal-frame.html        2007-12-06 21:19:07 UTC (rev 28496)
</span><span class="lines">@@ -0,0 +1,4 @@
</span><ins>+&lt;script&gt;
+frameElement.parentNode.removeChild(frameElement);
+location = &quot;&quot;;
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (28495 => 28496)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2007-12-06 21:17:05 UTC (rev 28495)
+++ trunk/WebCore/ChangeLog        2007-12-06 21:19:07 UTC (rev 28496)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2007-12-06  Geoffrey Garen  &lt;ggaren@apple.com&gt;
+
+        Reviewed by Sam Weinig.
+
+        Fixed http://bugs.webkit.org/show_bug.cgi?id=16328
+        REGRESSION (r28470): Crash expanding a GMail conversation
+        
+        * page/Frame.cpp:
+        (WebCore::Frame::scriptProxy): Only return 0 if JS seems disabled *and*
+        we haven't created the proxy yet. If we've created the proxy already, a
+        script may be in the midst of execution, even though we've lost our
+        settings object. During execution, scripts assume they have free access
+        to the proxy.
+
</ins><span class="cx"> 2007-12-06  Adele Peterson  &lt;adele@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Oliver.
</span></span></pre></div>
<a id="trunkWebCorepageFramecpp"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/page/Frame.cpp (28495 => 28496)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/page/Frame.cpp        2007-12-06 21:17:05 UTC (rev 28495)
+++ trunk/WebCore/page/Frame.cpp        2007-12-06 21:19:07 UTC (rev 28496)
</span><span class="lines">@@ -252,13 +252,11 @@
</span><span class="cx"> 
</span><span class="cx"> KJSProxy *Frame::scriptProxy()
</span><span class="cx"> {
</span><del>-    Settings* settings = this-&gt;settings();
-    if (!settings || !settings-&gt;isJavaScriptEnabled())
-        return 0;
-
-    if (!d-&gt;m_jscript)
-        d-&gt;m_jscript = new KJSProxy(this);
-
</del><ins>+    if (!d-&gt;m_jscript) {
+        Settings* settings = this-&gt;settings();
+        if (settings &amp;&amp; settings-&gt;isJavaScriptEnabled())
+            d-&gt;m_jscript = new KJSProxy(this);
+    }
</ins><span class="cx">     return d-&gt;m_jscript;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>