Jacek Caban : mshtml: Avoid asynchronous parse_complete call.

Alexandre Julliard julliard at winehq.org
Wed Aug 18 12:10:00 CDT 2010


Module: wine
Branch: master
Commit: 8507db18a88a176a91ec6cc73f91a726de89e255
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=8507db18a88a176a91ec6cc73f91a726de89e255

Author: Jacek Caban <jacek at codeweavers.com>
Date:   Wed Aug 18 13:39:29 2010 +0200

mshtml: Avoid asynchronous parse_complete call.

---

 dlls/mshtml/mutation.c |   29 ++++++++---------------------
 1 files changed, 8 insertions(+), 21 deletions(-)

diff --git a/dlls/mshtml/mutation.c b/dlls/mshtml/mutation.c
index 8cf43fb..edcb2cc 100644
--- a/dlls/mshtml/mutation.c
+++ b/dlls/mshtml/mutation.c
@@ -312,10 +312,8 @@ static void call_explorer_69(HTMLDocumentObj *doc)
         FIXME("handle result\n");
 }
 
-static void parse_complete_proc(task_t *task)
+static void parse_complete(HTMLDocumentObj *doc)
 {
-    HTMLDocumentObj *doc = ((docobj_task_t*)task)->doc;
-
     TRACE("(%p)\n", doc);
 
     if(doc->usermode == EDITMODE)
@@ -328,35 +326,24 @@ static void parse_complete_proc(task_t *task)
     call_explorer_69(doc);
 
     /* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
-
-    set_ready_state(doc->basedoc.window, READYSTATE_INTERACTIVE);
 }
 
 static void handle_end_load(HTMLDocumentNode *This)
 {
-    docobj_task_t *task;
-
     TRACE("\n");
 
     if(!This->basedoc.doc_obj)
         return;
 
-    if(This != This->basedoc.doc_obj->basedoc.doc_node) {
-        set_ready_state(This->basedoc.window, READYSTATE_INTERACTIVE);
-        return;
+    if(This == This->basedoc.doc_obj->basedoc.doc_node) {
+        /*
+         * This should be done in the worker thread that parses HTML,
+         * but we don't have such thread (Gecko parses HTML for us).
+         */
+        parse_complete(This->basedoc.doc_obj);
     }
 
-    task = heap_alloc(sizeof(docobj_task_t));
-    if(!task)
-        return;
-
-    task->doc = This->basedoc.doc_obj;
-
-    /*
-     * This should be done in the worker thread that parses HTML,
-     * but we don't have such thread (Gecko parses HTML for us).
-     */
-    push_task(&task->header, &parse_complete_proc, This->basedoc.doc_obj->basedoc.task_magic);
+    set_ready_state(This->basedoc.window, READYSTATE_INTERACTIVE);
 }
 
 static nsresult NSAPI nsRunnable_Run(nsIRunnable *iface)




More information about the wine-cvs mailing list