mshtml: Moved bscallback to HTMLWindow.
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index 134b108..05295f1 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c
@@ -1886,7 +1886,6 @@ TRACE("(%p) ref = %u\n", This, ref); if(!ref) { - set_document_bscallback(&This->basedoc, NULL); set_current_mon(&This->basedoc, NULL); if(This->basedoc.doc_node) { This->basedoc.doc_node->basedoc.doc_obj = NULL;
diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index d760658..08f1139 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c
@@ -158,6 +158,7 @@ if(!ref) { DWORD i; + set_window_bscallback(This, NULL); window_set_docnode(This, NULL); release_children(This);
diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index ed62cad..d7b5413 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h
@@ -219,6 +219,8 @@ nsIDOMWindow *nswindow; HTMLWindow *parent; + nsChannelBSC *bscallback; + event_target_t *event_target; IHTMLEventObj *event; BOOL *event_vector; @@ -358,7 +360,6 @@ DWORD update; /* FIXME: probably should be in document node object */ - nsChannelBSC *bscallback; IMoniker *mon; LPOLESTR url; struct list bindings; @@ -658,7 +659,7 @@ void add_nsevent_listener(HTMLWindow*,LPCWSTR); nsresult get_nsinterface(nsISupports*,REFIID,void**); -void set_document_bscallback(HTMLDocument*,nsChannelBSC*); +void set_window_bscallback(HTMLWindow*,nsChannelBSC*); void set_current_mon(HTMLDocument*,IMoniker*); HRESULT start_binding(HTMLDocument*,BSCallback*,IBindCtx*); void detach_document_bindings(HTMLDocumentObj*);
diff --git a/dlls/mshtml/navigate.c b/dlls/mshtml/navigate.c index 33bf1c1..4f0e60e 100644 --- a/dlls/mshtml/navigate.c +++ b/dlls/mshtml/navigate.c
@@ -951,7 +951,7 @@ on_start_nsrequest(This); /* events are reset when a new document URI is loaded, so re-initialise them here */ - if(This->bsc.doc && This->bsc.doc->doc_obj->bscallback == This && This->bsc.doc->doc_obj->nscontainer) { + if(This->bsc.doc && This->bsc.doc->window->bscallback == This && This->bsc.doc->doc_obj->nscontainer) { update_window_doc(This->bsc.doc->window); init_nsevents(This->bsc.doc->doc_obj->nscontainer); } @@ -1107,27 +1107,29 @@ return This->bsc.mon; } -void set_document_bscallback(HTMLDocument *doc, nsChannelBSC *callback) +void set_window_bscallback(HTMLWindow *window, nsChannelBSC *callback) { BSCallback *iter; - if(doc->doc_obj->bscallback) { - if(doc->doc_obj->bscallback->bsc.binding) - IBinding_Abort(doc->doc_obj->bscallback->bsc.binding); - doc->doc_obj->bscallback->bsc.doc = NULL; - IBindStatusCallback_Release(STATUSCLB(&doc->doc_obj->bscallback->bsc)); + if(window->bscallback) { + if(window->bscallback->bsc.binding) + IBinding_Abort(window->bscallback->bsc.binding); + window->bscallback->bsc.doc = NULL; + IBindStatusCallback_Release(STATUSCLB(&window->bscallback->bsc)); } - LIST_FOR_EACH_ENTRY(iter, &doc->doc_obj->bindings, BSCallback, entry) { - iter->doc = NULL; - list_remove(&iter->entry); + if(window->doc_obj) { + LIST_FOR_EACH_ENTRY(iter, &window->doc_obj->bindings, BSCallback, entry) { + iter->doc = NULL; + list_remove(&iter->entry); + } } - doc->doc_obj->bscallback = callback; + window->bscallback = callback; if(callback) { IBindStatusCallback_AddRef(STATUSCLB(&callback->bsc)); - callback->bsc.doc = doc; + callback->bsc.doc = &window->doc_obj->basedoc; } }
diff --git a/dlls/mshtml/persist.c b/dlls/mshtml/persist.c index 36b1a34..01af487 100644 --- a/dlls/mshtml/persist.c +++ b/dlls/mshtml/persist.c
@@ -196,7 +196,7 @@ } } - set_document_bscallback(This, bscallback); + set_window_bscallback(This->window, bscallback); IUnknown_Release((IUnknown*)bscallback); CoTaskMemFree(url); @@ -292,7 +292,7 @@ return hres; if(!bind_complete) - return start_binding(This, (BSCallback*)This->doc_obj->bscallback, pibc); + return start_binding(This, (BSCallback*)This->window->bscallback, pibc); return S_OK; } @@ -556,7 +556,7 @@ if(FAILED(hres)) return hres; - return channelbsc_load_stream(This->doc_obj->bscallback, pStm); + return channelbsc_load_stream(This->window->bscallback, pStm); } static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM pStm,