Module: wine Branch: master Commit: 2d8610050df647065080e30d1d10b9bd16f505ab URL: https://source.winehq.org/git/wine.git/?a=commit;h=2d8610050df647065080e30d1...
Author: Jacek Caban jacek@codeweavers.com Date: Mon Mar 11 14:24:59 2019 +0100
mshtml: Pass GeckoBrowser instead of HTMLDocumentObj to create_outer_window.
Signed-off-by: Jacek Caban jacek@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/mshtml/htmldoc.c | 9 +-------- dlls/mshtml/htmlframe.c | 10 ++-------- dlls/mshtml/htmlwindow.c | 18 +++++++----------- dlls/mshtml/mshtml_private.h | 2 +- 4 files changed, 11 insertions(+), 28 deletions(-)
diff --git a/dlls/mshtml/htmldoc.c b/dlls/mshtml/htmldoc.c index afb4a8a..5731d36 100644 --- a/dlls/mshtml/htmldoc.c +++ b/dlls/mshtml/htmldoc.c @@ -5445,7 +5445,6 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii { mozIDOMWindowProxy *mozwindow; HTMLDocumentObj *doc; - nsIDOMWindow *nswindow = NULL; nsresult nsres; HRESULT hres;
@@ -5497,13 +5496,7 @@ static HRESULT create_document_object(BOOL is_mhtml, IUnknown *outer, REFIID rii if(NS_FAILED(nsres)) ERR("GetContentDOMWindow failed: %08x\n", nsres);
- nsres = mozIDOMWindowProxy_QueryInterface(mozwindow, &IID_nsIDOMWindow, (void**)&nswindow); - mozIDOMWindowProxy_Release(mozwindow); - assert(nsres == NS_OK); - - hres = HTMLOuterWindow_Create(doc, nswindow, NULL /* FIXME */, &doc->basedoc.window); - if(nswindow) - nsIDOMWindow_Release(nswindow); + hres = create_outer_window(doc->nscontainer, mozwindow, NULL, &doc->basedoc.window); if(FAILED(hres)) { htmldoc_release(&doc->basedoc); return hres; diff --git a/dlls/mshtml/htmlframe.c b/dlls/mshtml/htmlframe.c index 17a78e5..1a0d017 100644 --- a/dlls/mshtml/htmlframe.c +++ b/dlls/mshtml/htmlframe.c @@ -54,15 +54,9 @@ static HRESULT set_frame_doc(HTMLFrameBase *frame, nsIDOMDocument *nsdoc) return E_FAIL;
window = mozwindow_to_window(mozwindow); - if(!window) { - nsIDOMWindow *nswindow; - nsres = mozIDOMWindowProxy_QueryInterface(mozwindow, &IID_nsIDOMWindow, (void**)&nswindow); - assert(nsres == NS_OK); - - hres = HTMLOuterWindow_Create(frame->element.node.doc->basedoc.doc_obj, nswindow, + if(!window && frame->element.node.doc->browser) + hres = create_outer_window(frame->element.node.doc->browser, mozwindow, frame->element.node.doc->basedoc.window, &window); - nsIDOMWindow_Release(nswindow); - } mozIDOMWindowProxy_Release(mozwindow); if(FAILED(hres)) return hres; diff --git a/dlls/mshtml/htmlwindow.c b/dlls/mshtml/htmlwindow.c index 4d36f60..d980645 100644 --- a/dlls/mshtml/htmlwindow.c +++ b/dlls/mshtml/htmlwindow.c @@ -3532,10 +3532,11 @@ static HRESULT create_inner_window(HTMLOuterWindow *outer_window, IMoniker *mon, return S_OK; }
-HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, +HRESULT create_outer_window(GeckoBrowser *browser, mozIDOMWindowProxy *mozwindow, HTMLOuterWindow *parent, HTMLOuterWindow **ret) { HTMLOuterWindow *window; + nsresult nsres; HRESULT hres;
window = alloc_window(sizeof(HTMLOuterWindow)); @@ -3545,17 +3546,12 @@ HRESULT HTMLOuterWindow_Create(HTMLDocumentObj *doc_obj, nsIDOMWindow *nswindow, window->base.outer_window = window; window->base.inner_window = NULL;
- window->doc_obj = doc_obj; - - if(nswindow) { - nsresult nsres; - - nsIDOMWindow_AddRef(nswindow); - window->nswindow = nswindow; + window->doc_obj = browser->doc;
- nsres = nsIDOMWindow_QueryInterface(nswindow, &IID_mozIDOMWindowProxy, (void**)&window->window_proxy); - assert(nsres == NS_OK); - } + mozIDOMWindowProxy_AddRef(mozwindow); + 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->readystate = READYSTATE_UNINITIALIZED; diff --git a/dlls/mshtml/mshtml_private.h b/dlls/mshtml/mshtml_private.h index 2808ca9..aa0cac8 100644 --- a/dlls/mshtml/mshtml_private.h +++ b/dlls/mshtml/mshtml_private.h @@ -867,7 +867,7 @@ HRESULT MHTMLDocument_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 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; HTMLOuterWindow *mozwindow_to_window(const mozIDOMWindowProxy*) DECLSPEC_HIDDEN; void get_top_window(HTMLOuterWindow*,HTMLOuterWindow**) DECLSPEC_HIDDEN;