<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>32441</bug_id>
          
          <creation_ts>2009-12-11 11:07:19 -0800</creation_ts>
          <short_desc>[GTK] Fails fast/parser/xhtml-close-while-parsing.xhtml</short_desc>
          <delta_ts>2011-02-08 12:31:28 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebKitGTK</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>Gtk</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Gustavo Noronha (kov)">gustavo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>mrobinson</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>170840</commentid>
    <comment_count>0</comment_count>
    <who name="Gustavo Noronha (kov)">gustavo</who>
    <bug_when>2009-12-11 11:07:19 -0800</bug_when>
    <thetext>This test fails because, javascript stops execution when we destroy the WebView, here:

    window.close();
    if (window.layoutTestController)
        layoutTestController.notifyDone();

The notifyDone() call is never reached. If we delay the destruction of the webView with g_idle_add the test passes (see diff bellow). The problem is that, with that change, another test starts failing: fast/dom/location-new-window-no-crash.html. It fails because the webView is not destroyed when it checks for it:

testWindow.close();

if (window.layoutTestController) {
    function doneHandler()
    {
        if (testWindow.closed) {
            layoutTestController.notifyDone();
            return;
        }
        setTimeout(doneHandler, 0);
    }
    doneHandler();
}

We are either doing something wrong in our WebView destruction code, or this setTimeout-based loop is not letting the mainloop run. No clue what to do, so I&apos;ll skip the test that is failing right now.


diff --git a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
index fd1e3c6..178e2af 100644
--- a/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
+++ b/WebKitTools/DumpRenderTree/gtk/DumpRenderTree.cpp
@@ -694,13 +694,25 @@ static void webViewStatusBarTextChanged(WebKitWebView* vie
w, const gchar* messag
     }
 }
 
-static gboolean webViewClose(WebKitWebView* view)
+static gboolean webViewCloseReal(gpointer data)
 {
-    ASSERT(view);
+    WebKitWebView* view = static_cast&lt;WebKitWebView*&gt;(data);
 
     webViewList = g_slist_remove(webViewList, view);
     g_object_unref(view);
 
+    return FALSE;
+}
+
+static gboolean webViewClose(WebKitWebView* view)
+{
+    ASSERT(view);
+
+    // If we destroy the view here, the rest of the test&apos;s script has
+    // no chance to run, which may cause notifyDone() to not be
+    // called, so schedule its destruction.
+    g_idle_add(webViewCloseReal, view);
+
     return TRUE;
 }</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>347597</commentid>
    <comment_count>1</comment_count>
    <who name="Martin Robinson">mrobinson</who>
    <bug_when>2011-02-08 12:31:28 -0800</bug_when>
    <thetext>I unskipped this one and it&apos;s passing now. Closing.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>