Commit 2d861005 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Pass GeckoBrowser instead of HTMLDocumentObj to create_outer_window.

parent 5e581621
...@@ -5445,7 +5445,6 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii ...@@ -5445,7 +5445,6 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
{ {
mozIDOMWindowProxy *mozwindow; mozIDOMWindowProxy *mozwindow;
HTMLDocumentObj *doc; HTMLDocumentObj *doc;
nsIDOMWindow *nswindow = NULL;
nsresult nsres; nsresult nsres;
HRESULT hres; HRESULT hres;
...@@ -5497,13 +5496,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii ...@@ -5497,13 +5496,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii
if(NS_FAILED(nsres)) if(NS_FAILED(nsres))
ERR("GetContentDOMWindow failed: %08x\n", nsres); ERR("GetContentDOMWindow failed: %08x\n", nsres);
nsres = mozIDOMWindowProxy_QueryInterface(mozwindow, &IID_nsIDOMWindow, (void**)&nswindow); hres = create_outer_window(doc->nscontainer, mozwindow, NULL, &doc->basedoc.window);
mozIDOMWindowProxy_Release(mozwindow);
assert(nsres == NS_OK);
hres = HTMLOuterWindow_Create(doc, nswindow, NULL /* FIXME */, &doc->basedoc.window);
if(nswindow)
nsIDOMWindow_Release(nswindow);
if(FAILED(hres)) { if(FAILED(hres)) {
htmldoc_release(&doc->basedoc); htmldoc_release(&doc->basedoc);
return hres; return hres;
......
...@@ -54,15 +54,9 @@ static HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc) ...@@ -54,15 +54,9 @@ static HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc)
return E_FAIL; return E_FAIL;
window = mozwindow_to_window(mozwindow); window = mozwindow_to_window(mozwindow);
if(!window) { if(!window && frame->element.node.doc->browser)
nsIDOMWindow *nswindow; hres = create_outer_window(frame->element.node.doc->browser, mozwindow,
nsres = mozIDOMWindowProxy_QueryInterface(mozwindow, &IID_nsIDOMWindow, (void**)&nswindow);
assert(nsres == NS_OK);
hres = HTMLOuterWindow_Create(frame->element.node.doc->basedoc.doc_obj, nswindow,
frame->element.node.doc->basedoc.window, &window); frame->element.node.doc->basedoc.window, &window);
nsIDOMWindow_Release(nswindow);
}
mozIDOMWindowProxy_Release(mozwindow); mozIDOMWindowProxy_Release(mozwindow);
if(FAILED(hres)) if(FAILED(hres))
return hres; return hres;
......
...@@ -3532,10 +3532,11 @@ static HRESULT create_inner_window(HTMLOuterWindow *outer_window, IMoniker *mon, ...@@ -3532,10 +3532,11 @@ static HRESULT create_inner_window(HTMLOuterWindow *outer_window, IMoniker *mon,
return S_OK; return S_OK;
} }
HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, HRESULT create_outer_window(GeckoBrowser *browser, mozIDOMWindowProxy *mozwindow,
HTMLOuterWindow *parent, HTMLOuterWindow **ret) HTMLOuterWindow *parent, HTMLOuterWindow **ret)
{ {
HTMLOuterWindow *window; HTMLOuterWindow *window;
nsresult nsres;
HRESULT hres; HRESULT hres;
window = alloc_window(sizeof(HTMLOuterWindow)); window = alloc_window(sizeof(HTMLOuterWindow));
...@@ -3545,17 +3546,12 @@ HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, ...@@ -3545,17 +3546,12 @@ HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow,
window->base.outer_window = window; window->base.outer_window = window;
window->base.inner_window = NULL; window->base.inner_window = NULL;
window->doc_obj = doc_obj; window->doc_obj = browser->doc;
if(nswindow) {
nsresult nsres;
nsIDOMWindow_AddRef(nswindow);
window->nswindow = nswindow;
nsres = nsIDOMWindow_QueryInterface(nswindow, &IID_mozIDOMWindowProxy, (void**)&window->window_proxy); mozIDOMWindowProxy_AddRef(mozwindow);
assert(nsres == NS_OK); window->window_proxy = mozwindow;
} nsres = mozIDOMWindowProxy_QueryInterface(mozwindow, &IID_nsIDOMWindow, (void**)&window->nswindow);
assert(nsres == NS_OK);
window->scriptmode = parent ? parent->scriptmode : SCRIPTMODE_GECKO; window->scriptmode = parent ? parent->scriptmode : SCRIPTMODE_GECKO;
window->readystate = READYSTATE_UNINITIALIZED; window->readystate = READYSTATE_UNINITIALIZED;
......
...@@ -867,7 +867,7 @@ HRESULT MHTMLDocument_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; ...@@ -867,7 +867,7 @@ HRESULT MHTMLDocument_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN; HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
HRESULT create_document_node(nsIDOMHTMLDocument*,GeckoBrowser*,HTMLInnerWindow*,HTMLDocumentNode**) DECLSPEC_HIDDEN; HRESULT create_document_node(nsIDOMHTMLDocument*,GeckoBrowser*,HTMLInnerWindow*,HTMLDocumentNode**) DECLSPEC_HIDDEN;
HRESULT HTMLOuterWindow_Create(HTMLDocumentObj*,nsIDOMWindow*,HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN; HRESULT create_outer_window(GeckoBrowser*,mozIDOMWindowProxy*,HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN;
HRESULT update_window_doc(HTMLInnerWindow*) DECLSPEC_HIDDEN; HRESULT update_window_doc(HTMLInnerWindow*) DECLSPEC_HIDDEN;
HTMLOuterWindow *mozwindow_to_window(const mozIDOMWindowProxy*) DECLSPEC_HIDDEN; HTMLOuterWindow *mozwindow_to_window(const mozIDOMWindowProxy*) DECLSPEC_HIDDEN;
void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN; void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN;
......
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