Commit e5c4acc4 authored by Gabriel Ivăncescu's avatar Gabriel Ivăncescu Committed by Alexandre Julliard

mshtml: Get rid of outer_window member in HTMLDocumentNode.

parent ff617c83
......@@ -4895,7 +4895,7 @@ static void HTMLDocumentNode_on_advise(IUnknown *iface, cp_static_data_t *cp)
{
HTMLDocumentNode *This = CONTAINING_RECORD((IHTMLDocument2*)iface, HTMLDocumentNode, IHTMLDocument2_iface);
if(This->outer_window)
if(This->window && This->window->base.outer_window)
update_doc_cp_events(This, cp);
}
......@@ -6208,7 +6208,6 @@ static HTMLDocumentNode *alloc_doc_node(HTMLDocumentObj *doc_obj, HTMLInnerWindo
doc->IDocumentRange_iface.lpVtbl = &DocumentRangeVtbl;
doc->doc_obj = doc_obj;
doc->outer_window = window ? window->base.outer_window : NULL;
doc->window = window;
if(window)
......
......@@ -50,7 +50,7 @@ static HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc)
window = mozwindow_to_window(mozwindow);
if(!window && frame->element.node.doc->browser) {
hres = create_outer_window(frame->element.node.doc->browser, mozwindow,
frame->element.node.doc->outer_window, &window);
frame->element.node.doc->window->base.outer_window, &window);
/* Don't hold ref to the created window; the parent keeps ref to it */
if(SUCCEEDED(hres))
......@@ -132,7 +132,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
if(!This->content_window || !This->element.node.doc || !This->element.node.doc->outer_window) {
if(!This->content_window || !This->element.node.doc || !This->element.node.doc->window || !This->element.node.doc->window->base.outer_window) {
nsAString nsstr;
nsresult nsres;
......@@ -150,7 +150,7 @@ static HRESULT WINAPI HTMLFrameBase_put_src(IHTMLFrameBase *iface, BSTR v)
return S_OK;
}
return navigate_url(This->content_window, v, This->element.node.doc->outer_window->uri, BINDING_NAVIGATED);
return navigate_url(This->content_window, v, This->element.node.doc->window->base.outer_window->uri, BINDING_NAVIGATED);
}
static HRESULT WINAPI HTMLFrameBase_get_src(IHTMLFrameBase *iface, BSTR *p)
......
......@@ -940,7 +940,6 @@ struct HTMLDocumentNode {
nsIDocumentObserver nsIDocumentObserver_iface;
ConnectionPointContainer cp_container;
HTMLOuterWindow *outer_window;
HTMLInnerWindow *window;
HTMLDocumentObj *doc_obj;
......
......@@ -314,7 +314,7 @@ static nsresult run_end_load(HTMLDocumentNode *This, nsISupports *arg1, nsISuppo
if(This->window == window) {
window->dom_interactive_time = get_time_stamp();
set_ready_state(This->outer_window, READYSTATE_INTERACTIVE);
set_ready_state(This->window->base.outer_window, READYSTATE_INTERACTIVE);
}
IHTMLWindow2_Release(&window->base.IHTMLWindow2_iface);
return NS_OK;
......
......@@ -336,7 +336,7 @@ static nsresult handle_load(HTMLDocumentNode *doc, nsIDOMEvent *event)
TRACE("(%p)\n", doc);
if(!doc->outer_window)
if(!doc->window || !doc->window->base.outer_window)
return NS_ERROR_FAILURE;
if(doc->doc_obj && doc->doc_obj->doc_node == doc) {
doc_obj = doc->doc_obj;
......@@ -348,7 +348,8 @@ static nsresult handle_load(HTMLDocumentNode *doc, nsIDOMEvent *event)
handle_docobj_load(doc_obj);
doc->window->dom_complete_time = get_time_stamp();
set_ready_state(doc->outer_window, READYSTATE_COMPLETE);
if(doc->window->base.outer_window)
set_ready_state(doc->window->base.outer_window, READYSTATE_COMPLETE);
if(doc_obj) {
if(doc_obj->view_sink)
......@@ -358,9 +359,9 @@ static nsresult handle_load(HTMLDocumentNode *doc, nsIDOMEvent *event)
update_title(doc_obj);
if(doc_obj->doc_object_service && !(doc->outer_window->load_flags & BINDING_REFRESH))
if(doc_obj->doc_object_service && doc->window->base.outer_window && !(doc->window->base.outer_window->load_flags & BINDING_REFRESH))
IDocObjectService_FireDocumentComplete(doc_obj->doc_object_service,
&doc->outer_window->base.IHTMLWindow2_iface, 0);
&doc->window->base.outer_window->base.IHTMLWindow2_iface, 0);
IUnknown_Release(doc_obj->outer_unk);
}
......@@ -516,7 +517,7 @@ static nsIDOMEventTarget *get_default_document_target(HTMLDocumentNode *doc)
nsISupports *target_iface;
nsresult nsres;
target_iface = doc->window ? (nsISupports*)doc->outer_window->nswindow : (nsISupports*)doc->dom_document;
target_iface = doc->window && doc->window->base.outer_window ? (nsISupports*)doc->window->base.outer_window->nswindow : (nsISupports*)doc->dom_document;
nsres = nsISupports_QueryInterface(target_iface, &IID_nsIDOMEventTarget, (void**)&target);
return NS_SUCCEEDED(nsres) ? target : NULL;
}
......
......@@ -490,10 +490,10 @@ static HRESULT exec_refresh(HTMLDocumentNode *doc, DWORD nCmdexecopt, VARIANT *p
}
}
if(!doc->outer_window)
if(!doc->window || !doc->window->base.outer_window)
return E_UNEXPECTED;
return reload_page(doc->outer_window);
return reload_page(doc->window->base.outer_window);
}
static HRESULT exec_stop(HTMLDocumentNode *doc, DWORD nCmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
......
......@@ -2227,12 +2227,12 @@ static HRESULT WINAPI PHServiceProvider_QueryService(IServiceProvider *iface, RE
TRACE("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
if(!This->doc || !This->doc->outer_window) {
if(!This->doc || !This->doc->window || !This->doc->window->base.outer_window) {
*ppv = NULL;
return E_NOINTERFACE;
}
return IServiceProvider_QueryService(&This->doc->outer_window->base.IServiceProvider_iface,
return IServiceProvider_QueryService(&This->doc->window->base.outer_window->base.IServiceProvider_iface,
guidService, riid, ppv);
}
......
......@@ -76,10 +76,10 @@ static HRESULT WINAPI InternetHostSecurityManager_ProcessUrlAction(IInternetHost
TRACE("(%p)->(%ld %p %ld %p %ld %lx %lx)\n", This, dwAction, pPolicy, cbPolicy, pContext, cbContext, dwFlags, dwReserved);
if(!This->outer_window)
if(!This->window || !This->window->base.outer_window)
return E_UNEXPECTED;
url = This->outer_window->url ? This->outer_window->url : L"about:blank";
url = This->window->base.outer_window->url ? This->window->base.outer_window->url : L"about:blank";
return IInternetSecurityManager_ProcessUrlAction(get_security_manager(), url, dwAction, pPolicy, cbPolicy,
pContext, cbContext, dwFlags, dwReserved);
......@@ -181,10 +181,10 @@ static HRESULT WINAPI InternetHostSecurityManager_QueryCustomPolicy(IInternetHos
TRACE("(%p)->(%s %p %p %p %ld %lx)\n", This, debugstr_guid(guidKey), ppPolicy, pcbPolicy, pContext, cbContext, dwReserved);
if(!This->outer_window)
if(!This->window || !This->window->base.outer_window)
return E_UNEXPECTED;
url = This->outer_window->url ? This->outer_window->url : L"about:blank";
url = This->window->base.outer_window->url ? This->window->base.outer_window->url : L"about:blank";
hres = IInternetSecurityManager_QueryCustomPolicy(get_security_manager(), url, guidKey, ppPolicy, pcbPolicy,
pContext, cbContext, dwReserved);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment